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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 20 06:25:31 EST 2010


Author: christoph
Date: 2010-01-20 06:25:30 -0500 (Wed, 20 Jan 2010)
New Revision: 5364

Modified:
   trunk/mapbender/http/javascripts/map_obj.js
   trunk/mapbender/http/javascripts/wms.js
Log:
set layer style always to "default" instead of ""

Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js	2010-01-20 10:16:14 UTC (rev 5363)
+++ trunk/mapbender/http/javascripts/map_obj.js	2010-01-20 11:25:30 UTC (rev 5364)
@@ -713,27 +713,6 @@
     };
     
     /**
-     * get all mapRequests
-     *
-     * @return array of mapRequests of this map object
-     * @type string[]
-     */
-    this.getMapRequests = function(){
-        var allRequests = [];
-        //loop through all wms to get the mapRequests
-        for (var i = 0; i < this.wms.length; i++) {
-            var currentRequest = this.wms[i].getMapRequest(this);
-            if (currentRequest) {
-                allRequests.push(currentRequest);
-            }
-        }
-        if (allRequests.length > 0) {
-            return allRequests;
-        }
-        return false;
-    };
-    
-    /**
      * Return the map URL of the WMS at index i
      * @param {Object} currentWmsIndex
      */

Modified: trunk/mapbender/http/javascripts/wms.js
===================================================================
--- trunk/mapbender/http/javascripts/wms.js	2010-01-20 10:16:14 UTC (rev 5363)
+++ trunk/mapbender/http/javascripts/wms.js	2010-01-20 11:25:30 UTC (rev 5364)
@@ -177,43 +177,6 @@
 };
 
 /**
- * rephrases the mapRequest
- *
- * @param {Object} mapObj the mapbender mapObject of the wms  
- * @return mapRequest, i.e. onlineresource + params
- * @type String
- */
-wms_const.prototype.getMapRequest = function(mapObj){	
-	//check visible layers first
-	var layers = this.getLayers(mapObj);
-	if(!layers){
-		return false;
-	}
-	
-	var rq = this.wms_getmap;
-	rq += mb_getConjunctionCharacter(this.wms_getmap);
-	if(this.wms_version === "1.0.0"){
-		rq += "WMTVER=" + this.wms_version + "&REQUEST=map";
-	}
-	else{
-		rq += "VERSION=" + this.wms_version + "&REQUEST=getMap&SERVICE=WMS";
-	}
-	
-	rq += "&LAYERS=" + layers.join(",");
-	rq += "&WIDTH=" + mapObj.getWidth();
-	rq += "&HEIGHT=" + mapObj.getHeight();
-	rq += "&SRS=" + mapObj.getSRS();
-	rq += "&BBOX=" + mapObj.getExtent();
-	rq += "&STYLES=" + this.getLayerstyles(mapObj).join(",");
-	rq += "&FORMAT=" + this.gui_wms_mapformat;
-	rq += "&EXCEPTIONS=" + this.gui_wms_exceptionformat;
-	//Todo: error occurs:
-	//var throwNotice = new Mb_notice("getMapRequest: " + rq);
-	return rq;
-};
-
-
-/**
  * rephrases the featureInfoRequest
  *
  * @param {Object} mapObj the mapbender mapObject of the wms  
@@ -363,6 +326,7 @@
  * @type string
  */
 wms_const.prototype.getLayerstyles = function(mapObj){
+	
 	var layers = this.getLayers(mapObj);
 	var layerstyles = '';
 	var styles = [];
@@ -418,12 +382,14 @@
  */
 wms_const.prototype.getCurrentStyleByLayerName = function(layername){
 	for(var i=0; i< this.objLayer.length; i++){
-		if(this.objLayer[i].layer_name == layername){
-			if(this.objLayer[i].gui_layer_style === '' || this.objLayer[i].gui_layer_style === null){
-				return false;
+		var currentLayer = this.objLayer[i];
+		if (currentLayer.layer_name === layername) {
+			if (currentLayer.gui_layer_style === '' || currentLayer.gui_layer_style === null){
+				return "default";
+//				return false;
 			}
 			else{
-				return this.objLayer[i].gui_layer_style;	
+				return currentLayer.gui_layer_style;	
 			}
 		}
 	}



More information about the Mapbender_commits mailing list