2022-06-05 02:24:14 +02:00
|
|
|
import { Store, UIEventSource } from "../UIEventSource"
|
2021-09-21 02:10:42 +02:00
|
|
|
import FilteredLayer from "../../Models/FilteredLayer"
|
2021-09-28 17:30:48 +02:00
|
|
|
import { BBox } from "../BBox"
|
2022-07-13 17:56:10 +02:00
|
|
|
import { Feature, Geometry } from "@turf/turf"
|
|
|
|
import { OsmFeature } from "../../Models/OsmFeature"
|
2021-01-03 00:19:42 +01:00
|
|
|
|
|
|
|
export default interface FeatureSource {
|
2022-07-13 17:56:10 +02:00
|
|
|
features: Store<{ feature: OsmFeature; 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
|
|
|
|
*/
|
2021-11-07 16:34:51 +01:00
|
|
|
export interface FeatureSourceForLayer extends FeatureSource {
|
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 {
|
2022-06-05 02:24:14 +02:00
|
|
|
readonly containedIds: Store<Set<string>>
|
2021-09-21 02:10:42 +02:00
|
|
|
}
|