From c4746efdb5413fd9b6f260cbe4d0a1b030e60585 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 1 Nov 2014 17:20:26 +0000 Subject: [PATCH 1/1] Don't centre on load if the location is already in view --- app/assets/javascripts/index/query.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); }); -- 2.39.5