Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Update event map object on projChange #2753

Benjamin Kingb8ca372dcbb2
diff --git a/web/js/map/natural-events/ui.js b/web/js/map/natural-events/ui.js
index 698d5d630..3fe6f12de 100644
--- a/web/js/map/natural-events/ui.js
+++ b/web/js/map/natural-events/ui.js
@@ -12,6 +12,7 @@ import { activateLayersForEventCategory } from '../../modules/layers/actions';
import { deselectEvent as deselectEventAction, selected as selectedAction } from '../../modules/natural-events/actions';
import { selectDate } from '../../modules/date/actions';
import { CHANGE_PROJECTION } from '../../modules/projection/constants';
+import { UPDATE_MAP_UI } from '../../modules/map/constants';
const zoomLevelReference = {
Wildfires: 8,
@@ -51,6 +52,11 @@ export default function naturalEventsUI(ui, config, store, models) {
return self.selectEvent(action.id, action.date);
case EVENT_CONSTANTS.DESELECT_EVENT:
return self.deselectEvent();
+ case UPDATE_MAP_UI:
+ if (map.proj !== action.ui.selected.proj) {
+ onProjChange(action.ui.selected.proj);
+ }
+ return;
case EVENT_CONSTANTS.REQUEST_EVENTS_SUCCESS:
case EVENT_CONSTANTS.REQUEST_SOURCES_SUCCESS:
case EVENT_CONSTANTS.REQUEST_CATEGORIES_SUCCESS:
@@ -70,9 +76,7 @@ export default function naturalEventsUI(ui, config, store, models) {
return self.selectEvent(selected.id, selected.date, null, true);
}
}
- return;
- case CHANGE_PROJECTION:
- return !isLoading ? onProjChange(action.id) : '';
+ break;
default:
break;
}
diff --git a/web/js/map/ui.js b/web/js/map/ui.js
index 3edc9c20b..d62b9b9c7 100644
--- a/web/js/map/ui.js
+++ b/web/js/map/ui.js
@@ -953,6 +953,7 @@ export function mapui(models, config, store, ui) {
scaleMetric,
scaleImperial,
};
+ map.proj = proj.id;
createZoomButtons(map, proj);
createMousePosSel(map, proj);