Don't zoom map when enabling location filter

This commit is contained in:
John Firebaugh 2012-11-09 12:58:47 -08:00
parent ed84516db2
commit 5b42c683f5
2 changed files with 7 additions and 3 deletions

View file

@ -83,6 +83,7 @@ $(document).ready(function () {
function enableFilter() {
$("#browse_filter_toggle").html(I18n.t('browse.start_rjs.view_data'));
locationFilter.setBounds(map.getBounds().pad(-0.2));
locationFilter.enable();
getData();
}

View file

@ -15,7 +15,7 @@ $(document).ready(function () {
var locationFilter = new L.LocationFilter({
enableButton: false,
adjustButton: false,
adjustButton: false
}).addTo(map);
locationFilter.on("change", filterChanged);
@ -83,15 +83,18 @@ $(document).ready(function () {
var bounds = getBounds();
map.fitBounds(bounds);
enableFilter();
locationFilter.setBounds(bounds);
enableFilter();
validateControls();
mapnikSizeChanged();
}
function enableFilter() {
if (!locationFilter.getBounds().isValid()) {
locationFilter.setBounds(map.getBounds().pad(-0.2));
}
$("#drag_box").hide();
locationFilter.enable();
}