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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Sep 28 06:22:39 EDT 2010


Author: christoph
Date: 2010-09-28 10:22:39 +0000 (Tue, 28 Sep 2010)
New Revision: 6953

Modified:
   trunk/mapbender/http/classes/class_map.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/javascripts/initWmcObj.php
Log:
http://trac.osgeo.org/mapbender/ticket/706

Modified: trunk/mapbender/http/classes/class_map.php
===================================================================
--- trunk/mapbender/http/classes/class_map.php	2010-09-28 09:25:09 UTC (rev 6952)
+++ trunk/mapbender/http/classes/class_map.php	2010-09-28 10:22:39 UTC (rev 6953)
@@ -369,7 +369,7 @@
 					// set all layers of WMS to visible
 					for ($i = 0; $i < count($wmsArray); $i++) {
 						$numLayers = count($wmsArray[$i]->objLayer);
-	
+
 						// using option show is dependent to option visible = true
 						if ($options["show"] && is_numeric($options["show"])) {
 							// do not display if layer count is too big
@@ -377,7 +377,7 @@
 								continue;
 							}
 						}
-						
+
 						for ($j = 0; $j < $numLayers; $j++) {
 							$wmsArray[$i]->objLayer[$j]->gui_layer_visible = 1;
 						}
@@ -387,15 +387,32 @@
 					// set all layers of WMS to visible
 					for ($i = 0; $i < count($wmsArray); $i++) {
 						$numLayers = count($wmsArray[$i]->objLayer);
-	
+
 						for ($j = 0; $j < $numLayers; $j++) {
 							$wmsArray[$i]->objLayer[$j]->gui_layer_visible = 0;
 						}
 					}
 				}
 			}
+
+			// querylayer
+			if (isset($options["querylayer"])) {
+				$val = $options["querylayer"] ? 1 : 0;
+				
+				// set all queryable layers of WMS to querylayer
+				for ($i = 0; $i < count($wmsArray); $i++) {
+					$numLayers = count($wmsArray[$i]->objLayer);
+
+					for ($j = 0; $j < $numLayers; $j++) {
+						$currentLayer = $wmsArray[$i]->objLayer[$j];
+						if ($currentLayer->gui_layer_queryable) {
+							$currentLayer->gui_layer_querylayer = $val;
+						}
+					}
+				}
+			}
+
 			
-			
 			if ($options["show"] && is_numeric($options["show"]) && !isset($options["visible"])) {
 				$e = new mb_exception("show");
 				// set all layers of WMS to visible

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2010-09-28 09:25:09 UTC (rev 6952)
+++ trunk/mapbender/http/classes/class_wms.php	2010-09-28 10:22:39 UTC (rev 6953)
@@ -2593,7 +2593,6 @@
 			$this->objLayer[$layer_cnt]->layer_metadataurl =$row2["layer_metadataurl"];
 			$this->objLayer[$layer_cnt]->layer_searchable =$row2["layer_searchable"];
 			$this->objLayer[$layer_cnt]->layer_pos =$row2["layer_pos"];						
-			$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_pos"];
 			$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_queryable"];
 			$this->objLayer[$layer_cnt]->layer_minscale =$row2["layer_minscale"];
 			$this->objLayer[$layer_cnt]->layer_maxscale = $row2["layer_maxscale"];
@@ -2606,6 +2605,7 @@
 			}
 			$this->objLayer[$layer_cnt]->gui_layer_minscale = $this->objLayer[$layer_cnt]->layer_minscale;
 			$this->objLayer[$layer_cnt]->gui_layer_maxscale = $this->objLayer[$layer_cnt]->layer_maxscale;
+			$this->objLayer[$layer_cnt]->gui_layer_queryable = $this->objLayer[$layer_cnt]->layer_queryable;
 			
 			$sql = "Select * from layer_epsg where fkey_layer_id = $1 ORDER BY fkey_layer_id";
 			$v = array($this->objLayer[$layer_cnt]->layer_uid);

Modified: trunk/mapbender/http/javascripts/initWmcObj.php
===================================================================
--- trunk/mapbender/http/javascripts/initWmcObj.php	2010-09-28 09:25:09 UTC (rev 6952)
+++ trunk/mapbender/http/javascripts/initWmcObj.php	2010-09-28 10:22:39 UTC (rev 6953)
@@ -185,6 +185,9 @@
 		if ($input["zoom"]) {
 			$options["zoom"] = $input["zoom"];
 		}
+		if (isset($input["querylayer"])) {
+			$options["querylayer"] = $input["querylayer"];
+		}
 		$wmc->mergeWmsArray(array($wms), $options);
 	}
 }



More information about the Mapbender_commits mailing list