mapcomplete/UI/Map/ShowDataLayerOptions.ts

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

39 lines
1.1 KiB
TypeScript
Raw Normal View History

import { FeatureSource } from "../../Logic/FeatureSource/FeatureSource"
import { Store, UIEventSource } from "../../Logic/UIEventSource"
2023-03-28 05:13:48 +02:00
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import { Feature } from "geojson"
export interface ShowDataLayerOptions {
/**
* Features to show
*/
features: FeatureSource
/**
* Indication of the current selected element; overrides some filters.
* When a feature is tapped, the feature will be put in there
*/
2023-03-28 05:13:48 +02:00
selectedElement?: UIEventSource<Feature>
/**
* When a feature of this layer is tapped, the layer will be marked
*/
selectedLayer?: UIEventSource<LayerConfig>
/**
* If set, zoom to the features when initially loaded and when they are changed
*/
zoomToFeatures?: false | boolean
/**
* Toggles the layer on/off
*/
doShowLayer?: Store<true | boolean>
/**
* Function which fetches the relevant store.
* If given, the map will update when a property is changed
*/
2023-03-28 05:13:48 +02:00
fetchStore?: (id: string) => Store<Record<string, string>>
onClick?: (feature: Feature) => void
}