X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0b8449d2c95c52402b4a8cc7f49362820a752cc0..d3c60874092c63b493818f227f31027327b595e3:/public/javascripts/map.js diff --git a/public/javascripts/map.js b/public/javascripts/map.js index c80ed2242..a25564f0d 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/"; } @@ -132,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); @@ -141,7 +144,7 @@ function setMapExtent(extent) { map.zoomToExtent(extent.clone().transform(epsg4326, map.getProjectionObject())); } -function getMapExtent(extent) { +function getMapExtent() { return map.getExtent().clone().transform(map.getProjectionObject(), epsg4326); }