]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/query.js
Don't centre on load if the location is already in view
[rails.git] / app / assets / javascripts / index / query.js
index 180e203d5b2237ae19b53669cfc4cee9d7fc4722..12261abb823b4c99ea3015be63b696be62a5e07d 100644 (file)
@@ -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);
       });