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(map_frame); var mapheight = frameHeight() - - 35; var mapwidth = frameWidth() - map_frame_left - legend_width - 45 ; var pos = makeClickPos2RealWorldPos(map_frame,mapwidth,mapheight); var coords = mb_mapObj[ind].extent.split(","); mb_mapObj[ind].extent = coords[0] + "," + pos[1] + "," + pos[0] + "," + coords[3]; 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; zoomFull(); } function zoomFull(){ var ind = this.getMapObjIndexByName(""); var arrayThemen = new Array(); var arrayThemen = mb_mapObj[ind].wms[0].objLayer[0].layer_name; this.Layer0 = arrayThemen; this.width = mb_mapObj[ind].width; this.height = mb_mapObj[ind].height; this.epsg = wms[0].gui_wms_epsg; var arrayExt = new Array(); var frameName = "" var exts = setExtent(width,height,epsg); arrayExt = exts.split(","); mb_repaint(frameName,arrayExt[0],arrayExt[1],arrayExt[2],arrayExt[3]); } 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(); } } window.setTimeout('control()', 3000);