try{ if (resize_option){} } catch(e){ resize_option = "auto"; } try{ if (adjust_width){} } catch(e){ adjust_width = "-45"; } try{ if (adjust_height){} } catch(e){ adjust_height = "-35"; } var map_frame = ""; var map_frame_left = ""; var map_frame_top = ""; var legend_width = ""; function frameWidth(){ if (window.innerWidth) return window.innerWidth; else if (document.body && document.body.offsetWidth) return document.body.offsetWidth; else return 0; } function frameHeight(){ if (window.innerHeight)return window.innerHeight; else if (document.body && document.body.offsetHeight) return document.body.offsetHeight; else return 0; } function adjustDimension(skipMapRequest){ var ind = getMapObjIndexByName(""); var mapheight = frameHeight() - + parseInt(adjust_height); var mapwidth = frameWidth() - map_frame_left - legend_width + parseInt(adjust_width) ; var coords = mb_mapObj[ind].extent.split(","); midcoordx=parseFloat((parseFloat(coords[2])-parseFloat(coords[0]))/2)+parseFloat(coords[0]); midcoordy=parseFloat((parseFloat(coords[3])-parseFloat(coords[1]))/2)+parseFloat(coords[1]); mb_mapObj[ind].setWidth(mapwidth); mb_mapObj[ind].setHeight(mapheight); mb_mapObj[ind].calculateExtent(new Extent( parseFloat(coords[0]), parseFloat(coords[1]), parseFloat(coords[2]), parseFloat(coords[3]) )); if (!skipMapRequest) { mb_mapObj[ind].setMapRequest(); } } function rebuild() { if (width_temp != frameWidth() || height_temp != frameHeight()) window.setTimeout('adjustDimension()', 500); } function control(skipMapRequest){ adjustDimension(skipMapRequest); if (!window.width_temp && window.innerWidth) { window.onresize = rebuild; width_temp = frameWidth(); height_temp = frameHeight(); } if (!window.width_temp && document.body && document.body.offsetWidth) { window.onresize = rebuild; width_temp = frameWidth(); height_temp = frameHeight(); } } if (resize_option == 'auto'){ eventInit.register(function() { control(true); }); }