X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/97a4e25f909cf80c9e97edece6ce7c9b209d323c..013ef53c97a1d2c8319f1ac624e8325a06828366:/public/javascripts/map.js?ds=sidebyside diff --git a/public/javascripts/map.js b/public/javascripts/map.js index 631999a0a..db5b85616 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -109,8 +109,12 @@ function setMapExtent(extent) { map.zoomToExtent(extent.clone().transform(epsg4326, map.getProjectionObject())); } +function getMapExtent(extent) { + return map.getExtent().clone().transform(map.getProjectionObject(), epsg4326); +} + function getEventPosition(event) { - return map.getLonLatFromViewPortPx(e.xy).clone().transform(epsg4326, map.getProjectionObject()); + return map.getLonLatFromViewPortPx(event.xy).clone().transform(map.getProjectionObject(), epsg4326); } function getMapLayers() {