2021-09-21 02:10:42 +02:00
|
|
|
import { UIEventSource } from "../../UIEventSource"
|
|
|
|
import FilteredLayer from "../../../Models/FilteredLayer"
|
2023-03-29 17:21:20 +02:00
|
|
|
import { FeatureSourceForLayer } from "../FeatureSource"
|
2023-03-23 01:42:47 +01:00
|
|
|
import { Feature } from "geojson"
|
2021-09-20 17:14:55 +02:00
|
|
|
|
2023-03-26 05:58:28 +02:00
|
|
|
export default class SimpleFeatureSource implements FeatureSourceForLayer {
|
2023-03-23 01:42:47 +01:00
|
|
|
public readonly features: UIEventSource<Feature[]>
|
2021-09-20 17:14:55 +02:00
|
|
|
public readonly layer: FilteredLayer
|
|
|
|
|
2023-03-26 05:58:28 +02:00
|
|
|
constructor(layer: FilteredLayer, featureSource?: UIEventSource<Feature[]>) {
|
2021-09-20 17:14:55 +02:00
|
|
|
this.layer = layer
|
2023-03-23 01:42:47 +01:00
|
|
|
this.features = featureSource ?? new UIEventSource<Feature[]>([])
|
2021-09-20 17:14:55 +02:00
|
|
|
}
|
|
|
|
}
|