2020-01-07 21:27:46 +00:00
|
|
|
import { Action } from '@ngrx/store';
|
|
|
|
|
|
|
|
import { IMapState } from '../models/map.state';
|
|
|
|
import { IItemLayer } from '../models/item.layer';
|
2020-02-19 10:37:21 +00:00
|
|
|
import { IQueryState } from '@farmmaps/common';
|
2020-01-07 21:27:46 +00:00
|
|
|
import { IItem } from '@farmmaps/common';
|
2020-02-12 19:38:14 +00:00
|
|
|
import { Feature,Style } from 'ol';
|
2020-02-27 16:59:00 +00:00
|
|
|
import { IListItem } from 'dist/common/public-api';
|
2020-01-07 21:27:46 +00:00
|
|
|
|
|
|
|
export const SETSTATE = '[Map] SetState';
|
|
|
|
export const SETMAPSTATE = '[Map] MapState';
|
|
|
|
export const SETVIEWEXTENT = '[Map] SetViewExtent';
|
|
|
|
export const INIT = '[Map] Init';
|
|
|
|
export const SETPARENT = '[Map] SetParent';
|
|
|
|
export const STARTSEARCH = '[Map] StartSearch';
|
|
|
|
export const STARTSEARCHSUCCESS = '[Map] StartSearchSuccess';
|
|
|
|
export const SELECTFEATURE = '[Map] SelectFeature';
|
|
|
|
export const SELECTITEM = '[Map] SelectItem';
|
|
|
|
export const SELECTITEMSUCCESS = '[Map] SelectItemSuccess';
|
2020-02-27 16:59:00 +00:00
|
|
|
export const SELECTTEMPORALITEMSSUCCESS = '[Map] SelectTemporalItemsSuccess';
|
2020-03-02 08:22:16 +00:00
|
|
|
export const NEXTTEMPORAL = '[Map] NextTemporal';
|
|
|
|
export const PREVIOUSTEMPORAL = '[Map] PreviousTemporal';
|
|
|
|
export const SELECTTEMPORAL = '[Map] SelectTemporal';
|
2020-01-07 21:27:46 +00:00
|
|
|
export const ADDFEATURESUCCESS = '[Map] AddFeatureSuccess';
|
|
|
|
export const UPDATEFEATURESUCCESS = '[Map] UpdateFeatureSuccess';
|
|
|
|
export const EXPANDSEARCH = '[Map] ExpandSearch';
|
|
|
|
export const COLLAPSESEARCH = '[Map] CollapseSearch';
|
|
|
|
export const SETEXTENT = '[Map] SetExtent';
|
|
|
|
export const SETQUERYSTATE = '[Map] SetQueryState';
|
|
|
|
export const SETTIMESPAN = '[Map] SetTimeSpan';
|
|
|
|
export const ADDLAYER = '[Map] AddLayer';
|
|
|
|
export const SETVISIBILITY = '[Map] SetVisibility';
|
|
|
|
export const SETOPACITY = '[Map] SetOpacity';
|
|
|
|
export const SETLAYERINDEX = '[Map] SetLayerIndex';
|
|
|
|
export const REMOVELAYER = '[Map] RemoveLayer';
|
|
|
|
export const LOADBASELAYERS = '[Map] LoadLayers';
|
|
|
|
export const LOADBASELAYERSSUCCESS = '[Map] LoadLayersSuccess';
|
|
|
|
export const SELECTBASELAYER = '[Map] SelectBaseLayers';
|
|
|
|
export const SELECTOVERLAYLAYER = '[Map] SelectOverlayLayers';
|
|
|
|
export const ZOOMTOEXTENT = '[Map] ZoomToExtent';
|
|
|
|
export const DOQUERY = '[Map] DoQuery';
|
2020-02-12 19:38:14 +00:00
|
|
|
export const SETSTYLE = '[Map] SetStyle';
|
2020-02-17 17:31:23 +00:00
|
|
|
export const SHOWLAYERSWITCHER = '[Map] ShowLayerSwitcher';
|
2020-04-17 06:01:39 +00:00
|
|
|
export const CLEAR = '[Map] Clear';
|
2020-04-22 06:11:50 +00:00
|
|
|
export const SETREPLACEURL = '[Map] SetReplaceUrl';
|
2020-04-17 06:01:39 +00:00
|
|
|
|
|
|
|
export class Clear implements Action {
|
|
|
|
readonly type = CLEAR;
|
|
|
|
constructor() {}
|
|
|
|
}
|
2020-01-07 21:27:46 +00:00
|
|
|
|
|
|
|
export class SetState implements Action {
|
|
|
|
readonly type = SETSTATE;
|
|
|
|
|
|
|
|
constructor(public mapState: IMapState,public queryState:IQueryState) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetMapState implements Action {
|
|
|
|
readonly type = SETMAPSTATE;
|
|
|
|
|
|
|
|
constructor(public mapState: IMapState) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetViewExtent implements Action {
|
|
|
|
readonly type = SETVIEWEXTENT;
|
|
|
|
|
|
|
|
constructor(public extent:number[]) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Init implements Action {
|
|
|
|
readonly type = INIT;
|
|
|
|
|
|
|
|
constructor() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetParent implements Action {
|
|
|
|
readonly type = SETPARENT;
|
|
|
|
|
|
|
|
constructor(public parentCode:string) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class StartSearch implements Action {
|
|
|
|
readonly type = STARTSEARCH;
|
|
|
|
|
|
|
|
constructor(public queryState: IQueryState) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class StartSearchSuccess implements Action {
|
|
|
|
readonly type = STARTSEARCHSUCCESS;
|
|
|
|
|
|
|
|
constructor(public features: Array<Feature>, public query:IQueryState) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SelectFeature implements Action {
|
|
|
|
readonly type = SELECTFEATURE;
|
|
|
|
|
|
|
|
constructor(public feature:Feature) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SelectItem implements Action {
|
|
|
|
readonly type = SELECTITEM;
|
|
|
|
|
|
|
|
constructor(public itemCode:string) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SelectItemSuccess implements Action {
|
|
|
|
readonly type = SELECTITEMSUCCESS;
|
|
|
|
|
|
|
|
constructor(public item: IItem) { }
|
|
|
|
}
|
|
|
|
|
2020-02-27 16:59:00 +00:00
|
|
|
export class SelectTemporalItemsSuccess implements Action {
|
|
|
|
readonly type = SELECTTEMPORALITEMSSUCCESS;
|
|
|
|
|
2020-02-27 20:41:52 +00:00
|
|
|
constructor(public temporalItems: IItem[]) { }
|
2020-02-27 16:59:00 +00:00
|
|
|
}
|
|
|
|
|
2020-03-02 08:22:16 +00:00
|
|
|
export class NextTemporal implements Action {
|
|
|
|
readonly type = NEXTTEMPORAL;
|
|
|
|
|
|
|
|
constructor() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class PreviousTemporal implements Action {
|
|
|
|
readonly type = PREVIOUSTEMPORAL;
|
|
|
|
|
|
|
|
constructor() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SelectTemporal implements Action {
|
|
|
|
readonly type = SELECTTEMPORAL;
|
|
|
|
|
|
|
|
constructor(item:IItem) { }
|
|
|
|
}
|
|
|
|
|
2020-01-07 21:27:46 +00:00
|
|
|
export class AddFeatureSuccess implements Action {
|
|
|
|
readonly type = ADDFEATURESUCCESS;
|
|
|
|
|
|
|
|
constructor(public feature: Feature) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class UpdateFeatureSuccess implements Action {
|
|
|
|
readonly type = UPDATEFEATURESUCCESS;
|
|
|
|
|
|
|
|
constructor(public feature: Feature) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ExpandSearch implements Action {
|
|
|
|
readonly type = EXPANDSEARCH;
|
|
|
|
|
|
|
|
constructor() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class CollapseSearch implements Action {
|
|
|
|
readonly type = COLLAPSESEARCH;
|
|
|
|
|
|
|
|
constructor() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetExtent implements Action {
|
|
|
|
readonly type = SETEXTENT;
|
|
|
|
|
|
|
|
constructor(public extent:number[]) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetQueryState implements Action {
|
|
|
|
readonly type = SETQUERYSTATE;
|
|
|
|
|
2020-04-22 06:11:50 +00:00
|
|
|
constructor(public queryState: IQueryState,public replaceUrl:boolean = true) { }
|
2020-01-07 21:27:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class SetTimeSpan implements Action {
|
|
|
|
readonly type = SETTIMESPAN;
|
|
|
|
|
|
|
|
constructor(public startDate: Date, public endDate: Date) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class AddLayer implements Action {
|
|
|
|
readonly type = ADDLAYER;
|
|
|
|
|
|
|
|
constructor(public item:IItem,public layerIndex=-1) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetVisibility implements Action {
|
|
|
|
readonly type = SETVISIBILITY;
|
|
|
|
|
|
|
|
constructor(public itemLayer:IItemLayer,public visibility:boolean) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetOpacity implements Action {
|
|
|
|
readonly type = SETOPACITY;
|
|
|
|
|
|
|
|
constructor(public itemLayer: IItemLayer, public opacity: number) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SetLayerIndex implements Action {
|
|
|
|
readonly type = SETLAYERINDEX;
|
|
|
|
|
|
|
|
constructor(public layerIndex: number, public itemLayer: IItemLayer = null) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class RemoveLayer implements Action {
|
|
|
|
readonly type = REMOVELAYER;
|
|
|
|
|
|
|
|
constructor(public itemLayer: IItemLayer) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class LoadBaseLayers implements Action {
|
|
|
|
readonly type = LOADBASELAYERS;
|
|
|
|
|
|
|
|
constructor(public projection: string) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class LoadBaseLayersSuccess implements Action {
|
|
|
|
readonly type = LOADBASELAYERSSUCCESS;
|
|
|
|
|
|
|
|
constructor(public items: IItem[] ) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SelectBaseLayer implements Action {
|
|
|
|
readonly type = SELECTBASELAYER;
|
|
|
|
|
|
|
|
constructor(public itemLayer: IItemLayer) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SelectOverlayLayer implements Action {
|
|
|
|
readonly type = SELECTOVERLAYLAYER;
|
|
|
|
|
|
|
|
constructor(public itemLayer: IItemLayer) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ZoomToExtent implements Action {
|
|
|
|
readonly type = ZOOMTOEXTENT;
|
|
|
|
|
|
|
|
constructor(public itemLayer: IItemLayer) { }
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DoQuery implements Action {
|
|
|
|
readonly type = DOQUERY;
|
|
|
|
|
|
|
|
constructor(public query:IQueryState) { }
|
|
|
|
}
|
|
|
|
|
2020-02-12 19:38:14 +00:00
|
|
|
export class SetStyle implements Action {
|
|
|
|
readonly type = SETSTYLE;
|
|
|
|
|
2020-02-13 15:01:05 +00:00
|
|
|
constructor(public itemType:string,public style: Style | (Feature)) { }
|
2020-02-12 19:38:14 +00:00
|
|
|
}
|
|
|
|
|
2020-02-17 17:31:23 +00:00
|
|
|
export class ShowLayerSwitcher implements Action {
|
|
|
|
readonly type = SHOWLAYERSWITCHER;
|
|
|
|
constructor(public show:boolean) {}
|
|
|
|
}
|
|
|
|
|
2020-04-22 06:11:50 +00:00
|
|
|
export class SetReplaceUrl implements Action {
|
|
|
|
readonly type = SETREPLACEURL;
|
|
|
|
constructor(public replaceUrl:boolean) {}
|
|
|
|
}
|
|
|
|
|
2020-01-07 21:27:46 +00:00
|
|
|
export type Actions = SetMapState
|
|
|
|
| Init
|
2020-04-17 06:01:39 +00:00
|
|
|
| Clear
|
2020-01-07 21:27:46 +00:00
|
|
|
| SetParent
|
|
|
|
| StartSearch
|
|
|
|
| StartSearchSuccess
|
|
|
|
| SelectFeature
|
|
|
|
| SelectItem
|
|
|
|
| SelectItemSuccess
|
2020-02-27 16:59:00 +00:00
|
|
|
| SelectTemporalItemsSuccess
|
2020-03-02 08:22:16 +00:00
|
|
|
| NextTemporal
|
|
|
|
| PreviousTemporal
|
|
|
|
| SelectTemporal
|
2020-01-07 21:27:46 +00:00
|
|
|
| AddFeatureSuccess
|
|
|
|
| UpdateFeatureSuccess
|
|
|
|
| ExpandSearch
|
|
|
|
| CollapseSearch
|
|
|
|
| SetExtent
|
|
|
|
| SetQueryState
|
|
|
|
| SetTimeSpan
|
|
|
|
| AddLayer
|
|
|
|
| RemoveLayer
|
|
|
|
| SetVisibility
|
|
|
|
| SetOpacity
|
|
|
|
| SetLayerIndex
|
|
|
|
| LoadBaseLayers
|
|
|
|
| LoadBaseLayersSuccess
|
|
|
|
| SelectBaseLayer
|
|
|
|
| SelectOverlayLayer
|
|
|
|
| ZoomToExtent
|
|
|
|
| SetState
|
|
|
|
| SetViewExtent
|
2020-02-12 19:38:14 +00:00
|
|
|
| DoQuery
|
2020-02-17 17:31:23 +00:00
|
|
|
| SetStyle
|
2020-04-22 06:11:50 +00:00
|
|
|
| ShowLayerSwitcher
|
|
|
|
| SetReplaceUrl;
|
2020-01-07 21:27:46 +00:00
|
|
|
|