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

50 lines
1.1 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';
export interface IItemLayer {
item: IItem,
layer: Layer,
visible: boolean,
legendVisible:boolean,
projection: string,
opacity: number,
layerIndex:number
}
export class ItemLayer implements IItemLayer {
public item: IItem;
public layer: Layer = null;
public visible: boolean = true;
public legendVisible: boolean = false;
public projection: string;
public opacity: number = 1;
public layerIndex: number = -1;
constructor(item:IItem) {
this.item = item;
}
}
export interface ITemporalItemLayer extends IItemLayer {
previousLayer: Layer
selectedLayer: Layer,
nextLayer: Layer
temporalItems: IListItem[],
selectedItem: IListItem
}
export class TemporalItemLayer extends ItemLayer implements ITemporalItemLayer {
public previousLayer:Layer = null;
public selectedLayer:Layer = null;
public nextLayer:Layer = null;
public temporalItems:IListItem[] = [];
public selectedItem:IListItem =null;
constructor(item:IItem) {
super(item)
}
}