Make sure the query location is always in view
This commit is contained in:
parent
203ba58bab
commit
1f250c45bd
1 changed files with 11 additions and 5 deletions
|
@ -256,17 +256,23 @@ OSM.Query = function(map) {
|
|||
|
||||
page.pushstate = page.popstate = function(path) {
|
||||
OSM.loadSidebarContent(path, function () {
|
||||
page.load(path);
|
||||
page.load(path, true);
|
||||
});
|
||||
};
|
||||
|
||||
page.load = function(path) {
|
||||
var params = querystring.parse(path.substring(path.indexOf('?') + 1));
|
||||
page.load = function(path, noCentre) {
|
||||
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))) {
|
||||
OSM.router.withoutMoveListener(function () {
|
||||
map.setView(latlng, 15);
|
||||
});
|
||||
}
|
||||
|
||||
queryOverpass(params.lat, params.lon);
|
||||
enableQueryMode();
|
||||
|
||||
return map.getState();
|
||||
};
|
||||
|
||||
page.unload = function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue