From d41c210b05564ab32a741db60f3e956d82f35287 Mon Sep 17 00:00:00 2001 From: Pascal Barth Date: Tue, 21 Jan 2025 13:39:30 +0100 Subject: [PATCH] [POC] fix MapLibre ready event --- .../openlayers/utils/ol-maplibre-layer/MapLibreLayer.ts | 4 ++++ .../utils/ol-maplibre-layer/MapLibreLayerRenderer.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayer.ts b/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayer.ts index 5f98470c9a..de80b17fff 100644 --- a/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayer.ts +++ b/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayer.ts @@ -101,6 +101,10 @@ export default class MapLibreLayer extends Layer { this.mapLibreMap.once('load', () => { this.loaded = true; + const renderer = this.getRenderer(); + if (renderer) { + renderer.ready = true + } this.dispatchEvent(new BaseEvent('load')); }); } diff --git a/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayerRenderer.ts b/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayerRenderer.ts index 0daaaee570..c94e2a38f7 100644 --- a/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayerRenderer.ts +++ b/src/modules/map/components/openlayers/utils/ol-maplibre-layer/MapLibreLayerRenderer.ts @@ -32,6 +32,7 @@ export default class MapLibreLayerRenderer extends LayerRenderer constructor(layer: MapLibreLayer, translateZoom: Function | undefined) { super(layer) this.translateZoom = translateZoom + this.ready = false } getFeaturesAtCoordinate(