Refactor style cache

This commit is contained in:
Willem Dantuma
2020-02-12 20:38:14 +01:00
parent b83aca7969
commit 6379b64351
9 changed files with 258 additions and 224 deletions

View File

@@ -4,8 +4,7 @@ import { IMapState } from '../models/map.state';
import { IItemLayer } from '../models/item.layer';
import { IQueryState } from '../models/query.state';
import { IItem } from '@farmmaps/common';
import { Feature } from 'ol';
import { Extent } from 'ol/extent';
import { Feature,Style } from 'ol';
export const SETSTATE = '[Map] SetState';
export const SETMAPSTATE = '[Map] MapState';
@@ -35,6 +34,7 @@ export const SELECTBASELAYER = '[Map] SelectBaseLayers';
export const SELECTOVERLAYLAYER = '[Map] SelectOverlayLayers';
export const ZOOMTOEXTENT = '[Map] ZoomToExtent';
export const DOQUERY = '[Map] DoQuery';
export const SETSTYLE = '[Map] SetStyle';
export class SetState implements Action {
readonly type = SETSTATE;
@@ -204,6 +204,12 @@ export class DoQuery implements Action {
constructor(public query:IQueryState) { }
}
export class SetStyle implements Action {
readonly type = SETSTYLE;
constructor(public itemType:string,public style:Style) { }
}
export type Actions = SetMapState
| Init
| SetParent
@@ -231,5 +237,6 @@ export type Actions = SetMapState
| ZoomToExtent
| SetState
| SetViewExtent
| DoQuery;
| DoQuery
| SetStyle;