X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3b1f455dd9c7b64933f952350081728458d190a1..0ba1839e78e694ab4ac1ca9fc650df1eec101b7c:/app/assets/javascripts/map.js.erb?ds=inline diff --git a/app/assets/javascripts/map.js.erb b/app/assets/javascripts/map.js.erb index 8aa9868b3..c06c9c8ea 100644 --- a/app/assets/javascripts/map.js.erb +++ b/app/assets/javascripts/map.js.erb @@ -106,13 +106,13 @@ function addMarkerToMap(position, icon, description) { return marker; } -function addObjectToMap(url, zoom, callback) { +function addObjectToMap(object, zoom, callback) { var layer = new OpenLayers.Layer.Vector("Objects", { strategies: [ new OpenLayers.Strategy.Fixed() ], protocol: new OpenLayers.Protocol.HTTP({ - url: url, + url: OSM.apiUrl(object), format: new OpenLayers.Format.OSM() }), style: { @@ -196,7 +196,6 @@ function openMapPopup(marker, description) { function closeMapPopup() { if (popup) { map.removePopup(popup); - delete popup; } } @@ -204,10 +203,6 @@ function removeMarkerFromMap(marker){ markers.removeMarker(marker); } -function removeBoxFromMap(box){ - vectors.removeFeature(box); -} - function proj(x) { return x.clone().transform(epsg4326, map.getProjectionObject()); } @@ -224,7 +219,7 @@ function setMapCenter(center, zoom) { } function getEventPosition(event) { - return map.getLonLatFromViewPortPx(event.xy).clone().transform(map.getProjectionObject(), epsg4326); + return unproj(map.getLonLatFromViewPortPx(event.xy)); } function getMapLayers() {