diff --git a/projects/common-map/src/fm-map/effects/map.effects.ts b/projects/common-map/src/fm-map/effects/map.effects.ts index 1f6bb1f..8f09c2c 100644 --- a/projects/common-map/src/fm-map/effects/map.effects.ts +++ b/projects/common-map/src/fm-map/effects/map.effects.ts @@ -27,6 +27,7 @@ import {FeatureIconService} from '../services/feature-icon.service'; import * as style from 'ol/style'; import { ItemTypeService,IQueryState } from '@farmmaps/common'; +import { TemporalItemLayer } from '../models/item.layer' @Injectable() @@ -326,7 +327,7 @@ export class MapEffects { @Effect() updateLayerValuesOnLayerAddedOrRemoved$: Observable = this.actions$.pipe( - ofType(mapActions.ADDLAYER,mapActions.REMOVELAYER,mapActions.SELECTITEM), + ofType(mapActions.ADDLAYER,mapActions.REMOVELAYER,mapActions.SELECTITEM,mapActions.NEXTTEMPORAL,mapActions.PREVIOUSTEMPORAL,mapActions.TOGGLELAYERVALUESENABLED), withLatestFrom(this.store$.select(mapReducers.selectGetLayerValuesX)), withLatestFrom(this.store$.select(mapReducers.selectGetLayerValuesY)), map(([[action,x],y]) => new mapActions.SetLayerValuesLocation(x,y)) @@ -341,7 +342,12 @@ export class MapEffects { withLatestFrom(this.store$.select(mapReducers.selectGetOverlayLayers)), mergeMap(([[[action, selected], enabled],overlayLayers]) => { let layers = []; - if(selected) layers.push(selected); + if(selected) { + if(selected instanceof TemporalItemLayer ) { + selected=(selected as TemporalItemLayer).selectedItemLayer; + } + layers.push(selected); + } overlayLayers.forEach((ol) => { if(ol!=selected) layers.push(ol); });