2021-01-03 00:19:42 +01:00
|
|
|
import {UIEventSource} from "../UIEventSource";
|
2021-07-16 01:42:09 +02:00
|
|
|
import {Utils} from "../../Utils";
|
2021-09-21 02:10:42 +02:00
|
|
|
import FilteredLayer from "../../Models/FilteredLayer";
|
|
|
|
import {BBox} from "../GeoOperations";
|
2021-01-03 00:19:42 +01:00
|
|
|
|
|
|
|
export default interface FeatureSource {
|
2021-07-16 01:42:09 +02:00
|
|
|
features: UIEventSource<{ feature: any, freshness: Date }[]>;
|
2021-04-23 12:55:38 +02:00
|
|
|
/**
|
|
|
|
* Mainly used for debuging
|
|
|
|
*/
|
|
|
|
name: string;
|
2021-07-16 01:42:09 +02:00
|
|
|
}
|
|
|
|
|
2021-09-21 02:10:42 +02:00
|
|
|
export interface Tiled {
|
|
|
|
tileIndex: number,
|
|
|
|
bbox: BBox
|
|
|
|
}
|
2021-09-09 00:05:51 +02:00
|
|
|
|
2021-09-21 02:10:42 +02:00
|
|
|
/**
|
|
|
|
* A feature source which only contains features for the defined layer
|
|
|
|
*/
|
|
|
|
export interface FeatureSourceForLayer extends FeatureSource{
|
|
|
|
readonly layer: FilteredLayer
|
|
|
|
}
|
2021-07-16 01:42:09 +02:00
|
|
|
|
2021-09-21 02:10:42 +02:00
|
|
|
/**
|
|
|
|
* A feature source which is aware of the indexes it contains
|
|
|
|
*/
|
|
|
|
export interface IndexedFeatureSource extends FeatureSource {
|
|
|
|
readonly containedIds: UIEventSource<Set<string>>
|
|
|
|
}
|
2021-07-16 01:42:09 +02:00
|
|
|
|
2021-09-21 02:10:42 +02:00
|
|
|
/**
|
|
|
|
* A feature source which has some extra data about it's state
|
|
|
|
*/
|
|
|
|
export interface FeatureSourceState {
|
|
|
|
readonly sufficientlyZoomed: UIEventSource<boolean>;
|
|
|
|
readonly runningQuery: UIEventSource<boolean>;
|
|
|
|
readonly timeout: UIEventSource<number>;
|
|
|
|
}
|