This commit is contained in:
vcoppe committed 2025-10-23 18:58:33 +02:00
1 parent bde7e3e8aa
commit aa624e2c60
7 files changed
+4 -6

No files matched your search

@@ -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;
}
}