- function enableFilter() {
- $("#browse_filter_toggle").html(I18n.t('browse.start_rjs.view_data'));
- locationFilter.setBounds(map.getBounds().pad(-0.2));
- locationFilter.enable();
- getData();
- }
+ function toggleFilter() {
+ if (locationFilter.isEnabled()) {
+ $("#browse_filter_toggle").html(I18n.t('browse.start_rjs.manually_select'));
+ locationFilter.disable();
+ } else {
+ $("#browse_filter_toggle").html(I18n.t('browse.start_rjs.view_data'));
+ locationFilter.setBounds(map.getBounds().pad(-0.2));
+ locationFilter.enable();
+ }