[Mapbender-commits] r8432 - in branches/2.7/http: classes javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Jul 6 03:19:23 PDT 2012


Author: astrid_emde
Date: 2012-07-06 03:19:22 -0700 (Fri, 06 Jul 2012)
New Revision: 8432

Modified:
   branches/2.7/http/classes/class_map.php
   branches/2.7/http/classes/class_wmc.php
   branches/2.7/http/javascripts/mod_loadwmc.js
Log:
merged changes concerning ticket 877
from trunk

http://trac.osgeo.org/mapbender/ticket/877
http://trac.osgeo.org/mapbender/changeset/8286 

Modified: branches/2.7/http/classes/class_map.php
===================================================================
--- branches/2.7/http/classes/class_map.php	2012-07-06 10:06:48 UTC (rev 8431)
+++ branches/2.7/http/classes/class_map.php	2012-07-06 10:19:22 UTC (rev 8432)
@@ -516,7 +516,12 @@
 			$wms->gui_wms_mapformat = $currentWms->gui_wms_mapformat;
 			$wms->gui_wms_featureinfoformat = $currentWms->gui_wms_featureinfoformat;
 			$wms->gui_wms_exceptionformat = $currentWms->gui_wms_exceptionformat;
-			$wms->gui_wms_opacity = $currentWms->gui_wms_opacity;
+			$e = new mb_notice('class_map: gui_wms_mapopacity: '.$currentWms->gui_wms_mapopacity);
+			if (!isset($currentWms->gui_wms_mapopacity) || $currentWms->gui_wms_mapopacity =='') {
+				$wms->gui_wms_opacity = 100;
+			} else {
+				$wms->gui_wms_opacity = ($currentWms->gui_wms_mapopacity)*100;//this definition is not easy to understand. TODO: find another, consistent behavior.
+			}
 			$wms->gui_wms_sldurl = $currentWms->gui_wms_sldurl;
 			$wms->gui_wms_visible = $currentWms->gui_wms_visible;
 			$wms->gui_wms_epsg = $currentWms->gui_wms_epsg;

Modified: branches/2.7/http/classes/class_wmc.php
===================================================================
--- branches/2.7/http/classes/class_wmc.php	2012-07-06 10:06:48 UTC (rev 8431)
+++ branches/2.7/http/classes/class_wmc.php	2012-07-06 10:19:22 UTC (rev 8432)
@@ -548,8 +548,8 @@
 
 					$LegendResources = $xpath->query("../../wmc:StyleList/wmc:Style/wmc:LegendURL/wmc:OnlineResource",$WMSId);
 					foreach ($LegendResources as $LegendResource) {
-							$e = new mb_notice("class_wmc.php: old getlegendurl (WMC): ".$LegendResource->getAttribute("xlink:href"));
-							$e = new mb_notice("class_wmc.php: new getlegendurl (OWSPROXY): ".$wmsGetLegendUrl);
+							$e = new mb_exception("class_wmc.php: old getlegendurl (WMC): ".$LegendResource->getAttribute("xlink:href"));
+							$e = new mb_exception("class_wmc.php: new getlegendurl (OWSPROXY): ".$wmsGetLegendUrl);
 							//get param part of getlegend url from xml
 							$arURL = parse_url($LegendResource->getAttribute("xlink:href"));
 							$query = $arURL["query"];
@@ -559,6 +559,7 @@
 				} else { //service is not secured - exchange urls only when they may have changed
 					$wmsGetMapUrl = $row["wms_getmap"];
 					$wmsGetLegendUrl = $row["wms_getlegendurl"];
+					
 					//in cases when no owsproxy is defined exchange only if timestamp are not in sync
 					$wms_timestamp = $row["wms_timestamp"];
 					//if ($this->timestamp < $wms_timestamp) {//TODO: check if such a distiction is really needful - the timestamp of a wmc changes if some metadata changes - therefor it is needed - exchange all urls by default! 
@@ -573,16 +574,17 @@
 							$MapResource->setAttribute("xlink:href",$wmsGetMapUrl);
 						}
 
-						$LegendResources = $xpath->query("../../wmc:StyleList/wmc:Style/wmc:LegendURL/wmc:OnlineResource",$WMSId);
-						foreach ($LegendResources as $LegendResource) {
-							$e = new mb_notice("class_wmc.php: old getlegendurl (WMC): ".$LegendResource->getAttribute("xlink:href"));
-							$e = new mb_notice("class_wmc.php: new getlegendurl (DB): ".$wmsGetLegendUrl);
+						//$LegendResources = $xpath->query("../../wmc:StyleList/wmc:Style/wmc:LegendURL/wmc:OnlineResource",$WMSId);
+						
+						/*foreach ($LegendResources as $LegendResource) {
+							$e = new mb_exception("class_wmc.php: old getlegendurl (WMC): ".$LegendResource->getAttribute("xlink:href"));
+							$e = new mb_exception("class_wmc.php: new getlegendurl (DB): ".$wmsGetLegendUrl);
 							//get param part of getlegend url from xml
 							$arURL = parse_url($LegendResource->getAttribute("xlink:href"));
 							$query = $arURL["query"];
 							$url = $wmsGetLegendUrl . $query;
 							$LegendResource->setAttribute("xlink:href",$url);
-						}
+						}*/
 					}
 				}
 				
@@ -1211,14 +1213,18 @@
 		}
 
 		// .. request the map
+		
+		array_push($wmcJsArray, "lock_maprequest = true;");
+		array_push($wmcJsArray, "eventAfterLoadWMS.trigger();"); //TODO: Why? Reload tree? Other way to do this?
+		array_push($wmcJsArray, "lock_maprequest = false;");
 		array_push($wmcJsArray, "Mapbender.modules['".$this->mainMap->getFrameName().
 			"'].setMapRequest();");
 		if ($this->overviewMap !== null) {
 			array_push($wmcJsArray, "try {Mapbender.modules['".$this->overviewMap->getFrameName().
 				"'].setMapRequest()} catch (e) {};");
 		}
-
-		array_push($wmcJsArray, "eventAfterLoadWMS.trigger();");
+		//?initializeWms()
+		//eventAfterLoadWMS.register(reloadTree);
 		return $wmcJsArray;
 	}
 
@@ -1294,7 +1300,11 @@
 	protected function createObjFromWMC_xml($data) {
 	// store xml
 		$this->xml = $data;
-
+		//$wmcXml = simplexml_load_string(mb_utf8_encode($data));
+		//if ($wmcXml) {
+		//	$e = new mb_exception("class_wmc.php: parsing wmc successfully");
+		//}
+		
 		$values = administration::parseXml($data);
 		if (!$values) {
 			throw new Exception("WMC document could not be parsed.");

Modified: branches/2.7/http/javascripts/mod_loadwmc.js
===================================================================
--- branches/2.7/http/javascripts/mod_loadwmc.js	2012-07-06 10:06:48 UTC (rev 8431)
+++ branches/2.7/http/javascripts/mod_loadwmc.js	2012-07-06 10:19:22 UTC (rev 8432)
@@ -371,8 +371,10 @@
 					}
 					if (obj.javascript && typeof(obj.javascript) == "object") {
 						for (var j = 0; j < obj.javascript.length; j++) {
-//							var e = new Mb_notice("Statement: " + obj.javascript[j]);
-//							console.log("Statement: " + obj.javascript[j]);
+							//TODO: prohibit multiple maprequests when load wmc, cause on maprequests the wmc maybe stored to session :-(   
+							//alert("Statement: " + obj.javascript[j]);
+							//eventAfterLoadWMS.trigger(); -- load the each wms again and saves the wmc to session for each wms - prohibit this behaviour!!!! - Done by global lock_maprequest in class_wmc.php line 1220+!!
+							//console.log("Statement: " + obj.javascript[j]);
 							eval(obj.javascript[j]);
 						}
 						if (args.method === "loadWmc") {



More information about the Mapbender_commits mailing list