[fusion-commits] r2444 - trunk/widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Nov 1 15:01:00 EDT 2011


Author: madair
Date: 2011-11-01 12:00:59 -0700 (Tue, 01 Nov 2011)
New Revision: 2444

Modified:
   trunk/widgets/AddWMSLayer.js
Log:
re #478: use one of advertised SRS so that MapServer can reproject

Modified: trunk/widgets/AddWMSLayer.js
===================================================================
--- trunk/widgets/AddWMSLayer.js	2011-10-26 09:49:58 UTC (rev 2443)
+++ trunk/widgets/AddWMSLayer.js	2011-11-01 19:00:59 UTC (rev 2444)
@@ -175,11 +175,19 @@
     /* 
     function addWMSLayer - adds the clicked layer from the interface created by catalogListLayers
                                then loads browseCatalog.php to add the clicked layer to the current 
-                               session map file. calls addCatalogLayerCB for a return responce.
+                               session map file. calls addCatalogLayerCB for a return response.
     
     */    
     addWMSLayer: function(cb){
         var map = this.getMapLayer();
+        var supportedSRS = cb.srs.toUpperCase();
+        var sourceSrs = map.mapWidget.oMapOL.baseLayer.projection.projCode;  //first try the code of the base map
+        if (supportedSRS.indexOf(sourceSrs) < 0 ) {
+          sourceSrs = "EPSG:4326";  //default to use 4326
+          if (supportedSRS.indexOf(sourceSrs) < 0 ) {
+            sourceSrs = supportedSRS.split(" ").shift();//just pick the first one
+          }
+        }
         
         //prep the servername to remove existing WMS params
         var params = {
@@ -190,7 +198,7 @@
             layername: cb.name,
             group: cb.group,
             owstitle: cb.owstitle,
-            srs: map.oLayerOL.projection.projCode,
+            srs: sourceSrs,
             imageFormat: cb.imageformat,
             servername: cb.servername,
             wmsservicetitle: cb.wmsservicetitle,



More information about the fusion-commits mailing list