[Mapbender-commits] r9564 - in trunk/mapbender/http: classes javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 30 07:18:56 PDT 2016


Author: armin11
Date: 2016-08-30 07:18:56 -0700 (Tue, 30 Aug 2016)
New Revision: 9564

Modified:
   trunk/mapbender/http/classes/class_map.php
   trunk/mapbender/http/classes/class_wmc.php
   trunk/mapbender/http/classes/class_wmcToXml.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/javascripts/initWmcObj.php
   trunk/mapbender/http/javascripts/wms.js
Log:
Enhancement to handle wms dimension elements in wms object, wmc object, mapobj and database. Some further things have to be done.

Modified: trunk/mapbender/http/classes/class_map.php
===================================================================
--- trunk/mapbender/http/classes/class_map.php	2016-08-24 12:23:39 UTC (rev 9563)
+++ trunk/mapbender/http/classes/class_map.php	2016-08-30 14:18:56 UTC (rev 9564)
@@ -15,8 +15,8 @@
 	private $zoomFullExtentArray = array();
 	private $isOverview = false;
 	private $wmsArray = array();
-    private $kmls;
-    private $kmlOrder;
+        private $kmls;
+        private $kmlOrder;
 
 	/**
 	 * @destructor
@@ -489,6 +489,7 @@
 	 * @param $jsMapObject Object
 	 */
 	public function createFromJs ($jsMapObject) {
+		//$e = new mb_exception("class_map.php createfromjs invoked!");
 		$b = $jsMapObject->extent;
 
 		$srs = $jsMapObject->epsg;
@@ -520,7 +521,7 @@
 		for ($i=0; $i < count($jsMapObject->wms); $i++){
 
 			$currentWms = $jsMapObject->wms[$i];
-			$e = new mb_notice("class_map.php: json map object: ".json_encode($jsMapObject));
+			//$e = new mb_exception("class_map.php: json map object: ".json_encode($jsMapObject));
 			$wms = new wms();
 
 			//
@@ -622,10 +623,18 @@
 				}
 				//
 				$newLayer->layer_dimension = array();
+				$indexDimension = count($newLayer->layer_dimension);
+				
 				foreach($currentLayer->layer_dimension as $dimension) {
+					//$dimensionAttributes = array(); 
 					foreach(get_object_vars($dimension) as $key=>$value) {
-  						$newLayer->layer_dimension[] = array($key => $value);
+						//$dimensionAttributes[$key] = $value;
+  						//$newLayer->layer_dimension[] = array($key => $value);
+						//$e = new mb_exception("class_map.php: (from map object to layer object) dimension attribute: ".$key." - with value: ".$value);
+						$newLayer->layer_dimension[$indexDimension]->$key = $value;
 					}	
+					$indexDimension++;
+					//$newLayer->layer_dimension[] = 
 				}
 			}
 			array_push($this->wmsArray, $wms);
@@ -813,7 +822,7 @@
 				}
 
 				$currentMap->wmsArray = $wmsArray;
-
+				//$e = new mb_exception("class_map.php selectbyapplication invoked!");
 				// EXTENT
 				$sql = "SELECT gui_wms_epsg FROM gui_wms WHERE gui_wms_position = 0 AND fkey_gui_id = $1";
 				$v = array($appId);

Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php	2016-08-24 12:23:39 UTC (rev 9563)
+++ trunk/mapbender/http/classes/class_wmc.php	2016-08-30 14:18:56 UTC (rev 9564)
@@ -195,6 +195,8 @@
 	public function createFromApplication ($appId) {
 	// get the map objects "overview" and "mapframe1"
 		$this->mainMap = map::selectMainMapByApplication($appId);
+		
+		//$e = new mb_exception("classes/class_wmc.php: mainMap from application: ".implode(",",$this->mainMap->toJavaScript()));
 		$this->overviewMap = map::selectOverviewMapByApplication($appId);
 
 		// a  WFS is basically just a vectorlayer, and a WFSconf is just a configured WFS,
@@ -1299,9 +1301,10 @@
 		$wmcJsArray = array();
 		$e = new mb_notice("class_wmc.php: iterate over wms array");
 		$e = new mb_notice("class_wmc.php: count of wms array: ".count($wmsArray));
+
 		for ($i = 0; $i < count($wmsArray); $i++) {
 			$currentWms = $wmsArray[$i];
-			$e = new mb_notice("class_wmc.php: createJsObjFromWMS number: ".$i);
+			//$e = new mb_exception("class_wmc.php: createJsObjFromWMS number: ".$i);
 			$wmcJsArray[] = $currentWms->createJsObjFromWMS_();
 			//$this->incrementLoadCount($currentWms);
 		}
@@ -1773,6 +1776,7 @@
 					}
 					$currentLayer["format"] = array();
 					$currentLayer["style"] = array();
+					$currentLayer["dimension"] = array();
 					//$currentLayer["layer_metadataurl"] = array();
 					//$currentLayer["layer_dataurl"] = array();
 					$layer = true;
@@ -1793,11 +1797,19 @@
 						array_push($layerlistArray["main"], $modifiedLayer);
 						$layer = false;
 					}
+					//check debug
 					if ($layer_dimensionlist) {
 						if ($tag == "DIMENSION") {
+							//main problem: currentLayer is not an object but an array :-(
+							$dimensionIndex = count($currentLayer['dimension']);
+							if ($dimensionIndex <= 0) {
+								$dimensionIndex = 0;
+								$dimensionAttributes = array();
+							}
 							foreach (array_keys($attributes) as $attribute) {
-							 	array_push($currentLayer["dimension"], array($attribute => $attributes[$attribute]));	
+								$dimensionAttributes[$attribute] = $attributes[$attribute];
 							}
+							array_push($currentLayer['dimension'], $dimensionAttributes);
 						}
 						if ($tag == "DIMENSIONLIST" && $type == "close") {
 							$layer_dimensionlist = false;
@@ -1943,6 +1955,7 @@
 							$layer_dataurl = true;
 						}
 						if ($tag == "DIMENSIONLIST" && $type == "open") {
+							//$e = new mb_exception("class-wmc.php: found dimensionlist tag!");
 							$layer_dimensionlist = true;
 						}
 						if ($tag == "FORMATLIST" && $type == "open") {

Modified: trunk/mapbender/http/classes/class_wmcToXml.php
===================================================================
--- trunk/mapbender/http/classes/class_wmcToXml.php	2016-08-24 12:23:39 UTC (rev 9563)
+++ trunk/mapbender/http/classes/class_wmcToXml.php	2016-08-30 14:18:56 UTC (rev 9564)
@@ -304,6 +304,7 @@
 		$currentLayerTitle = $currentLayer->gui_layer_title;
 		$e_layer_title = $this->doc->createElement("Title", $currentLayerTitle);
 		$e_layer->appendChild($e_layer_title);
+		//$e = new mb_exception("class_wmcToXml.php: currentLayer gui layer title: ".$currentLayer->gui_layer_title);
 
 		// Abstract
 		if ($currentWms->wms_abstract){
@@ -341,8 +342,10 @@
 		}
 
 		// Layer dimension
-		$dimensionListNode = $this->createLayerDimensionListNode($currentWms);
-		if ($dimensionNode !== null) {
+		//$e = new mb_exception("class_wmcToXml.php: layer dimension count: ".count($currentLayer->layer_dimension));
+		$dimensionListNode = $this->createLayerDimensionListNode($currentWms, $currentLayer);
+		//$e = new mb_exception("class_wmcToXml.php: type of dimensionListNode: ".gettype($dimensionListNode));
+		if ($dimensionListNode !== null) {
 			$e_layer->appendChild($dimensionListNode);
 		}
 
@@ -385,19 +388,27 @@
 	}
 
 	private function createLayerDimensionListNode ($currentWms, $currentLayer) {
+		//Debug
+		//$e = new mb_exception("class_wmcToXml.php: try to get dimension for layer from currentLayer");
+		//
 		if (count($currentLayer->layer_dimension) >= 1) {
+			//
+			//$e = new mb_exception("class_wmcToXml.php: somedimension found");
 			$e_layer_dimensionlist = $this->doc->createElement("DimensionList");
 			for ($k = 0; $k < count($currentLayer->layer_dimension); $k++){
 				$e_layer_dimension = $this->doc->createElement("Dimension");
 				foreach($currentLayer->layer_dimension as $dimension) {
 					foreach(get_object_vars($dimension) as $key=>$value) {
-  						$e_format->setAttribute($key, $value);
+						//$e = new mb_exception("class_wmcToXml.php: set attribute: ".$key."- to - ".$value);  		
+						$e_layer_dimension->setAttribute($key, $value);
 					}	
 				}
 				$e_layer_dimensionlist->appendChild($e_layer_dimension);
 			}
+			return $e_layer_dimensionlist;
+		} else {
+			return null;
 		}
-		return $e_layer_dimensionlist;
 	}
 
 	private function createLayerFormatListNode ($currentWms) {

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2016-08-24 12:23:39 UTC (rev 9563)
+++ trunk/mapbender/http/classes/class_wms.php	2016-08-30 14:18:56 UTC (rev 9564)
@@ -1550,6 +1550,14 @@
 			$newLayer->layer_style[$i]["legendurl"] = $currentLayer["style"][$i]["legendurl"];
 			$newLayer->layer_style[$i]["legendurl_format"] = $currentLayer["style"][$i]["legendurl_type"];
 		}
+		//2016 add dimension
+		for ($i = 0; $i < count($currentLayer['dimension']); $i++) {
+			//$newLayer->layer_dimension[$i] = array();
+			//TODO - after holiday 2016
+			$newLayer->layer_dimension[$i]->name = $currentLayer['dimension'][$i]["name"];
+			$newLayer->layer_dimension[$i]->extent = $currentLayer['dimension'][$i]["extent"];
+			$newLayer->layer_dimension[$i]->unit = $currentLayer['dimension'][$i]["unit"];
+		}
 	}
 	
 	  function createJsObjFromWMS_($parent=0){
@@ -1558,66 +1566,67 @@
 			$str .= "alert('Error: no valid capabilities-document !!');";
 			die; exit;
 		}
-			if($parent){
-				$str .=  "parent.";
-			}
-			// wms_title and abstract have previously been urlencoded
-			// this solution may not yet be the ultimate one
+		if($parent){
+			$str .=  "parent.";
+		}
+		// wms_title and abstract have previously been urlencoded
+		// this solution may not yet be the ultimate one
 			
-			$add_wms_string = "add_wms(" .
-					"'" . $this->wms_id ."'," .
-					"'" . $this->wms_version ."'," .
-					"'" . addslashes($this->wms_title) . "'," .
-					"'" . addslashes($this->wms_abstract) ."'," .
-					"'" . $this->wms_getmap ."'," .
-					"'" . $this->wms_getfeatureinfo ."'," .
-					"'" . $this->wms_getlegendurl ."'," .
-					"'" . $this->wms_filter ."'," .
-					"'" . $this->gui_wms_mapformat . "'," .
-					"'" . $this->gui_wms_featureinfoformat . "'," .
-					"'" . $this->gui_wms_exceptionformat . "'," .
-					"'" . $this->gui_wms_epsg ."'," .
-					"'" . $this->gui_wms_visible ."'," .
-					"'" . $this->gui_wms_opacity ."'," .
-					"'" . $this->gui_wms_sldurl ."" .
-					"');";
-			$str .=  $add_wms_string;
-			
+		$add_wms_string = "add_wms(" .
+				"'" . $this->wms_id ."'," .
+				"'" . $this->wms_version ."'," .
+				"'" . addslashes($this->wms_title) . "'," .
+				"'" . addslashes($this->wms_abstract) ."'," .
+				"'" . $this->wms_getmap ."'," .
+				"'" . $this->wms_getfeatureinfo ."'," .
+				"'" . $this->wms_getlegendurl ."'," .
+				"'" . $this->wms_filter ."'," .
+				"'" . $this->gui_wms_mapformat . "'," .
+				"'" . $this->gui_wms_featureinfoformat . "'," .
+				"'" . $this->gui_wms_exceptionformat . "'," .
+				"'" . $this->gui_wms_epsg ."'," .
+				"'" . $this->gui_wms_visible ."'," .
+				"'" . $this->gui_wms_opacity ."'," .
+				"'" . $this->gui_wms_sldurl ."" .
+				"');";
+		$str .=  $add_wms_string;
+		//add possible data formats
 		for($i=0;$i<count($this->data_format);$i++){
 			if($parent){
 				$str .=  "parent.";
 			}		
 			$str .= "wms_add_data_type_format('". $this->data_type[$i] ."','". $this->data_format[$i] ."');";		
 		}
+		//do the things for each layer
 		for($i=0; $i<count($this->objLayer); $i++){
 			if($parent){
 				$str .= "parent.";
 			}
 			$str .=  "wms_add_layer('". 
-				$this->objLayer[$i]->layer_parent ."','". 
-				$this->objLayer[$i]->layer_uid ."','". 
-				addslashes($this->objLayer[$i]->layer_name) . "','". 
-				addslashes($this->objLayer[$i]->layer_title) ."','". 
-				$this->objLayer[$i]->layer_dataurl[0]->href ."','". 
-				$this->objLayer[$i]->layer_pos ."','". 
-				$this->objLayer[$i]->layer_queryable ."','". 
-				$this->objLayer[$i]->layer_minscale . "','". 
-				$this->objLayer[$i]->layer_maxscale ."','". 
-				$this->objLayer[$i]->layer_metadataurl[0]->href ."','". 
-				// will be added later, not needed now TODO check if more than one metadataUrl is usefull here
-				// $this->objLayer[$i]->layer_searchable ."','". 
-				$this->objLayer[$i]->gui_layer_wms_id ."','". 
-				$this->objLayer[$i]->gui_layer_status ."','".
-				$this->objLayer[$i]->gui_layer_style ."','".  
-				$this->objLayer[$i]->gui_layer_selectable ."','". 
-				$this->objLayer[$i]->gui_layer_visible ."','". 
-				$this->objLayer[$i]->gui_layer_queryable ."','". 
-				$this->objLayer[$i]->gui_layer_querylayer ."','". 
-				$this->objLayer[$i]->gui_layer_minscale ."','". 
-				$this->objLayer[$i]->gui_layer_maxscale ."','".
-				$this->objLayer[$i]->gui_layer_wfs_featuretype ."','".
-				$this->objLayer[$i]->gui_layer_title ."','".
-				$this->objLayer[$i]->layer_dataurl[0]->href ."');";
+			$this->objLayer[$i]->layer_parent ."','". 
+			$this->objLayer[$i]->layer_uid ."','". 
+			addslashes($this->objLayer[$i]->layer_name) . "','". 
+			addslashes($this->objLayer[$i]->layer_title) ."','". 
+			$this->objLayer[$i]->layer_dataurl[0]->href ."','". 
+			$this->objLayer[$i]->layer_pos ."','". 
+			$this->objLayer[$i]->layer_queryable ."','". 
+			$this->objLayer[$i]->layer_minscale . "','". 
+			$this->objLayer[$i]->layer_maxscale ."','". 
+			$this->objLayer[$i]->layer_metadataurl[0]->href ."','". 
+			// will be added later, not needed now TODO check if more than one metadataUrl is usefull here
+			// $this->objLayer[$i]->layer_searchable ."','". 
+			$this->objLayer[$i]->gui_layer_wms_id ."','". 
+			$this->objLayer[$i]->gui_layer_status ."','".
+			$this->objLayer[$i]->gui_layer_style ."','".  
+			$this->objLayer[$i]->gui_layer_selectable ."','". 
+			$this->objLayer[$i]->gui_layer_visible ."','". 
+			$this->objLayer[$i]->gui_layer_queryable ."','". 
+			$this->objLayer[$i]->gui_layer_querylayer ."','". 
+			$this->objLayer[$i]->gui_layer_minscale ."','". 
+			$this->objLayer[$i]->gui_layer_maxscale ."','".
+			$this->objLayer[$i]->gui_layer_wfs_featuretype ."','".
+			$this->objLayer[$i]->gui_layer_title ."','".
+			$this->objLayer[$i]->layer_dataurl[0]->href ."');";
 				
 			for($j=0; $j<count($this->objLayer[$i]->layer_epsg);$j++){
 				$currentEpsg = $this->objLayer[$i]->layer_epsg[$j];
@@ -1637,7 +1646,7 @@
 						$str .=  "parent.";
 					}
 					$str .= "layer_addEpsg('". 
-						$currentEpsg["epsg"] ."',". 
+					$currentEpsg["epsg"] ."',". 
 						(is_null($currentEpsg["minx"]) ? "null" : $currentEpsg["minx"]) .",". 
 						(is_null($currentEpsg["miny"]) ? "null" : $currentEpsg["miny"]) .",". 
 						(is_null($currentEpsg["maxx"]) ? "null" : $currentEpsg["maxx"]) .",". 
@@ -1664,7 +1673,7 @@
 			}
 			for($j=0; $j<count($this->objLayer[$i]->layer_style);$j++){
 				if($parent){
-				$str .= "parent.";
+					$str .= "parent.";
 				}
 				$str .= "wms_addLayerStyle('".$this->objLayer[$i]->layer_style[$j]["name"].
 					"', '".$this->objLayer[$i]->layer_style[$j]["title"].
@@ -1673,6 +1682,17 @@
 					",'".$this->objLayer[$i]->layer_style[$j]["legendurl"].
 					"', '".$this->objLayer[$i]->layer_style[$j]["legendurlformat"]."');";
 			}
+			//2016 - new for dimension (time and elevation)
+			//$e = new mb_exception("class_wms.php: test for dimension in layer object: count of dimension: ".count($this->objLayer[$i]->layer_dimension));
+			for($j=0; $j<count($this->objLayer[$i]->layer_dimension);$j++){
+				if($parent){
+					$str .= "parent.";
+				}
+				//'name', 'units', 'unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent'
+				$dimensionString = "wms_addLayerDimension('".$this->objLayer[$i]->layer_dimension[$j]->name."', '".$this->objLayer[$i]->layer_dimension[$j]->units."', '".$this->objLayer[$i]->layer_dimension[$j]->unitSymbol."',  '".$this->objLayer[$i]->layer_dimension[$j]->default."',  '".$this->objLayer[$i]->layer_dimension[$j]->multipleValues."',  '".$this->objLayer[$i]->layer_dimension[$j]->nearestValue."',  '".$this->objLayer[$i]->layer_dimension[$j]->current."', '".$this->objLayer[$i]->layer_dimension[$j]->extent."');";
+				//$e = new mb_exception("class_wms.php: dimensionstring= ".$dimensionString);
+				$str .= $dimensionString;
+			}
 		}
 		return $str;
 	  }
@@ -3374,7 +3394,7 @@
 		$v = array($wms_id,$gui_id);
 		$t = array('i','s');
 		$res = db_prep_query($sql,$v,$t);
-		
+		//$e = new mb_exception("class_wms.php - invoke createObjFromDB - for gui ".$gui_id);
 		$count=0;
 		#$res_count=db_num_rows($res);
 	    
@@ -3585,17 +3605,29 @@
 				$count_layer_style++;
 			}
 			//handle layer dimensions (first only time and elevation!)
+			//$e = new mb_exception("classes/class_wms.php - select dimension from database (createObjFromDB)for layer: ".$layer_id);
 			$sql = "SELECT * FROM layer_dimension WHERE fkey_layer_id = $1 AND ( name = 'time' OR name = 'elevation')";
+
 			$v = array($layer_id);
 			$t = array('i');
 			$res_dimension = db_prep_query($sql,$v,$t);
 			$count_layer_dimension = 0;
+			//test
+			$attributeNames = array('name', 'units', 'unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent');
 			while($row_dim = db_fetch_array($res_dimension)) {
-				$attributeNames = array('name', 'units', 'unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent');
+				//$attributeNames = array('name', 'units', 'unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent');
 				foreach($attributeNames as $attribute) {
 					//$e = new mb_exception("class_wms - pull dimension attribute: ".strtolower($attribute)." for layer: ".$layer_id);
-					$this->objLayer[$layer_cnt]->layer_dimension[$count_layer_dimension]->{$attribute} = $row_dim[strtolower($attribute)];
+					//if () {
+						$this->objLayer[$layer_cnt]->layer_dimension[$count_layer_dimension]->{$attribute} = $row_dim[strtolower($attribute)];
+						//$e = new mb_exception("test 1");
+						//$e = new mb_exception("classes/class_wms.php - set dimension attribute ".$attribute." with ".$row_dim[strtolower($attribute)]." for dimension id ".$count_layer_dimension);
+						//$e = new mb_exception("test 2");
+						//$e = new mb_exception("classes/class_wms.php - attribute value for layer: ".$this->objLayer[$layer_cnt]->layer_dimension[$count_layer_dimension]->{$attribute});
+						//$e = new mb_exception("test 3");
+					//}
 				}
+				//$e = new mb_exception("class_wms - pull dimension attribute - :".$row_dim['name'] - ;
 				$count_layer_dimension++;
 			}
 			$count++;
@@ -3792,7 +3824,8 @@
 			$v = array($this->objLayer[$layer_cnt]->layer_uid);
 			$t = array('i');
 			$res_dimension = db_prep_query($sql,$v,$t);
-			$count_layer_dimension = 0;
+			$count_layer_dimension = 0;			
+			$e = new mb_exception("classes/class_wms.php - select dimension from database (createObjFromDBNoGui)!");
 			while($row_dim = db_fetch_array($res_dimension)) {
 				$attributeNames = array('name', 'units', 'unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent');
 				foreach($attributeNames as $attribute) {

Modified: trunk/mapbender/http/javascripts/initWmcObj.php
===================================================================
--- trunk/mapbender/http/javascripts/initWmcObj.php	2016-08-24 12:23:39 UTC (rev 9563)
+++ trunk/mapbender/http/javascripts/initWmcObj.php	2016-08-30 14:18:56 UTC (rev 9564)
@@ -123,14 +123,14 @@
     //$wmcDocSession = getWmcFromStorage($wmc_filename);
     $time_end = microtime();
     $timediff = $time_end - $time_start;
-    $e = new mb_notice('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_notice("trying to load session WMC...");
+		$e = new mb_exception("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);
@@ -153,6 +153,11 @@
 //
 // create new WMC with services from GET API
 //
+//look in wmc xml *******************************************************************
+//$e = new mb_exception("initWmcObj.php - debug - initial wmc xml: ".$wmc->toXml());
+//die();
+//***********************************************************************************
+//
 $wmcGetApi = WmcFactory::createFromXml($wmc->toXml());
 $options = array();
 if (Mapbender::session()->exists("addwms_showWMS")) {
@@ -396,6 +401,8 @@
 //workaround to have a fully merged WMC for loading
 $xml = $wmcGetApi->toXml();
 $wmcGetApi = new wmc();
+//debug
+//$e = new mb_notice("initWmcObj.php: wmc after merging: ".$xml);
 //new Object with merged layers and other features
 $wmcGetApi->createFromXml($xml);
 		
@@ -591,6 +598,7 @@
 	//$e = new mb_notice("initWmcObj.php: alternate js build successfully!");
 //*******************************************************
 	$output = $wmcGetApi->wmsToJavaScript();
+	//$e = new mb_exception("javascripts/initWmcObj.php: javascript mapset: ".implode(",",$output));
 	$wmcJs = $wmcGetApi->toJavaScript(array());//old way - why give an empty array?
 	$wmcJs = implode(";\n",$wmcJs);
 	$extentJs = $wmcGetApi->extentToJavaScript();

Modified: trunk/mapbender/http/javascripts/wms.js
===================================================================
--- trunk/mapbender/http/javascripts/wms.js	2016-08-24 12:23:39 UTC (rev 9563)
+++ trunk/mapbender/http/javascripts/wms.js	2016-08-30 14:18:56 UTC (rev 9564)
@@ -822,7 +822,7 @@
 	currentLayer.layer_epsg[k].maxy = maxy;
 }
 //'name', 'units', 'unitSymbol', 'default', 'multipleValues', 'nearestValue', 'current', 'extent'
-/*function layer_addDimension(name,units,unitSymbol,default1,multipleValues,nearestValue,current,extent){
+function wms_addLayerDimension(name,units,unitSymbol,default1,multipleValues,nearestValue,current,extent){
 	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];
@@ -835,7 +835,7 @@
 	currentLayer.layer_dimension[k].nearestValue = nearestValue;
 	currentLayer.layer_dimension[k].current = current;
 	currentLayer.layer_dimension[k].extent = extent;
-}*/
+}
 function wms_layer(
 	layer_parent,
 	wms_layer_uid,
@@ -886,6 +886,7 @@
 	this.gui_layer_dataurl_href = gui_layer_dataurl_href;
 	this.has_childs = false;
 	this.layer_style = [];
+	this.layer_dimension = [];
 	wms_layer_count++;
 }
 /**



More information about the Mapbender_commits mailing list