2023-04-06 01:33:08 +02:00
|
|
|
import { FeatureSource } from "../../Logic/FeatureSource/FeatureSource"
|
2022-06-05 02:24:14 +02:00
|
|
|
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
2023-03-28 05:13:48 +02:00
|
|
|
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
|
|
|
import { Feature } from "geojson"
|
2021-09-21 02:10:42 +02:00
|
|
|
|
|
|
|
export interface ShowDataLayerOptions {
|
2023-03-23 00:58:21 +01:00
|
|
|
/**
|
|
|
|
* Features to show
|
|
|
|
*/
|
2021-09-21 02:10:42 +02:00
|
|
|
features: FeatureSource
|
2023-03-23 00:58:21 +01:00
|
|
|
/**
|
2023-03-26 05:58:28 +02:00
|
|
|
* Indication of the current selected element; overrides some filters.
|
|
|
|
* When a feature is tapped, the feature will be put in there
|
2023-03-23 00:58:21 +01:00
|
|
|
*/
|
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>
|
2023-03-23 00:58:21 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If set, zoom to the features when initially loaded and when they are changed
|
|
|
|
*/
|
2021-09-21 02:10:42 +02:00
|
|
|
zoomToFeatures?: false | boolean
|
2023-03-23 00:58:21 +01:00
|
|
|
/**
|
|
|
|
* Toggles the layer on/off
|
|
|
|
*/
|
|
|
|
doShowLayer?: Store<true | boolean>
|
|
|
|
|
|
|
|
/**
|
2023-03-26 05:58:28 +02:00
|
|
|
* Function which fetches the relevant store.
|
|
|
|
* If given, the map will update when a property is changed
|
2023-03-23 00:58:21 +01:00
|
|
|
*/
|
2023-03-28 05:13:48 +02:00
|
|
|
fetchStore?: (id: string) => Store<Record<string, string>>
|
2023-04-02 02:59:20 +02:00
|
|
|
|
|
|
|
onClick?: (feature: Feature) => void
|
2021-09-21 02:10:42 +02:00
|
|
|
}
|