2022-04-28 11:48:04 +02:00
/ * *
* The data layer shows all the given geojson elements with the appropriate icon etc
* /
2022-04-30 00:41:33 +02:00
import { ShowDataLayerOptions } from "./ShowDataLayerOptions"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
2021-01-04 04:06:21 +01:00
2022-04-30 00:41:33 +02:00
export default class ShowDataLayer {
public static actualContstructor : (
options : ShowDataLayerOptions & { layerToShow : LayerConfig }
) = > void = undefined
2022-01-26 21:40:38 +01:00
2022-03-02 16:00:02 +01:00
/ * *
* Creates a datalayer .
2022-04-28 11:48:04 +02:00
*
2022-03-02 16:00:02 +01:00
* If 'createPopup' is set , this function is called every time that 'popupOpen' is called
* @param options
* /
2022-04-28 11:48:04 +02:00
constructor ( options : ShowDataLayerOptions & { layerToShow : LayerConfig } ) {
2022-04-30 00:41:33 +02:00
if ( ShowDataLayer . actualContstructor === undefined ) {
2022-12-24 03:44:21 +01:00
console . error (
"Show data layer is called, but it isn't initialized yet. Call ` ShowDataLayer.actualContstructor = (options => new ShowDataLayerImplementation(options)) ` somewhere, e.g. in your init"
)
return
2022-04-28 11:48:04 +02:00
}
2022-04-30 00:41:33 +02:00
ShowDataLayer . actualContstructor ( options )
2022-04-28 11:48:04 +02:00
}
2021-01-04 04:06:21 +01:00
}