FarmMapsLib/projects/common-map/src/fm-map/models/item.layer.ts

52 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-02-27 15:28:10 +00:00
import { IItem,IListItem } from '@farmmaps/common';
import {Layer} from 'ol/layer';
2021-10-05 11:46:10 +00:00
import { Source } from 'ol/source';
2020-02-27 15:28:10 +00:00
export interface IItemLayer {
item: IItem,
2021-10-05 11:46:10 +00:00
layer: Layer<Source>,
2020-02-27 15:28:10 +00:00
visible: boolean,
legendVisible:boolean,
projection: string,
opacity: number,
layerIndex:number
}
export class ItemLayer implements IItemLayer {
public item: IItem;
2021-10-05 11:46:10 +00:00
public layer: Layer<Source> = null;
2023-03-06 13:04:14 +00:00
public visible = true;
public legendVisible = false;
2020-02-27 15:28:10 +00:00
public projection: string;
2023-03-06 13:04:14 +00:00
public opacity = 1;
public layerIndex = -1;
2020-02-27 15:28:10 +00:00
2023-03-06 13:04:14 +00:00
constructor(item:IItem,opacity = 1, visible = true,layerIndex=-1) {
2020-02-27 15:28:10 +00:00
this.item = item;
2020-03-02 12:48:10 +00:00
this.opacity = opacity;
this.visible = visible;
2020-03-03 18:24:01 +00:00
this.layerIndex = layerIndex;
2020-02-27 15:28:10 +00:00
}
}
export interface ITemporalItemLayer extends IItemLayer {
2020-03-02 07:55:11 +00:00
previousItemLayer: IItemLayer,
selectedItemLayer: IItemLayer,
nextItemLayer: IItemLayer,
2020-02-27 20:41:52 +00:00
temporalItems: IItem[],
2020-02-27 15:28:10 +00:00
}
export class TemporalItemLayer extends ItemLayer implements ITemporalItemLayer {
2020-03-02 07:55:11 +00:00
public previousItemLayer:IItemLayer = null;
public selectedItemLayer:IItemLayer =null;
public nextItemLayer:IItemLayer = null;
2020-02-27 20:41:52 +00:00
public temporalItems:IItem[] = [];
2020-02-27 15:28:10 +00:00
2023-03-06 13:04:14 +00:00
constructor(item:IItem,opacity = 1, visible = true) {
2020-03-02 12:48:10 +00:00
super(item,opacity,visible)
2020-02-27 15:28:10 +00:00
}
}