[Mapbender-commits] r9576 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Sep 7 05:41:30 PDT 2016


Author: armin11
Date: 2016-09-07 05:41:30 -0700 (Wed, 07 Sep 2016)
New Revision: 9576

Modified:
   trunk/mapbender/http/javascripts/initWmcObj.php
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/wms.js
Log:
New options for optional wms dimension support (first time dimension implemented)

Modified: trunk/mapbender/http/javascripts/initWmcObj.php
===================================================================
--- trunk/mapbender/http/javascripts/initWmcObj.php	2016-09-05 14:24:31 UTC (rev 9575)
+++ trunk/mapbender/http/javascripts/initWmcObj.php	2016-09-07 12:41:30 UTC (rev 9576)
@@ -123,14 +123,14 @@
     //$wmcDocSession = getWmcFromStorage($wmc_filename);
     $time_end = microtime();
     $timediff = $time_end - $time_start;
-    $e = new mb_exception('initWmcObj.php: time to load wmc from storage: '.$timediff. '('.TMP_WMC_SAVE_STORAGE.')');
+    //$e = new mb_exception('initWmcObj.php: time to load wmc from storage: '.$timediff. '('.TMP_WMC_SAVE_STORAGE.')');
 }
 try {
 	$loadFromSession = new ElementVar($app, "loadwmc", "loadFromSession");
 	if ($wmcDocSession && $loadFromSession->value === "1") {
 	//check if session contains a wmc,
 	//otherwise create a new wmc from application
-		$e = new mb_exception("trying to load session WMC...");
+		//$e = new mb_notice("trying to load session WMC...");
 		if (!$wmc->createFromXml($wmcDocSession)) {
 			$e = new mb_notice("loading session WMC failed.");
 			$e = new mb_notice("creating wmc from app: ".$app);

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2016-09-05 14:24:31 UTC (rev 9575)
+++ trunk/mapbender/http/javascripts/map_obj.js	2016-09-07 12:41:30 UTC (rev 9576)
@@ -919,10 +919,10 @@
 	//	alert(currentWms.gui_wms_dimension_time);
 	//}
 	if (currentWms.gui_wms_dimension_time !== false && currentWms.gui_wms_dimension_time !== "") {
-		url += "&TIME="+encodeURI(currentWms.gui_wms_dimension_time);
+		url += "TIME="+encodeURIComponent(currentWms.gui_wms_dimension_time)+"&";
 	}
 	if (currentWms.gui_wms_dimension_elevation !== false && currentWms.gui_wms_dimension_elevation !== "") {
-		url += "&ELEVATION="+encodeURI(currentWms.gui_wms_dimension_elevation);
+		url += "ELEVATION="+encodeURIComponent(currentWms.gui_wms_dimension_elevation)+"&";
 	}
         //remove the last ampersant (&) of the mapurl
         url = url.substr(0, url.length - 1);

Modified: trunk/mapbender/http/javascripts/wms.js
===================================================================
--- trunk/mapbender/http/javascripts/wms.js	2016-09-05 14:24:31 UTC (rev 9575)
+++ trunk/mapbender/http/javascripts/wms.js	2016-09-07 12:41:30 UTC (rev 9576)
@@ -282,10 +282,10 @@
 	var currentWms = this;
 	//TODO 2016 arminadd optional dimension parameters
 	if (this.gui_wms_dimension_time !== false && this.gui_wms_dimension_time !== "") {
-		rq += "&TIME="+encodeURI(gui_wms_dimension_time);
+		rq += "TIME="+encodeURIComponent(gui_wms_dimension_time)+"&";
 	}
 	if (this.gui_wms_dimension_elevation !== false && this.gui_wms_dimension_elevation !== "") {
-		rq += "&ELEVATION="+encodeURI(gui_wms_dimension_elevation);
+		rq += "ELEVATION="+encodeURIComponent(gui_wms_dimension_elevation)+"&";
 	}
 	// add vendor-specific
 	for (var v = 0; v < mb_vendorSpecific.length; v++) {
@@ -841,7 +841,8 @@
 	currentLayer.layer_epsg[k].maxy = maxy;
 }
 //'name', 'units', 'unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent'
-function wms_addLayerDimension(name,units,unitSymbol,default1,multipleValues,nearestValue,current,extent){
+//'userValue' from wmc
+function wms_addLayerDimension(name,units,unitSymbol,default1,multipleValues,nearestValue,current,extent,userValue){
 	var j = wms[wms.length-1].objLayer.length-1;
 	var k = wms[wms.length-1].objLayer[j].layer_dimension.length;
 	var currentLayer = wms[wms.length-1].objLayer[j];
@@ -854,6 +855,7 @@
 	currentLayer.layer_dimension[k].nearestValue = nearestValue;
 	currentLayer.layer_dimension[k].current = current;
 	currentLayer.layer_dimension[k].extent = extent;
+	currentLayer.layer_dimension[k].userValue = userValue;
 }
 function wms_layer(
 	layer_parent,



More information about the Mapbender_commits mailing list