[Mapbender-commits] r5733 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Mar 5 09:52:49 EST 2010


Author: marcjansen
Date: 2010-03-05 09:52:47 -0500 (Fri, 05 Mar 2010)
New Revision: 5733

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
Intermediate state of OpenLayers-template, see: http://osgeo.pastebin.com/mWXMXLcv

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2010-03-05 14:51:55 UTC (rev 5732)
+++ trunk/mapbender/http/classes/class_wms.php	2010-03-05 14:52:47 UTC (rev 5733)
@@ -215,20 +215,48 @@
 		// wms_title and abstract have previously been urlencoded
 		// this solution may not yet be the ultimate one
 		
-		$add_wms_string = "var wms_".$this->wms_id." = new OpenLayers.Layer.WMS.Untiled(" .
-				"'" . addslashes($this->wms_title) . "'," .
-				"'" . $this->wms_getmap ."'," ."{layers:'";
-				for($i=1;$i<count($this->objLayer);$i++){
-					$add_wms_string .= addslashes($this->objLayer[$i]->layer_name);
-					if($i!=count($this->objLayer)-1)
-						$add_wms_string .= ",";
-				}
-				$add_wms_string .= "', transparent: 'true'";
-				$add_wms_string .= ",format: '".$this->gui_wms_mapformat."'});";
-				if($base)
-					$add_wms_string .= 	"wms_".$this->wms_id.".isBaseLayer=true;";
-				$add_wms_string .= 	"wms_".$this->wms_id.".setVisibility(".($this->gui_wms_visible=="1"?"true":"false").");";
-				$add_wms_string .= "ol_map.addLayer(wms_".$this->wms_id.");";
+		$add_wms_string  = "var wms_".$this->wms_id." = new OpenLayers.Layer.WMS(";
+		// WMS-title
+		$add_wms_string .= "'" . addslashes($this->wms_title) . "',";
+		// Base-URL of service
+		$add_wms_string .= "'" . $this->wms_getmap ."',";
+		// Additional URL params
+		$add_wms_string .= "{layers:'";
+		for($i=1;$i<count($this->objLayer);$i++){
+			$add_wms_string .= addslashes($this->objLayer[$i]->layer_name);
+			if($i!=count($this->objLayer)-1) {
+				$add_wms_string .= ",";
+			}
+		}
+		$add_wms_string .= "',";
+		// This is hardcoded, exactly as for Mapbender WMS
+		$add_wms_string .= "transparent: 'true',";
+		$add_wms_string .= "format: '".$this->gui_wms_mapformat."'},";
+		// OpenLayers-Layer options
+		$add_wms_string .= "{";
+		$add_wms_string .= 	"transitionEffect:'resize',";
+		$add_wms_string .= 	"buffer:1.3,";
+		$add_wms_string .= 	"singleTile:true,";
+		// baselayer?				
+		if($base) {
+			$add_wms_string .= 	"isBaseLayer:true,";
+		} else {
+			$add_wms_string .= 	"isBaseLayer:false,";
+		}
+		// visible or not?
+		if($this->gui_wms_visible=="1") {
+			$add_wms_string .= 	"visibility:true,";
+		} else {
+			$add_wms_string .= 	"visibility:false,";
+		}
+		// initial transparency
+		$add_wms_string .= 	"opacity:" . strval(round($this->gui_wms_opacity/100, 2));
+		
+		$add_wms_string .= "}";
+		$add_wms_string .= ");";
+		
+		// TODO why ol_map
+		$add_wms_string .= "ol_map.addLayer(wms_".$this->wms_id.");";
 		echo $add_wms_string;
 	}	
 	



More information about the Mapbender_commits mailing list