]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/note.js.erb
Add SOTM advert
[rails.git] / app / assets / javascripts / index / note.js.erb
index 18000deb05ab2ea4e963f8e7e3b1a9e6ff9db953..2c9e42210008bf6b1653d5d530233d114090e51e 100644 (file)
@@ -101,9 +101,9 @@ OSM.Note = function (map) {
       latLng = L.latLng(data.coordinates.split(','));
 
     if (!window.location.hash || window.location.hash.match(/^#?c[0-9]+$/)) {
-      OSM.router.moveListenerOff();
-      map.once('moveend', OSM.router.moveListenerOn);
-      map.setView(latLng, 15, {reset: true});
+      OSM.router.withoutMoveListener(function () {
+        map.setView(latLng, 15, {reset: true});
+      });
     }
   }