# HG changeset patch # User Sebastian Kruse # Date 1359735636 -3600 # Node ID 7b65d95735d26dbd1004642ab5e44991d05f0359 # Parent a183604fe16ab08d560977ca3d1561ae77f2f992 add support for custom projection of base maps (ArcGIS) diff -r a183604fe16a -r 7b65d95735d2 war/scripts/sti/STIMap.js --- 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); } }