From: Tom Hughes Date: Sat, 1 Nov 2014 17:20:26 +0000 (+0000) Subject: Don't centre on load if the location is already in view X-Git-Tag: live~4855^2~5 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/c4746efdb5413fd9b6f260cbe4d0a1b030e60585?ds=sidebyside;hp=9b26dc79c64fd4fde23e03ce15591d22bac3cd98 Don't centre on load if the location is already in view --- diff --git a/app/assets/javascripts/index/query.js b/app/assets/javascripts/index/query.js index 180e203d5..12261abb8 100644 --- a/app/assets/javascripts/index/query.js +++ b/app/assets/javascripts/index/query.js @@ -293,8 +293,7 @@ OSM.Query = function(map) { var params = querystring.parse(path.substring(path.indexOf('?') + 1)), latlng = L.latLng(params.lat, params.lon); - if (!window.location.hash && - (!noCentre || !map.getBounds().contains(latlng))) { + if (!window.location.hash && !noCentre && !map.getBounds().contains(latlng)) { OSM.router.withoutMoveListener(function () { map.setView(latlng, 15); });