[Mapbender-commits] r3223 - in trunk/mapbender/http: html javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Nov 12 03:48:38 EST 2008


Author: christoph
Date: 2008-11-12 03:48:37 -0500 (Wed, 12 Nov 2008)
New Revision: 3223

Modified:
   trunk/mapbender/http/html/mod_treefolder2.php
   trunk/mapbender/http/javascripts/mod_scaleHint.php
   trunk/mapbender/http/javascripts/mod_scaleSel.php
   trunk/mapbender/http/php/mod_map1.php
   trunk/mapbender/http/php/mod_mapOV.php
Log:
aligning code to changes in

http://trac.osgeo.org/mapbender/ticket/323

Modified: trunk/mapbender/http/html/mod_treefolder2.php
===================================================================
--- trunk/mapbender/http/html/mod_treefolder2.php	2008-11-12 08:46:42 UTC (rev 3222)
+++ trunk/mapbender/http/html/mod_treefolder2.php	2008-11-12 08:48:37 UTC (rev 3223)
@@ -150,7 +150,7 @@
 		return;
 	}
 	//scalehints
-	var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
+	var scale = parseInt(parent.mb_mapObj[selectedMap].getScale());
 	if(scale < parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) && parseInt(parent.mb_mapObj[selectedMap].wms[selectedWMS].objLayer[selectedLayer].gui_layer_minscale) != 0){
 		if(selectedLayer==0)
 		   	setNodeColor(arrNodes[0][0]+"|"+parent.mb_mapObj[selectedMap].wms[selectedWMS].wms_id, '#999999');
@@ -178,8 +178,8 @@
 function updateScale(){
 	if(!init)return;
 	for(var i=0; i<parent.mb_mapObj.length; i++){
-		var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
 		if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+			var scale = parent.mb_mapObj[i].getScale();
 			for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
 				for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
 					if(scale < parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) && parseInt(parent.mb_mapObj[i].wms[ii].objLayer[iii].gui_layer_minscale) != 0){
@@ -210,8 +210,8 @@
 	if(!init||lock_check)return;
 	lock_check=true;
 	for(var i=0; i<parent.mb_mapObj.length; i++){
-		var scale = parseInt(parent.mb_getScale(mod_treeGDE_map));
 		if(parent.mb_mapObj[i].frameName == mod_treeGDE_map){
+			var scale = parent.mb_mapObj[i].getScale();
 			for(var ii=0; ii<parent.mb_mapObj[i].wms.length; ii++){
 				for(var iii=1; iii<parent.mb_mapObj[i].wms[ii].objLayer.length; iii++){
 					if(!parent.mb_mapObj[i].wms[ii].objLayer[iii].has_childs){

Modified: trunk/mapbender/http/javascripts/mod_scaleHint.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_scaleHint.php	2008-11-12 08:46:42 UTC (rev 3222)
+++ trunk/mapbender/http/javascripts/mod_scaleHint.php	2008-11-12 08:48:37 UTC (rev 3223)
@@ -28,7 +28,8 @@
 mb_registerPreFunctions("mod_scaleHint_init(frameName)");
 function mod_scaleHint_init(frameName){
 	if(frameName == mod_scaleHint_target){
-		var scale = mb_getScale(frameName);
+		var ind = getMapObjIndexByName(frameName);
+		var scale = mb_mapObj[ind].getScale();
 		if(scale < mod_scaleHint_min || scale > mod_scaleHint_max){
 			if(scale < mod_scaleHint_min){
 				var newScale = mod_scaleHint_min;

Modified: trunk/mapbender/http/javascripts/mod_scaleSel.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_scaleSel.php	2008-11-12 08:46:42 UTC (rev 3222)
+++ trunk/mapbender/http/javascripts/mod_scaleSel.php	2008-11-12 08:48:37 UTC (rev 3223)
@@ -27,7 +27,8 @@
 }
 function mod_scaleSelect_val(frameName){
 	if(frameName == mod_scaleSelect_target){
-		var scale = mb_getScale(frameName);
+		var ind = getMapObjIndexByName(frameName);
+		var scale = mb_mapObj[ind].getScale();
 		document.getElementById("scaleSelect").options[0].text = "1 : " + scale;
 		document.getElementById("scaleSelect").options[0].selected = true;
 	}

Modified: trunk/mapbender/http/php/mod_map1.php
===================================================================
--- trunk/mapbender/http/php/mod_map1.php	2008-11-12 08:46:42 UTC (rev 3222)
+++ trunk/mapbender/http/php/mod_map1.php	2008-11-12 08:48:37 UTC (rev 3223)
@@ -66,7 +66,7 @@
 function init () {
 	
 	parent.eventInitMap.register(function init_mod_map1(){
-		parent.mb_registerMapObj('mapframe1', 'maps', null,mod_map1_width, mod_map1_height);
+		parent.mb_registerMapObj('mapframe1', 'mapframe1', null,mod_map1_width, mod_map1_height);
 		
 		if (!parent.$.browser.msie) {
 			
@@ -124,8 +124,9 @@
 </script>
 </head>
 <body leftmargin='0' topmargin='0' onload="init()" bgcolor='#ffffff'>
+<div id='mapframe1' name='mapframe1' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:2;'>
 <div id='markResult' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:26'> </div>
-<div id='maps' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:2;'> </div>
+<div id='mapframe1_maps' name='maps' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index:2;'> </div>
 <div id='highlight' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible"><img src="../img/redball.gif"/></div>
 <div id='l_right' name='l_right' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:10;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
 <div id='l_bottom'  name='l_bottom' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:11;visibility:hidden;background-color:#ff0000;cursor: crosshair;"></div>
@@ -144,5 +145,6 @@
 <div id='um_draw' name='um_draw' style="LEFT:0px;OVERFLOW:visible;POSITION:absolute;TOP:0px;z-index:99;"></div>
 <img id='um_img' name='um_img' style ='position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; border:0;z-index:100' src='../img/transparent.gif' useMap='#um'>
 <map name='um' id='um'></map>
+</div>
 </body>
 </html>

Modified: trunk/mapbender/http/php/mod_mapOV.php
===================================================================
--- trunk/mapbender/http/php/mod_mapOV.php	2008-11-12 08:46:42 UTC (rev 3222)
+++ trunk/mapbender/http/php/mod_mapOV.php	2008-11-12 08:48:37 UTC (rev 3223)
@@ -63,7 +63,7 @@
 
 function init () {
 	parent.eventInitMap.register(function init_mod_mapOV(){
-		parent.mb_registerMapObj('overview', 'maps', mod_overview_rank, mod_overview_width, mod_overview_height);
+		parent.mb_registerMapObj('overview', 'overview', mod_overview_rank, mod_overview_width, mod_overview_height);
 		document.onmouseover = mod_ov_setHandler;
 		document.onmousedown = parent.mod_box_start;
 		document.onmouseup = mod_ov_getExtent;
@@ -90,12 +90,13 @@
 			var minY = parseFloat(arrayBBox[1]);
 			var maxX = parseFloat(arrayBBox[2]);
 			var maxY = parseFloat(arrayBBox[3]);
-			var posMin = parent.makeRealWorld2mapPos("overview",minX,maxY);
-			var posMax = parent.makeRealWorld2mapPos("overview",maxX,minY);
-			var px1 = posMin[0];
-			var py1 = posMin[1];
-			var px2 = posMax[0];
-			var py2 = posMax[1];
+			var ind = parent.getMapObjIndexByName(mod_overview_target);
+			var pointMin = parent.mb_mapObj[ind].convertRealToPixel(new parent.Point(minX, maxY)); 
+			var pointMax = parent.mb_mapObj[ind].convertRealToPixel(new parent.Point(maxX, minY)); 
+			var px1 = pointMin.x;
+			var py1 = pointMin.y;
+			var px2 = pointMax.x;
+			var py2 = pointMax.y;
 
 		parent.mb_isBF = "overview";
 		parent.mb_zF = mod_overview_target;
@@ -136,11 +137,13 @@
 </script>
 </head>
 <body leftmargin='0' topmargin='0' onload="init()"  bgcolor='#ffffff'>
-<div id='maps' name='maps' style =' position:absolute;left:0px;top:0px;width:0px;height:0px;' ></div>
+<div id='overview' name='overview' style =' position:absolute;left:0px;top:0px;width:0px;height:0px;' >
+<div id='overview_maps' name='maps' style =' position:absolute;left:0px;top:0px;width:0px;height:0px;' ></div>
 <div id='l_top' name='l_top' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:11;visibility:hidden;background-color:red;cursor: crosshair;"></div>
 <div id='l_right' name='l_right' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:12;visibility:hidden;background-color:red;cursor: crosshair;"></div>
 <div id='l_bottom'  name='l_bottom' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:13;visibility:hidden;background-color:red;cursor: crosshair;"></div>
 <div id='l_left' name='l_left' style="position:absolute;top:0px;left:0px;width:0px;height:0px;overflow:hidden;z-index:14;visibility:hidden;background-color:red;cursor: crosshair;"></div>
 <div id='highlight' style="position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible"><img src="../img/redball.gif" width="14" height="14" /></div>
+</div>
 </body>
 </html>



More information about the Mapbender_commits mailing list