2023-03-28 05:13:48 +02:00
|
|
|
import { Store, UIEventSource } from "../UIEventSource"
|
2021-09-21 02:10:42 +02:00
|
|
|
import FilteredLayer from "../../Models/FilteredLayer"
|
2023-03-23 01:42:47 +01:00
|
|
|
import { Feature } from "geojson"
|
2021-01-03 00:19:42 +01:00
|
|
|
|
2023-04-20 18:58:31 +02:00
|
|
|
export interface FeatureSource<T extends Feature = Feature> {
|
|
|
|
features: Store<T[]>
|
2021-07-16 01:42:09 +02:00
|
|
|
}
|
2023-04-20 18:58:31 +02:00
|
|
|
export interface WritableFeatureSource<T extends Feature = Feature> extends FeatureSource<T> {
|
|
|
|
features: UIEventSource<T[]>
|
2023-03-28 05:13:48 +02:00
|
|
|
}
|
2021-07-16 01:42:09 +02:00
|
|
|
|
2021-09-21 02:10:42 +02:00
|
|
|
/**
|
|
|
|
* A feature source which only contains features for the defined layer
|
|
|
|
*/
|
2023-05-05 01:25:12 +02:00
|
|
|
export interface FeatureSourceForLayer<T extends Feature = Feature> extends FeatureSource<T> {
|
2021-09-21 02:10:42 +02:00
|
|
|
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 {
|
2023-03-26 05:58:28 +02:00
|
|
|
readonly featuresById: Store<Map<string, Feature>>
|
2021-09-21 02:10:42 +02:00
|
|
|
}
|