This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 05a9588cfa fix: Initialize leaflet upon startup
05a9588cfa is described below

commit 05a9588cfa6ff511b8c8ac3a6466bc2876b7a751
Author: Dominik Riemer <[email protected]>
AuthorDate: Thu Dec 11 09:54:25 2025 +0100

    fix: Initialize leaflet upon startup
---
 ui/src/app/core-ui/services/map-layer-provider.service.ts | 6 +++---
 ui/src/main.ts                                            | 3 +++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ui/src/app/core-ui/services/map-layer-provider.service.ts 
b/ui/src/app/core-ui/services/map-layer-provider.service.ts
index 1896a5975a..ec5b7f86ee 100644
--- a/ui/src/app/core-ui/services/map-layer-provider.service.ts
+++ b/ui/src/app/core-ui/services/map-layer-provider.service.ts
@@ -18,8 +18,7 @@
 
 import { Injectable } from '@angular/core';
 import { LocationConfig } from '@streampipes/platform-services';
-import * as L from 'leaflet';
-import '@maplibre/maplibre-gl-leaflet';
+import L from 'leaflet';
 
 @Injectable({ providedIn: 'root' })
 export class MapLayerProviderService {
@@ -33,8 +32,9 @@ export class MapLayerProviderService {
                     }),
                 ];
             } else {
+                const leafletAny = L as any;
                 return [
-                    (L as any).maplibreGL({
+                    leafletAny.maplibreGL({
                         style: locationConfig.tileServerUrl,
                         attribution: locationConfig.attributionText,
                     }),
diff --git a/ui/src/main.ts b/ui/src/main.ts
index a09a1c0cab..53eca4d70e 100644
--- a/ui/src/main.ts
+++ b/ui/src/main.ts
@@ -18,6 +18,9 @@
 
 import { AppModule } from './app/app.module';
 import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+// needed so that maplibre attaches to leaflet upon startup
+import 'leaflet';
+import '@maplibre/maplibre-gl-leaflet';
 
 platformBrowserDynamic()
     .bootstrapModule(AppModule)

Reply via email to