]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
HTMLize note browse pages
[rails.git] / app / assets / javascripts / index.js
index 7c80b01081395726d6c57f3e602a42b7ac4f0bbc..6118c8e0d741c7a3ef0614d24f3e91b922e69aab 100644 (file)
@@ -14,7 +14,7 @@ $(document).ready(function () {
 
   map.attributionControl.setPrefix(permalinks);
 
-  map.on("moveend baselayerchange", updateLocation);
+  map.on("moveend layeradd layerremove", updateLocation);
 
   if (!params.object_zoom) {
     if (params.bbox) {
@@ -58,6 +58,10 @@ $(document).ready(function () {
       map.setView(centre, data.zoom);
     }
 
+    if (data.type && data.id) {
+      addObjectToMap(data, true);
+    }
+
     if (marker) {
       map.removeLayer(marker);
     }