changeset 82:7b65d95735d2 trimmed_data

add support for custom projection of base maps (ArcGIS)
author Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
date Fri, 01 Feb 2013 17:20:36 +0100
parents a183604fe16a
children f835c707e9be
files war/scripts/sti/STIMap.js
diffstat 1 files changed, 30 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/war/scripts/sti/STIMap.js	Fri Feb 01 17:15:07 2013 +0100
+++ b/war/scripts/sti/STIMap.js	Fri Feb 01 17:20:36 2013 +0100
@@ -631,15 +631,38 @@
             var name = wmsLayers[i].getElementsByTagName("name")[0].childNodes[0].nodeValue;
             var server = wmsLayers[i].getElementsByTagName("server")[0].childNodes[0].nodeValue;
             var layer = wmsLayers[i].getElementsByTagName("layer")[0].childNodes[0].nodeValue;
+            
+            var projection = "";
+            if (wmsLayers[i].getElementsByTagName("projection").length > 0)
+            	projection = wmsLayers[i].getElementsByTagName("projection")[0].childNodes[0].nodeValue;
+
+            var overlay = "";
+            if (wmsLayers[i].getElementsByTagName("overlay").length > 0)
+            	overlay = wmsLayers[i].getElementsByTagName("overlay")[0].childNodes[0].nodeValue;
+            
             var format = wmsLayers[i].getElementsByTagName("format")[0].childNodes[0].nodeValue;
             var transparency = wmsLayers[i].getElementsByTagName("transparency")[0].childNodes[0].nodeValue;
-            var layer = new OpenLayers.Layer.WMS(name, server, {
-                layers: layer,
-                format: format,
-                transparent: transparency
-            }, {
-                isBaseLayer: true
-            });
+            
+            var layer;
+            
+            if (projection != "") {
+                layer = new OpenLayers.Layer.WMS(name, server, {
+    	            layers: layer,
+    	            format: format,
+    	            transparent: transparency
+                }, {
+                	projection: projection,
+                    isBaseLayer: overlay==""?true:false
+                });
+            } else {
+                layer = new OpenLayers.Layer.WMS(name, server, {
+    	            layers: layer,
+    	            format: format,
+    	            transparent: transparency
+                }, {
+                    isBaseLayer: overlay==""?true:false
+                });
+            }            	
             this.baseLayers.push(layer);
         }
 		}