X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/20a861392e1ee7970da5d95b546aa8551faaf27b..4de68be3034411cbb21a14f51611d204c2efd1af:/public/javascripts/map.js diff --git a/public/javascripts/map.js b/public/javascripts/map.js index a25ab1614..2349c3230 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -22,6 +22,7 @@ function createMap(divName, options) { new OpenLayers.Control.Attribution(), new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.Navigation(), + new OpenLayers.Control.PanZoom(), new OpenLayers.Control.PanZoomBar() ], units: "m", @@ -192,7 +193,7 @@ function removeBoxFromMap(box){ vectors.removeFeature(box); } -function getMapCenter(center, zoom) { +function getMapCenter() { return map.getCenter().clone().transform(map.getProjectionObject(), epsg4326); } @@ -211,6 +212,10 @@ function getMapExtent() { return map.getExtent().clone().transform(map.getProjectionObject(), epsg4326); } +function getMapZoom() { + return map.getZoom(); +} + function getEventPosition(event) { return map.getLonLatFromViewPortPx(event.xy).clone().transform(map.getProjectionObject(), epsg4326); }