mapcomplete/Logic/FeatureSource/Sources/SimpleFeatureSource.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
566 B
TypeScript
Raw Normal View History

import { UIEventSource } from "../../UIEventSource"
import FilteredLayer from "../../../Models/FilteredLayer"
2023-03-29 17:21:20 +02:00
import { FeatureSourceForLayer } from "../FeatureSource"
import { Feature } from "geojson"
export default class SimpleFeatureSource implements FeatureSourceForLayer {
public readonly features: UIEventSource<Feature[]>
public readonly layer: FilteredLayer
constructor(layer: FilteredLayer, featureSource?: UIEventSource<Feature[]>) {
this.layer = layer
this.features = featureSource ?? new UIEventSource<Feature[]>([])
}
}