X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/436012c6975cf2eef7d9908ad48d70dad833afd0..db66d47e42bc267670ef00b3b2611b4b53cb40e9:/public/javascripts/map.js diff --git a/public/javascripts/map.js b/public/javascripts/map.js index 7591d7d16..291fd18fa 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -7,9 +7,11 @@ OpenLayers._getScriptLocation = function () { return "/openlayers/"; } -function createMap(divName) { +function createMap(divName, options) { + options = options || {}; + map = new OpenLayers.Map(divName, { - controls: [ + controls: options.controls || [ new OpenLayers.Control.ArgParser(), new OpenLayers.Control.Attribution(), new OpenLayers.Control.LayerSwitcher(), @@ -18,7 +20,7 @@ function createMap(divName) { new OpenLayers.Control.ScaleLine() ], units: "m", - maxResolution: 156543, + maxResolution: 156543.0339, numZoomLevels: 20 }); @@ -155,7 +157,11 @@ function setMapLayers(layerConfig) { for (var layers = map.getLayersBy("isBaseLayer", false), i = 0; i < layers.length; i++) { var c = layerConfig.charAt(l++); - layers[i].setVisibility(c == "T"); + if (c == "T") { + layers[i].setVisibility(true); + } else if(c == "F") { + layers[i].setVisibility(false); + } } }