Don't zoom map when enabling location filter
This commit is contained in:
parent
ed84516db2
commit
5b42c683f5
2 changed files with 7 additions and 3 deletions
|
@ -83,6 +83,7 @@ $(document).ready(function () {
|
||||||
|
|
||||||
function enableFilter() {
|
function enableFilter() {
|
||||||
$("#browse_filter_toggle").html(I18n.t('browse.start_rjs.view_data'));
|
$("#browse_filter_toggle").html(I18n.t('browse.start_rjs.view_data'));
|
||||||
|
locationFilter.setBounds(map.getBounds().pad(-0.2));
|
||||||
locationFilter.enable();
|
locationFilter.enable();
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ $(document).ready(function () {
|
||||||
|
|
||||||
var locationFilter = new L.LocationFilter({
|
var locationFilter = new L.LocationFilter({
|
||||||
enableButton: false,
|
enableButton: false,
|
||||||
adjustButton: false,
|
adjustButton: false
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
locationFilter.on("change", filterChanged);
|
locationFilter.on("change", filterChanged);
|
||||||
|
@ -83,15 +83,18 @@ $(document).ready(function () {
|
||||||
var bounds = getBounds();
|
var bounds = getBounds();
|
||||||
|
|
||||||
map.fitBounds(bounds);
|
map.fitBounds(bounds);
|
||||||
|
|
||||||
enableFilter();
|
|
||||||
locationFilter.setBounds(bounds);
|
locationFilter.setBounds(bounds);
|
||||||
|
|
||||||
|
enableFilter();
|
||||||
validateControls();
|
validateControls();
|
||||||
mapnikSizeChanged();
|
mapnikSizeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableFilter() {
|
function enableFilter() {
|
||||||
|
if (!locationFilter.getBounds().isValid()) {
|
||||||
|
locationFilter.setBounds(map.getBounds().pad(-0.2));
|
||||||
|
}
|
||||||
|
|
||||||
$("#drag_box").hide();
|
$("#drag_box").hide();
|
||||||
locationFilter.enable();
|
locationFilter.enable();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue