]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/map.js.erb
Make it easier to test alternative locales
[rails.git] / app / assets / javascripts / map.js.erb
index fc2f955a8400ebb10b74892506fe6e8c2faf4296..c06c9c8eaf809cf0aecc9733da766b0458aeff2a 100644 (file)
@@ -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;
    }
 }
 
@@ -220,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() {