X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e336fc31c71c694397603aa05a9e48c99bc8fb5d..d0de36b6072b7e8ee0083e680ebf6a21d5b81ab8:/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); }