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(){ 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].width = mapwidth; mb_mapObj[ind].height = mapheight; document.getElementById(map_frame).style.width = mb_mapObj[ind].width; document.getElementById(map_frame).style.height = mb_mapObj[ind].height; window.frames[map_frame].document.getElementById("maps").style.width = mb_mapObj[ind].width; window.frames[map_frame].document.getElementById("maps").style.height = mb_mapObj[ind].height; mb_repaintScale("",midcoordx,midcoordy,mb_getScale("")); } function rebuild() { if (width_temp != frameWidth() || height_temp != frameHeight()) window.setTimeout('adjustDimension()', 500); } function control(){ adjustDimension(); 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(); }); }