[Mapbender-commits] r4857 - branches/2.6/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 23 05:53:22 EDT 2009


Author: christoph
Date: 2009-10-23 05:53:21 -0400 (Fri, 23 Oct 2009)
New Revision: 4857

Modified:
   branches/2.6/http/javascripts/mod_setBackground.php
   branches/2.6/http/javascripts/ovnf.php
Log:


Modified: branches/2.6/http/javascripts/mod_setBackground.php
===================================================================
--- branches/2.6/http/javascripts/mod_setBackground.php	2009-10-23 09:06:05 UTC (rev 4856)
+++ branches/2.6/http/javascripts/mod_setBackground.php	2009-10-23 09:53:21 UTC (rev 4857)
@@ -32,15 +32,16 @@
 });
 var mod_setBackground_active = false;
 function mod_setBackground_init(){
+	var map = getMapObjByName(mod_setBackground_target);
 	var setBackgroundSelectBox = document.setBackground.mod_setBackground_list;
 	var ind = setBackgroundSelectBox.options[0].value;
 	var cnt = 0;
 	var selInd;
 
 	setBackgroundSelectBox.options[setBackgroundSelectBox.length - 1] = null;
-	for(var i=0; i<wms.length; i++){
-		if(wms[i].gui_wms_visible == '0'){
-			var title = wms[i].wms_title;
+	for(var i=0; i<map.wms.length; i++){
+		if(map.wms[i].gui_wms_visible == '0'){
+			var title = map.wms[i].wms_title;
 			var newO = new Option(title, i, false,false);
 
 			setBackgroundSelectBox.options[setBackgroundSelectBox.length] = newO;
@@ -51,15 +52,16 @@
 		}
 	}
 	if (cnt >0){
-		wms[ind].gui_wms_visible = 2;
+		map.wms[ind].gui_wms_visible = 2;
 		setBackgroundSelectBox.selectedIndex = selInd;
 	}
 	mod_setBackground_active = ind;
 }
 
 function mod_setBackground_change(obj){	
-	wms[mod_setBackground_active].gui_wms_visible = 0;
-	wms[obj.value].gui_wms_visible = 2;
+	var map = getMapObjByName(mod_setBackground_target);
+	map.wms[mod_setBackground_active].gui_wms_visible = 0;
+	map.wms[obj.value].gui_wms_visible = 2;
 	mod_setBackground_active = obj.value;
 	zoom(mod_setBackground_target,true, 1.0); 
 }

Modified: branches/2.6/http/javascripts/ovnf.php
===================================================================
--- branches/2.6/http/javascripts/ovnf.php	2009-10-23 09:06:05 UTC (rev 4856)
+++ branches/2.6/http/javascripts/ovnf.php	2009-10-23 09:53:21 UTC (rev 4857)
@@ -34,9 +34,9 @@
 var mod_overview_width = <?php echo $e_width; ?>;
 var mod_overview_height = <?php echo $e_height; ?>;
 
-mb_registerMapObj('', 'overview', overview_wms ,<?php echo $e_width; ?>, <?php echo $e_height; ?>);
-parent.eventInitMap.register(function init_overview(){
-	var ind = getMapObjIndexByName('overview');
+mb_registerMapObj('', '<?php echo $e_id; ?>', overview_wms ,<?php echo $e_width; ?>, <?php echo $e_height; ?>);
+eventInitMap.register(function init_overview(){
+	var ind = getMapObjIndexByName('<?php echo $e_id; ?>');
 	
 	var el = mb_mapObj[ind].getDomElement();
 	el.onmouseover = mod_ovSetHandler;
@@ -46,20 +46,38 @@
 	
 	var ov_extent = mb_mapObj[ind].getExtentInfos();
 	mb_mapObj[ind].isOverview = true;
+		// if the setBackground module is active,
+	// the overview wms might be hidden.
+	// so we activate it here.
+	mb_mapObj[ind].wms[0].gui_wms_visible = 1;
+
 	
+});
+
+eventAfterInit.register(function () {
+	var ind = getMapObjIndexByName('<?php echo $e_id; ?>');
 	mb_mapObj[ind].skipWmsIfSrsNotSupported = 
 		skipWmsIfSrsNotSupported === 1 ? true : false;
 
 });
 
 function mod_ovSetHandler(e){
-	mb_isBF = 'overview';
-	mb_zF = mod_overview_target;
+	var targetId = $.browser.msie ? window.event.srcElement.id : e.target.id;
+	if(!mb_isActive){
+		mb_isBF = '<?php echo $e_id; ?>';
+		mb_zF = mod_overview_target;
+		return false;
+	}
+	return true;
 }
 function mod_ovGetExtent(e){
-	mb_isBF = 'overview';
-	mb_zF = mod_overview_target;
-	mod_box_setValidClipping(mod_box_stop(e));
+	var targetId = $.browser.msie ? window.event.srcElement.id : e.target.id;
+	if(targetId.substr(0, mb_isBF.length) === mb_isBF){
+		mb_zF = mod_overview_target;
+		mod_box_setValidClipping(mod_box_stop(e));
+		return false;
+	}
+	return true;
 }
 
 eventAfterMapRequest.register(function () {
@@ -73,7 +91,7 @@
 	var minY = parseFloat(arrayBBox[1]);
 	var maxX = parseFloat(arrayBBox[2]);
 	var maxY = parseFloat(arrayBBox[3]);
-	var mapObj = getMapObjByName("overview");
+	var mapObj = getMapObjByName("<?php echo $e_id; ?>");
 	var pointMin = mapObj.convertRealToPixel(new Point(minX, maxY)); 
 	var pointMax = mapObj.convertRealToPixel(new Point(maxX, minY)); 
 	var px1 = pointMin.x;
@@ -81,7 +99,9 @@
 	var px2 = pointMax.x;
 	var py2 = pointMax.y;
 
-	mb_isBF = "overview";
+	var tmp_mb_isBF = mb_isBF;
+	var tmp_mb_zF = mb_zF;
+	mb_isBF = "<?php echo $e_id; ?>";
 	mb_zF = mod_overview_target;
 	
 	while((px2 - px1) < 8){
@@ -106,6 +126,7 @@
 	if(py2 < 0){py2 = 1;}
 
 	mb_drawBox(px1,py1,px2,py2);
+	mb_isBF = tmp_mb_isBF;
+	mb_zF = tmp_mb_zF;
+
 });
-
-



More information about the Mapbender_commits mailing list