mapcomplete/UI/ShowDataLayer/ShowOverlayLayer.ts

19 lines
808 B
TypeScript
Raw Normal View History

import TilesourceConfig from "../../Models/ThemeConfig/TilesourceConfig";
import {UIEventSource} from "../../Logic/UIEventSource";
import * as L from "leaflet";
export default class ShowOverlayLayer {
2021-10-15 14:52:11 +02:00
public static implementation: (config: TilesourceConfig,
leafletMap: UIEventSource<any>,
isShown?: UIEventSource<boolean>) => void;
constructor(config: TilesourceConfig,
leafletMap: UIEventSource<any>,
isShown: UIEventSource<boolean> = undefined) {
2021-10-15 14:52:11 +02:00
if(ShowOverlayLayer.implementation === undefined){
throw "Call ShowOverlayLayerImplemenation.initialize() first before using this"
}
ShowOverlayLayer.implementation(config, leafletMap, isShown)
}
}