Position on notes correctly when a link to a comment is loaded
Links to note comments in the RSS feed have a #id on the end to position on the right comment, so don't let those hash strings stop the map from panning to the note. Fixes #603.
This commit is contained in:
parent
bdbc1d663d
commit
b65ad205d1
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ OSM.Note = function (map) {
|
||||||
var data = $('.details').data(),
|
var data = $('.details').data(),
|
||||||
latLng = data.coordinates.split(',');
|
latLng = data.coordinates.split(',');
|
||||||
|
|
||||||
if (!window.location.hash) {
|
if (!window.location.hash || window.location.hash.match(/^#?c[0-9]+$/)) {
|
||||||
OSM.router.moveListenerOff();
|
OSM.router.moveListenerOff();
|
||||||
map.once('moveend', OSM.router.moveListenerOn);
|
map.once('moveend', OSM.router.moveListenerOn);
|
||||||
map.getZoom() > 15 ? map.panTo(latLng) : map.setView(latLng, 16);
|
map.getZoom() > 15 ? map.panTo(latLng) : map.setView(latLng, 16);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue