X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/4da22eee1acaa77e9059baf1eaa71f302d2ba20f..afe8dd51ece21325eea8a108515b9426764de5b2:/public/javascripts/map.js?ds=inline diff --git a/public/javascripts/map.js b/public/javascripts/map.js index c2ddf9c39..608f4c264 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -32,7 +32,8 @@ function createMap(divName, options) { ], units: "m", maxResolution: 156543.0339, - numZoomLevels: 20 + numZoomLevels: 20, + displayProjection: new OpenLayers.Projection("EPSG:4326") }); var mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik", { @@ -133,6 +134,9 @@ function getMapCenter(center, zoom) { } function setMapCenter(center, zoom) { + zoom = parseInt(zoom); + var numzoom = map.getNumZoomLevels(); + if (zoom >= numzoom) zoom = numzoom - 1; map.setCenter(center.clone().transform(epsg4326, map.getProjectionObject()), zoom); }