Don't centre on load if the location is already in view
This commit is contained in:
parent
9b26dc79c6
commit
c4746efdb5
1 changed files with 1 additions and 2 deletions
|
@ -293,8 +293,7 @@ OSM.Query = function(map) {
|
||||||
var params = querystring.parse(path.substring(path.indexOf('?') + 1)),
|
var params = querystring.parse(path.substring(path.indexOf('?') + 1)),
|
||||||
latlng = L.latLng(params.lat, params.lon);
|
latlng = L.latLng(params.lat, params.lon);
|
||||||
|
|
||||||
if (!window.location.hash &&
|
if (!window.location.hash && !noCentre && !map.getBounds().contains(latlng)) {
|
||||||
(!noCentre || !map.getBounds().contains(latlng))) {
|
|
||||||
OSM.router.withoutMoveListener(function () {
|
OSM.router.withoutMoveListener(function () {
|
||||||
map.setView(latlng, 15);
|
map.setView(latlng, 15);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue