X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e336fc31c71c694397603aa05a9e48c99bc8fb5d..104ba9c57ab55051988902dacc5e12a6b33554b2:/app/assets/javascripts/index/note.js.erb diff --git a/app/assets/javascripts/index/note.js.erb b/app/assets/javascripts/index/note.js.erb index b9730bf1d..09044bf0e 100644 --- a/app/assets/javascripts/index/note.js.erb +++ b/app/assets/javascripts/index/note.js.erb @@ -38,7 +38,7 @@ OSM.Note = function (map) { } else if (marker) { marker.setIcon(noteIcons[feature.properties.status]); } - page.load(); + OSM.loadSidebarContent(window.location.pathname, page.load); } }); } @@ -70,8 +70,11 @@ OSM.Note = function (map) { var data = $('.details').data(); if (!noteState) map.addLayer(noteLayer); - if (window.location.hash == "") { + if (!window.location.hash) { var coords = data.coordinates.split(','); + OSM.route.moveListenerOff(); + map.once('moveend', OSM.route.moveListenerOn); + map.getZoom() > 15 ? map.panTo(coords) : map.setView(coords, 16); }