beginning of map layer control

This commit is contained in:
vcoppe
2024-04-11 17:18:21 +02:00
parent b5a9fa3218
commit 75ef69ab42
14 changed files with 356 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
import { type Map, type IControl } from 'mapbox-gl';
export default class CustomControl implements IControl {
_map: Map | undefined;
_container: HTMLElement;
constructor(container: HTMLElement) {
this._container = container;
}
onAdd(map: Map): HTMLElement {
this._map = map;
return this._container;
}
onRemove() {
this._container?.parentNode?.removeChild(this._container);
this._map = undefined;
}
}