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:
Tom Hughes 2013-12-04 08:41:56 +00:00
parent bdbc1d663d
commit b65ad205d1

View file

@ -64,7 +64,7 @@ OSM.Note = function (map) {
var data = $('.details').data(),
latLng = data.coordinates.split(',');
if (!window.location.hash) {
if (!window.location.hash || window.location.hash.match(/^#?c[0-9]+$/)) {
OSM.router.moveListenerOff();
map.once('moveend', OSM.router.moveListenerOn);
map.getZoom() > 15 ? map.panTo(latLng) : map.setView(latLng, 16);