[Mapbender-commits] r8248 - branches/2.7/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Feb 13 11:50:16 EST 2012


Author: astrid_emde
Date: 2012-02-13 08:50:16 -0800 (Mon, 13 Feb 2012)
New Revision: 8248

Modified:
   branches/2.7/http/javascripts/map_obj.js
Log:
WMS 1.3.0: switch extent, when EPSG >= 4000 and <5000

Modified: branches/2.7/http/javascripts/map_obj.js
===================================================================
--- branches/2.7/http/javascripts/map_obj.js	2012-02-13 16:47:11 UTC (rev 8247)
+++ branches/2.7/http/javascripts/map_obj.js	2012-02-13 16:50:16 UTC (rev 8248)
@@ -480,8 +480,32 @@
         }
         return "";
     };
-    
+
     /**
+     * get the switched extent of the mapObj
+     *
+     * @member Map
+     * @return extent of the mapObj as commaseparated minx,minx,maxx,maxy
+     * @type string
+     */    
+    this.getExtentSwitch = function(){
+        var ext = this.extent;
+	var tmpExtent;
+        var tmp;
+        if (ext) {
+	tmpExtent = ext.toString().split(",");
+        tmp = tmpExtent[0];
+        tmpExtent[0] = tmpExtent[1];
+        tmpExtent[1] = tmp;
+        tmp = tmpExtent[2];
+        tmpExtent[2] = tmpExtent[3];
+        tmpExtent[3] = tmp;
+        	return tmpExtent.toString();
+        }
+        return "";
+    };
+
+    /**
      * get the extent as minx, maxx, miny, maxy
      *
      * @return extent and additional informations of the mapObj
@@ -785,6 +809,14 @@
      */
     this.getMapUrl = function(ii, extent){
         var currentWms = this.wms[ii];
+	var tmpExtent;
+	tmpExtent = extent.toString().split(",");
+        tmp = tmpExtent[0];
+        tmpExtent[0] = tmpExtent[1];
+        tmpExtent[1] = tmp;
+        tmp = tmpExtent[2];
+        tmpExtent[2] = tmpExtent[3];
+        tmpExtent[3] = tmp;
         var validLayers = (arguments.length === 3 && typeof arguments[2] === "number") ? 
 			currentWms.getLayers(this, arguments[2]) : currentWms.getLayers(this);
         if (validLayers.length === 0) {
@@ -823,9 +855,15 @@
 		url += "SRS=" + this.epsg + "&";
         }else{
 		url += "CRS=" + this.epsg + "&";
-	}        
-
-        url += "BBOX=" + extent.toString() + "&";
+	}
+	tmp_epsg = this.epsg;
+	tmp_epsg = tmp_epsg.replace(/EPSG:/g,'');
+	tmp_epsg = tmp_epsg.replace(/CRS:/g,'');  
+        if (currentWms.wms_version == "1.3.0" &&  tmp_epsg >= 4000 && tmp_epsg < 5000){
+                url += "BBOX=" + tmpExtent.toString() + "&";
+        }else{
+                url += "BBOX=" + extent.toString() + "&";
+        }
         url += "WIDTH=" + this.getWidth() + "&";
         url += "HEIGHT=" + this.getHeight() + "&";
         url += "FORMAT=" + currentWms.gui_wms_mapformat + "&";



More information about the Mapbender_commits mailing list