svn commit: r774 - trunk/mapbender/http/classes/class_wmc.php

christoph at osgeo.org christoph at osgeo.org
Fri Sep 29 04:09:42 EDT 2006


Author: christoph
Date: 2006-09-29 08:09:42+0000
New Revision: 774

Modified:
   trunk/mapbender/http/classes/class_wmc.php

Log:
improved overview handling

Modified: trunk/mapbender/http/classes/class_wmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/classes/class_wmc.php?view=diff&rev=774&p1=trunk/mapbender/http/classes/class_wmc.php&p2=trunk/mapbender/http/classes/class_wmc.php&r1=773&r2=774
==============================================================================
--- trunk/mapbender/http/classes/class_wmc.php	(original)
+++ trunk/mapbender/http/classes/class_wmc.php	2006-09-29 08:09:42+0000
@@ -82,8 +82,6 @@
 		var $wmc_layer_style_sld_title = array();
 		
 		var $wmc_wms_count = 0;
-		
-			
 			
 	/*	
 	 	var $data_type = array(); 
@@ -133,7 +131,8 @@
 	xml_parse_into_struct($parser,$data,$values,$tags);
 	$code = xml_get_error_code ($parser);
 	if ($code) {
-		echo "<br><br>Error " . $code . " (" . xml_error_string($code) .  ")<br><br>";
+		echo "alert('Error " . $code . " (" . xml_error_string($code) .  ")');\n";
+		return false;
 	}
 	xml_parser_free($parser);
 	
@@ -528,6 +527,7 @@
 				}
 			}
 		}
+		return true;
 	  //return $verbose;
 	}
 
@@ -722,13 +722,28 @@
 			$wmc_string .= "\t\t" . $target . "document.getElementById(old_mapObj[i].frameName).style.height = " . $this->wmc_windowHeight . ";\n";
 			$wmc_string .= "\t}\n";
 			$wmc_string .= "\telse {\n";
-			$wmc_string .= "\t\t" . $target . "mb_registerMapObj('overview', old_mapObj[i].elementName, 0, old_mapObj[i].width,  old_mapObj[i].width);\n"; 
+			$wmc_string .= "\t\tvar found = false;\n";
+			$wmc_string .= "\t\tfor (var j=0; j < " . $target . "wms.length && found == false; j++) {\n";
+			$wmc_string .= "\t\t\tif (" . $target . "wms[j].wms_getmap == old_mapObj[i].wms[0].wms_getmap) {\n";
+			$wmc_string .= "\t\t\t\t" . $target . "mb_registerMapObj('overview', old_mapObj[i].elementName, j, old_mapObj[i].width,  old_mapObj[i].width);\n"; 
+			$wmc_string .= "\t\t\t\tfound = true;\n"; 
+			$wmc_string .= "\t\t\t}\n";
+			$wmc_string .= "\t\t}\n";
+			$wmc_string .= "\t\tif (!found) {\n";
+			$wmc_string .= "\t\t\t" . $target . "mb_registerMapObj('overview', old_mapObj[i].elementName, 0, old_mapObj[i].width,  old_mapObj[i].width);\n"; 
+			$wmc_string .= "\t\t}\n";
 			$wmc_string .= "\t}\n";
 			$wmc_string .= "}\n";
 			$wmc_string .= "for (var i=0; i<old_mapObj.length; i++) {\n";
-			$wmc_string .= "\t".$target."mb_calculateExtent(old_mapObj[i].frameName, ";
+			$wmc_string .= "\tif (old_mapObj[i].frameName != 'overview') {\n";
+			$wmc_string .= "\t\t".$target."mb_calculateExtent(old_mapObj[i].frameName, ";
 			$wmc_string .= $this->wmc_bBox_minx .",".$this->wmc_bBox_miny .",";
 			$wmc_string .= $this->wmc_bBox_maxx .",".$this->wmc_bBox_maxy.");\n";
+			$wmc_string .= "\t}\n";
+			$wmc_string .= "\telse {\n";
+			$wmc_string .= "\t\tvar ov_index = " . $target . "getMapObjIndexByName('overview');\n";
+			$wmc_string .= "\t\t" . $target . "mb_mapObj[ov_index].extent = old_mapObj[i].extent;\n"; 
+			$wmc_string .= "\t}\n";
 			$wmc_string .= "\t". $target . "setMapRequest(old_mapObj[i].frameName);\n";
 			$wmc_string .= "}\n";
 			$wmc_string .= $target . "mb_execloadWmsSubFunctions();\n";




More information about the Mapbender_commits mailing list