diff --git a/projects/common-map/src/fm-map/actions/map.actions.ts b/projects/common-map/src/fm-map/actions/map.actions.ts index 50377f6..e21e460 100644 --- a/projects/common-map/src/fm-map/actions/map.actions.ts +++ b/projects/common-map/src/fm-map/actions/map.actions.ts @@ -49,6 +49,7 @@ export const SETSTYLE = '[Map] SetStyle'; export const SHOWLAYERSWITCHER = '[Map] ShowLayerSwitcher'; export const CLEAR = '[Map] Clear'; export const SETREPLACEURL = '[Map] SetReplaceUrl'; +export const GETFEATURES = '[Map] etFeatures' export const SETFEATURES = '[Map] SetFeatures' export const SETLAYERVALUESLOCATION = '[Map] SetLayerValuesLocation' export const TOGGLELAYERVALUESENABLED = '[Map] ToggleLayerValuesEnabled' @@ -56,6 +57,7 @@ export const GETLAYERVALUE = '[Map] GetLayerValue' export const GETLAYERVALUESUCCESS = '[Map] GetLayerValueSuccess' export const TOGGLESHOWDATALAYERSLIDE = '[Map] ToggleShowDataLayerSlide' export const SETVIEWSTATE = '[Map] SetViewState' +export const CLEARFEATURES = '[Map] ClearFeatures'; export class Clear implements Action { @@ -329,6 +331,11 @@ export class SetViewState implements Action { constructor(public enabled:boolean) {} } +export class ClearFeatures implements Action { + readonly type = CLEARFEATURES; + constructor() {} +} + export type Actions = SetMapState | Init | Clear @@ -374,5 +381,6 @@ export type Actions = SetMapState | GetLayerValue | SetPeriod | ToggleShowDataLayerSlide - | SetViewState; + | SetViewState + | ClearFeatures; diff --git a/projects/common-map/src/fm-map/reducers/map.reducer.ts b/projects/common-map/src/fm-map/reducers/map.reducer.ts index b70ca44..fbd0fa3 100644 --- a/projects/common-map/src/fm-map/reducers/map.reducer.ts +++ b/projects/common-map/src/fm-map/reducers/map.reducer.ts @@ -388,6 +388,9 @@ export function reducer(state = initialState, action: mapActions.Actions | commo case mapActions.CLEARLAYERS: { return tassign(state, {overlayLayers: [], selectedOverlayLayer: null}); } + case mapActions.CLEARFEATURES: { + return tassign(state, {features: [], selectedFeature: null}); + } case mapActions.SETVISIBILITY: { const a = action as mapActions.SetVisibility; if(state.selectedItemLayer == a.itemLayer) {