X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fb1d36623bf9588a7dbb481714cfb91dda4e8f3b..afe8dd51ece21325eea8a108515b9426764de5b2:/public/javascripts/map.js diff --git a/public/javascripts/map.js b/public/javascripts/map.js index d6349d698..608f4c264 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -13,6 +13,8 @@ var nonamekeys = { }; OpenLayers._getScriptLocation = function () { + // Should really have this file as an erb, so that this can return + // the real rails root return "/openlayers/"; } @@ -30,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", { @@ -131,6 +134,7 @@ 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);