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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 10 11:55:35 EDT 2009


Author: christoph
Date: 2009-09-10 11:55:34 -0400 (Thu, 10 Sep 2009)
New Revision: 4613

Modified:
   trunk/mapbender/http/classes/class_map.php
   trunk/mapbender/http/classes/class_wmc.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/javascripts/map.js
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/mod_loadwmc.js
Log:
wmc bug: conflict w/ new API

Modified: trunk/mapbender/http/classes/class_map.php
===================================================================
--- trunk/mapbender/http/classes/class_map.php	2009-09-10 15:54:27 UTC (rev 4612)
+++ trunk/mapbender/http/classes/class_map.php	2009-09-10 15:55:34 UTC (rev 4613)
@@ -514,40 +514,37 @@
 		}
 
 		// syntax has changed in 2.6! Map is no longer a frame
-		$registerMapString = "mb_registerMapObj('', " . 
-			"'" . $this->frameName . "', " . 
-			$wmsIndex . ", " . 
-			$this->width . ", " . 
-			$this->height . ");"; 
+		$registerMapString = "var currentWmcMap = Mapbender.modules['" . 
+			$this->frameName . "'];" .
+			"currentWmcMap.elementName = '" . $this->frameName . "';" . 
+			"currentWmcMap.setWidth(" . $this->width . ");" . 
+			"currentWmcMap.setHeight(" . $this->height . ");"; 
 		array_push($jsCodeArray, $registerMapString);
 
-//		$e = new mb_notice("Map to JS: ov? " . $this->isOverview);
-
 		// if map is overview...
 		if ($this->isOverview) {
 			// ...set overview flag
-			$setOverviewFlagString = "mb_mapObj[mb_mapObj.length-1].isOverview = true;";
+			$setOverviewFlagString = "currentWmcMap.isOverview = true;";
 			array_push($jsCodeArray, $setOverviewFlagString);
 		}
-		
-		// set width
-		$setMapframeWidth = "document.getElementById('" . $this->frameName . "')." . 
-			"style.width = " . $this->width . ";";
-		array_push($jsCodeArray, $setMapframeWidth);
 
-		// set height
-		$setMapframeHeight = "document.getElementById('" . $this->frameName . "')." . 
-			"style.height = " . $this->height . ";";
-		array_push($jsCodeArray, $setMapframeHeight);
-
 		// calculate extent
-		$calcExtentString = "mb_calculateExtent('" . 
-			$this->frameName . "', " .
+		$calcExtentString = "currentWmcMap.setSrs({" . 
+			"srs: '" . $this->extent->epsg . "'," . 
+			"extent: new Mapbender.Extent(" . 
 			$this->extent->min->x . ", " . 
 			$this->extent->min->y . ", " . 
 			$this->extent->max->x . ", " . 
-			$this->extent->max->y . ");"; 
+			$this->extent->max->y . ")});"; 
 		array_push($jsCodeArray, $calcExtentString);
+		
+		$setWmsString = "currentWmcMap.setWms(" . $wmsIndex . ");";
+		array_push($jsCodeArray, $setWmsString);
+		
+		$initWmsString = "currentWmcMap.initializeWms();";
+		array_push($jsCodeArray, $initWmsString);
+
+
 		return $jsCodeArray;
 	}
 

Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php	2009-09-10 15:54:27 UTC (rev 4612)
+++ trunk/mapbender/http/classes/class_wmc.php	2009-09-10 15:55:34 UTC (rev 4613)
@@ -374,7 +374,7 @@
 		}
 
 		// delete existing map objects...
-		array_push($wmcJsArray, "mb_mapObj = [];");
+//		array_push($wmcJsArray, "mb_mapObj = [];");
 
 		// .. and add the overview map (if exists) and set map request
 		if ($this->overviewMap !== null) {
@@ -387,20 +387,23 @@
 		// set visibility of ov map WMS (may be different from main)
 		if ($this->overviewMap !== null) {
 			for ($i = 0; $i < count($ovWmsArray[$wmsIndexOverview]->objLayer); $i++) {
-				$visStr = "mb_mapObj[0].wms[" .$wmsIndexOverview . "].handleLayer(" . 
+				$visStr = "Mapbender.modules['".$this->overviewMap->getFrameName().
+					"'].wms[" .$wmsIndexOverview . "].handleLayer(" . 
 					"'" . $ovWmsArray[$wmsIndexOverview]->objLayer[$i]->layer_name . "', " . 
 					"'visible', " . 
 					($ovWmsArray[$wmsIndexOverview]->objLayer[$i]->gui_layer_visible ? 1 : 0) . ");";
 				array_push($wmcJsArray, $visStr);
 			}
-			array_push($wmcJsArray, "mb_mapObj[0].restateLayers(" . $ovWmsArray[$wmsIndexOverview]->wms_id . ");");
+			array_push($wmcJsArray, "Mapbender.modules['".$this->overviewMap->getFrameName().
+					"'].restateLayers(" . $ovWmsArray[$wmsIndexOverview]->wms_id . ");");
 		}
-		
 
 		// .. request the map
-		array_push($wmcJsArray, "setMapRequest('" . $this->mainMap->getFrameName() . "');");
+		array_push($wmcJsArray, "Mapbender.modules['".$this->mainMap->getFrameName().
+					"'].setMapRequest();");
 		if ($this->overviewMap !== null) {
-			array_push($wmcJsArray, "setMapRequest('" . $this->overviewMap->getFrameName() . "');");
+			array_push($wmcJsArray, "Mapbender.modules['".$this->overviewMap->getFrameName().
+					"'].setMapRequest();");
 		}
 
 		array_push($wmcJsArray, "eventAfterLoadWMS.trigger();");
@@ -877,6 +880,11 @@
 				"maxy" => $currentBox->max->y
 			));
 		}
+		
+		$wmsArr = $this->mainMap->getWmsArray();
+		for ($i = 0; $i < count($wmsArr); $i++) {
+			$wmsArr[$i]->updateAllOwsProxyUrls();
+		}
 		return true;
 	}
 
@@ -1054,6 +1062,7 @@
 					array_push($wms->objLayer[0]->layer_epsg, $currentLayerEpsg);
 				}
 			}			
+
 			// add WMS
 			array_push($wmsArray, $wms);
 

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2009-09-10 15:54:27 UTC (rev 4612)
+++ trunk/mapbender/http/classes/class_wms.php	2009-09-10 15:55:34 UTC (rev 4613)
@@ -73,6 +73,113 @@
 	function wms() {
 	} 
 
+	public static function isOwsProxyUrl ($getmap) {
+//		$e = new mb_notice("isOwsProxyUrl? " . $getmap);
+		$result = preg_match("/^.*owsproxy.([^i][\w\d]+)\/([\w\d]{32})\/?.*$/", $getmap);
+//		$e = new mb_notice("result: " . $result);
+		return $result;
+	}
+
+	private function replaceSessionIdInOwsProxyUrl ($getMap) {
+//		$e = new mb_notice("replaceSessionIdInOwsProxyUrl: ");
+		$e = new mb_notice("before: " . $getMap);
+		$pattern = '/(^.*owsproxy.)([^i][\w\d]+)(\/)([\w\d]{32})(\/?.*)$/';
+		$getMap1= preg_replace($pattern, "$1",$getMap);
+		$getMap2=  preg_replace($pattern, "$3$4$5",$getMap);
+		$getMap = $getMap1.session_id().$getMap2;
+		$e = new mb_notice("after: " . $getMap);
+		return $getMap;
+	}
+	
+	public static function getHashFromOwsProxyUrl ($getMap) {
+//		$e = new mb_notice("replaceSessionIdInOwsProxyUrl: " . $getMap);
+		$result = preg_replace("/^.*owsproxy.([^i][\w\d]+)\/([\w\d]{32})\/?.*$/", "$2", $getMap);
+//		$e = new mb_notice("result: " . $result);
+		return $result;
+	}
+	
+	private function getWmsIdByOwsProxyHash($md5) {
+		$sql = "SELECT wms_id FROM wms WHERE wms_owsproxy = $1";
+		$v = array($md5);
+		$t = array("s");
+		$res = db_prep_query($sql, $v, $t);
+		$row = db_fetch_row($res);
+		if ($row["wms_id"]) {
+			return $row["wms_id"];
+		}
+		return null;
+	}
+	
+	private function updateOwsProxyUrl ($url) {
+		// is OWS proxy URL?
+		if (wms::isOwsProxyUrl($url)) {
+
+			// No WMS id could be found
+			if (!$this->wms_id) {
+				$e = new mb_notice("No WMS id could be found!");
+				return $url;
+			}			
+			// Update session id in OWS proxy URL
+			$new_proxy_url = $this->replaceSessionIdInOwsProxyUrl($url);
+
+			// If new url is a valid proxy URL, return true
+			if ($this->isOwsProxyUrl($new_proxy_url)) {
+				return $new_proxy_url;
+			}
+			else {
+//				$e = new mb_notice("new URL is not an OWS proxy URL!");
+			}
+			// new URL is not an OWS proxy URL; 
+			// some error must have occured.
+			// no update
+			return $url;
+		}
+		// no OWS proxy URL, no update necessary
+//		$e = new mb_notice("URL is not an OWS proxy URL!");
+		return $url;
+	}
+	
+	function updateAllOwsProxyUrls () {
+		$wmsId = $this->wms_id;
+
+		// if WMS id is unknown, try to 
+		// find it via OWS proxy entry
+		//FIXME -Funktion berichtigen 
+		if (!$wmsId) {
+			$md5 = wms::getHashFromOwsProxyUrl($url);
+			if ($md5) {
+				$wmsId = $this->getWmsIdByOwsProxyHash($md5);
+				if (!is_null($wmsId)) {
+					$this->wms_id = $wmsId;
+				}
+			}
+		}
+
+		$e = new mb_exception("####old getmap: " . $this->wms_getmap);
+		$this->wms_getmap = 
+			$this->updateOwsProxyUrl($this->wms_getmap);
+		$e = new mb_exception("new getmap: " . $this->wms_getmap);
+		$e = new mb_exception("####old featureinfo: " . $this->wms_getfeatureinfo);
+		$this->wms_getfeatureinfo = 
+			$this->updateOwsProxyUrl($this->wms_getfeatureinfo);
+		$e = new mb_exception("new featureinfo: " . $this->wms_getfeatureinfo);
+		$e = new mb_exception("####old legendurl: " . $this->wms_getlegendurl);
+		$this->wms_getlegendurl = 
+			$this->updateOwsProxyUrl($this->wms_getlegendurl);
+		$e = new mb_exception("new legendurl: " . $this->wms_getlegendurl);
+		
+		for ($i = 0; $i < count($this->objLayer); $i++) {
+			$e = new mb_exception("layer #" . $i);
+			for ($j = 0; $j < count($this->objLayer[$i]->layer_style); $j++) {
+				$e = new mb_exception("layer style #" . $j);
+				$this->objLayer[$i]->layer_style[$j]["legendurl"] = 
+					$this->updateOwsProxyUrl($this->objLayer[$i]->layer_style[$j]["legendurl"]);
+					
+				$e = new mb_exception("legendurl: " . $this->objLayer[$i]->layer_style[$j]["legendurl"]);
+			}
+		}
+	}
+	
 	public static function getConjunctionCharacter ($url) {
 		if (mb_strpos($url, "?") !== false) { 
 			if (mb_substr($url, mb_strlen($url)-1, 1) == "?") { 

Modified: trunk/mapbender/http/javascripts/map.js
===================================================================
--- trunk/mapbender/http/javascripts/map.js	2009-09-10 15:54:27 UTC (rev 4612)
+++ trunk/mapbender/http/javascripts/map.js	2009-09-10 15:55:34 UTC (rev 4613)
@@ -47,8 +47,9 @@
  * @deprecated
  */
 function mb_registerMapObj(frameName, elementName,wms_index,width, height){
-	var newMapObj = new Map(frameName, elementName, width, height, wms_index);
+	var newMapObj = new Mapbender.Map(frameName, elementName, width, height, wms_index);
 	mb_mapObj.push(newMapObj);    
+	Mapbender.modules[elementName] = newMapObj;
 	return newMapObj;
 }
 

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2009-09-10 15:54:27 UTC (rev 4612)
+++ trunk/mapbender/http/javascripts/map_obj.js	2009-09-10 15:55:34 UTC (rev 4613)
@@ -28,6 +28,8 @@
  */
 Mapbender.Map = function (frameName, elementName, width, height, wms_index) {
 
+
+
 	/**
 	 * Method: setExtent
 	 * 
@@ -97,7 +99,7 @@
 			return window.frames[this.frameName].document.getElementById(this.elementName);
 		}
 		return document.getElementById(this.elementName);
-	}
+	};
 	
 	/**
 	 * set the height of the mapObj
@@ -118,14 +120,8 @@
 		var clickX, clickY;
 
 		if ($.browser.msie) {
-			if (window.event) {
-				clickX = window.event.clientX;
-				clickY = window.event.clientY;
-			}
-			else {
-				clickX = e.clientX;
-				clickY = e.clientY;
-			}
+			clickX = parseInt(window.event.offsetX, 10);
+			clickY = parseInt(window.event.offsetY, 10);
 		}
 		else{
 			clickX = e.pageX;
@@ -133,11 +129,11 @@
 		}
 
 		var currentPos = null;
-		if (this.type == "DIV") {
+		if (this.type == "DIV" && !$.browser.msie) {
 			var mapDomElement = this.getDomElement();
 			currentPos = new Point(
-				clickX - parseInt(mapDomElement.style.left), 
-				clickY - parseInt(mapDomElement.style.top)
+				clickX - parseInt(mapDomElement.style.left, 10), 
+				clickY - parseInt(mapDomElement.style.top, 10)
 			);
 			// if the mouse position is not on top of the map, return null
 			if (currentPos.x < 0 || currentPos.x > this.width || 
@@ -150,9 +146,18 @@
 				clickX, 
 				clickY
 			);
+
+			// sometimes there are divs within the map (like copyright)
+			// then offsetX and offsetY are not valid.
+			if (window.event.srcElement.tagName.toUpperCase() !== "IMG") {
+				var top = parseInt(window.event.srcElement.style.top, 10);
+				var left = parseInt(window.event.srcElement.style.left, 10);
+				currentPos = currentPos.plus(new Point(left,top));
+			}
+			
 		}
 		return currentPos;
-	}
+	};
 	
 	/**
 	 * converts the extent of the mapobject so that the maximum	extent will be displayed
@@ -197,7 +202,7 @@
 		return ext;
 	};
 
-	var ignoredWms = [];
+	var ignoredWms;
 
 	var undoIgnoreWms = function () {
 		ignoredWms = [];
@@ -273,106 +278,64 @@
 		this.epsg = options.srs;
 		return this.calculateExtent(options.extent);
 	};
-	
-	// private
-	this.width = width;
-	// private
-	this.height = height;
-	this.frameName = frameName;
-	this.type = (frameName !== "") ? "IFRAME" : "DIV";
-	this.elementName = elementName;
-	this.layers = [];
-	this.styles = [];
-	this.querylayers = [];
-	this.geom = "";
-	this.gml = "";
-	this.wms = [];
 
-	//
-	// Add pointers to WMS objects which are in this map.
-	// If wms_index is set (=map is overview), only this
-	// WMS is being pointed to.
-	//
-	var index = 0;
-	for (var i = 0; i < wms.length; i++) {
-		var isValidWms = (wms_index === null) || (wms_index == i);
-		if (isValidWms) {
-			this.wms[index] = wms[i];
-			this.wms[index].mapURL = false;
-			index++;
+	this.setWms = function (wms_index) {
+		this.wms = [];
+		var index = 0;
+		for (var i = 0; i < wms.length; i++) {
+			var isValidWms = (wms_index === null) || (wms_index == i);
+			if (isValidWms) {
+				// MAJOR CHANGE!
+				// formerly, this was a reference!
+				// Now, this is a copy!
+				// Each map object has its own set of WMS.
+				// I expect some things to break :-)
+				this.wms[index] = cloneObject(wms[i]);
+				this.wms[index].mapURL = false;
+				index++;
+			}
 		}
-	}
-	
-	//
-	// set list of visible layers, active querylayers 
-	// and styles for each WMS in this map
-	//
-	var cnt_layers;
-	var cnt_querylayers;
-	var styles;
-	var layers;
-	var querylayers = "";
-	for (i = 0; i < this.wms.length; i++) {
-		cnt_layers = 0;
-		cnt_querylayers = 0;
-		styles = "";
-		layers = "";
-		querylayers = "";
-		
-		for (var ii = 0; ii < this.wms[i].objLayer.length; ii++) {
-			// layer is visible and not root layer
-			if (this.wms[i].objLayer[ii].gui_layer_visible == 1 && ii > 0) {
-				if (cnt_layers > 0) {
-					layers += ",";
-					styles += ",";
+	};
+
+	this.initializeWms = function () {
+		var cnt_layers;
+		var cnt_querylayers;
+		var styles;
+		var layers;
+		var querylayers = "";
+		for (i = 0; i < this.wms.length; i++) {
+			cnt_layers = 0;
+			cnt_querylayers = 0;
+			styles = "";
+			layers = "";
+			querylayers = "";
+			
+			for (var ii = 0; ii < this.wms[i].objLayer.length; ii++) {
+				// layer is visible and not root layer
+				if (this.wms[i].objLayer[ii].gui_layer_visible == 1 && ii > 0) {
+					if (cnt_layers > 0) {
+						layers += ",";
+						styles += ",";
+					}
+					layers += this.wms[i].objLayer[ii].layer_name;
+					styles += "";
+					cnt_layers++;
 				}
-				layers += this.wms[i].objLayer[ii].layer_name;
-				styles += "";
-				cnt_layers++;
-			}
-			// layer is queryable and not root layer
-			if (this.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii > 0) {
-				if (cnt_querylayers > 0) {
-					querylayers += ",";
+				// layer is queryable and not root layer
+				if (this.wms[i].objLayer[ii].gui_layer_querylayer == 1 && ii > 0) {
+					if (cnt_querylayers > 0) {
+						querylayers += ",";
+					}
+					querylayers += this.wms[i].objLayer[ii].layer_name;
+					cnt_querylayers++;
 				}
-				querylayers += this.wms[i].objLayer[ii].layer_name;
-				cnt_querylayers++;
 			}
+			this.layers[i] = layers;
+			this.styles[i] = styles;
+			this.querylayers[i] = querylayers;
 		}
-		this.layers[i] = layers;
-		this.styles[i] = styles;
-		this.querylayers[i] = querylayers;
-	}
-	
-	var bbox_minx, bbox_miny, bbox_maxx, bbox_maxy;
-	
-	for (var i = 0; i < wms[0].gui_epsg.length; i++) {
-		if (wms[0].gui_wms_epsg == wms[0].gui_epsg[i]) {
-			bbox_minx = parseFloat(wms[0].gui_minx[i]);
-			bbox_miny = parseFloat(wms[0].gui_miny[i]);
-			bbox_maxx = parseFloat(wms[0].gui_maxx[i]);
-			bbox_maxy = parseFloat(wms[0].gui_maxy[i]);
-			break;
-		}
-	}
-
-	this.setSrs({
-		srs: wms[0].gui_wms_epsg,
-		extent: new Mapbender.Extent(
-			bbox_minx, 
-			bbox_miny, 
-			bbox_maxx, 
-			bbox_maxy
-		)
-	});
-
-	this.mapURL = [];
-	var domElement = this.getDomElement();
-	domElement.style.width = this.width;
-	domElement.style.height = this.height;   
-   
-	this.afterMapRequest = new MapbenderEvent();
-	
+		
+	};
 	/**
 	 * get the extent of the mapObj
 	 *
@@ -750,7 +713,7 @@
 		url = url.substr(0, url.length-1);
 
 		return url;
-	}
+	};
 	
 	/**
 	 * get all featureInfoRequests
@@ -812,7 +775,7 @@
 			xtenty = parseFloat(bbox[3]) - parseFloat(bbox[1]);
 			scale = (xtenty / this.height) * (mb_resolution * 100);
 		}
-		return parseInt(Math.round(scale));
+		return parseInt(Math.round(scale), 10);
 	};
 	
 	/**
@@ -887,7 +850,7 @@
 			try {
 				if (this.skipWmsIfSrsNotSupported && isIgnoredWms(currentWms)) {
 					continue;
-				};
+				}
 			}
 			catch (e) {
 				new Mb_warning(e.message);
@@ -947,7 +910,7 @@
 		for(var i=0; i < this.querylayers.length; i++) {
 			this.mb_MapFutureObj[cnt].querylayers[i] = this.querylayers[i];
 		}
-	}
+	};
 	
 	this.setMapRequest = function(){
 		var ret = eventBeforeMapRequest.trigger({
@@ -968,7 +931,7 @@
 			try {
 				if (this.skipWmsIfSrsNotSupported && isIgnoredWms(currentWms)) {
 					continue;
-				};
+				}
 			}
 			catch (e) {
 				new Mb_warning(e.message);
@@ -994,14 +957,12 @@
 		});
 	};
 
-	var that = this;
-
 	var getLayerHtmlCode = function (ii) {
 		var currentWms = that.wms[ii];
 	
 		var myDivId = that.elementName + "_div_" + ii;          
 		var myMapId = that.elementName + "_map_" + ii;
-		var ts = mb_timestamp();
+		var ts = mb_timestamp(); 
 
 		//disable Layer which are out of scale
 		var validLayers = that.checkScale(ii);
@@ -1047,7 +1008,7 @@
 		}
 	
 		return newMapRequest;
-	}
+	};
 	
 	this.getWmsIdByTitle = function (title) {
 		for (var i=0; i < this.wms.length; i++) {
@@ -1173,19 +1134,78 @@
 		}
 		
 		//remove divtag offset
-		clickX -= parseInt(this.getDomElement().style.left);
-		clickY -= parseInt(this.getDomElement().style.top);
+		clickX -= parseInt(this.getDomElement().style.left, 10);
+		clickY -= parseInt(this.getDomElement().style.top, 10);
 		
 		return new Point(clickX, clickY);
-	}
+	};
 
+	var that = this;
+	// private
+	this.width = width;
+	// private
+	this.height = height;
+	this.frameName = frameName;
+	this.type = (frameName !== "") ? "IFRAME" : "DIV";
+	this.elementName = elementName;
+	this.mapURL = [];
+	var domElement = this.getDomElement();
+	domElement.style.width = this.width;
+	domElement.style.height = this.height;   
+	
+	ignoredWms = [];
+	this.layers = [];
+	this.styles = [];
+	this.querylayers = [];
+	this.geom = "";
+	this.gml = "";		
+	this.wms = [];
+	
+	var bbox_minx, bbox_miny, bbox_maxx, bbox_maxy;
+
 	/**
 	 * Triggered after the map has been resized
 	 */
 	this.eventResizeMap = new MapbenderEvent();
 
-}
+	//
+	// Add pointers to WMS objects which are in this map.
+	// If wms_index is set (=map is overview), only this
+	// WMS is being pointed to.
+	//
+	this.setWms(wms_index);
+	//
+	// set list of visible layers, active querylayers 
+	// and styles for each WMS in this map
+	//
+	this.initializeWms();
+	
+	
+	for (var i = 0; i < wms[0].gui_epsg.length; i++) {
+		if (wms[0].gui_wms_epsg == wms[0].gui_epsg[i]) {
+			bbox_minx = parseFloat(wms[0].gui_minx[i]);
+			bbox_miny = parseFloat(wms[0].gui_miny[i]);
+			bbox_maxx = parseFloat(wms[0].gui_maxx[i]);
+			bbox_maxy = parseFloat(wms[0].gui_maxy[i]);
+			break;
+		}
+	}
 
+	this.setSrs({
+		srs: wms[0].gui_wms_epsg,
+		extent: new Mapbender.Extent(
+			bbox_minx, 
+			bbox_miny, 
+			bbox_maxx, 
+			bbox_maxy
+		)
+	});
+
+   
+	this.afterMapRequest = new MapbenderEvent();
+	
+};
+
 Mapbender.Map.prototype.getWfsConfIds = function (wfs_config) {
 	var db_wfs_conf_id = [];
 	var js_wfs_conf_id = [];
@@ -1195,14 +1215,15 @@
 		for(var ii=0; ii < this.wms[i].objLayer.length; ii++){
 			var o = this.wms[i].objLayer[ii];
 			if(o.gui_layer_wfs_featuretype != '' && o.gui_layer_querylayer == '1'){
-				if(!checkscale || o.checkScale(this))
+				if (!checkscale || o.checkScale(this)) {
 					db_wfs_conf_id[db_wfs_conf_id.length] = o.gui_layer_wfs_featuretype;
+				}
 			}
 		}
 	}
 	for(var i=0; i < db_wfs_conf_id.length; i++){
 		for(var ii=0; ii < wfs_config.length; ii++){
-			if(wfs_config[ii]['wfs_conf_id'] == db_wfs_conf_id[i]){
+			if(wfs_config[ii].wfs_conf_id == db_wfs_conf_id[i]){
 				js_wfs_conf_id[js_wfs_conf_id.length] = ii;
 				break;
 			}

Modified: trunk/mapbender/http/javascripts/mod_loadwmc.js
===================================================================
--- trunk/mapbender/http/javascripts/mod_loadwmc.js	2009-09-10 15:54:27 UTC (rev 4612)
+++ trunk/mapbender/http/javascripts/mod_loadwmc.js	2009-09-10 15:55:34 UTC (rev 4613)
@@ -103,7 +103,7 @@
 						try {
 							if (resultObj.javascript && typeof(resultObj.javascript) == "object") {
 								for (var j=0; j < resultObj.javascript.length; j++) {
-//									var e = new Mb_notice("Statement: %s", resultObj.javascript[j]);
+//									var e = new Mb_notice("Statement: " + resultObj.javascript[j]);
 									eval(resultObj.javascript[j]);
 								}
 							}	



More information about the Mapbender_commits mailing list