Merge branch 'master' into overpass

This commit is contained in:
Tom Hughes 2014-03-16 16:20:39 +00:00
commit 203ba58bab
68 changed files with 1573 additions and 522 deletions

View file

@ -271,10 +271,11 @@ $(document).ready(function () {
function addObject(type, id, center) {
var bounds = map.addObject({type: type, id: parseInt(id)}, function(bounds) {
if (!window.location.hash && bounds.isValid()) {
OSM.router.moveListenerOff();
map.once('moveend', OSM.router.moveListenerOn);
if (center || !map.getBounds().contains(bounds)) map.fitBounds(bounds);
if (!window.location.hash && bounds.isValid() &&
(center || !map.getBounds().contains(bounds))) {
OSM.router.withoutMoveListener(function () {
map.fitBounds(bounds);
});
}
});
}