From 736ce11c7275b0691165d6532f4e6cb001b98dde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:52:48 +0000 Subject: [PATCH 1/3] chore(deps): bump maplibre-gl Bumps the maplibre-stack group with 1 update in the / directory: [maplibre-gl](https://github.com/maplibre/maplibre-gl-js). Updates `maplibre-gl` from 5.24.0 to 6.1.0 - [Release notes](https://github.com/maplibre/maplibre-gl-js/releases) - [Changelog](https://github.com/maplibre/maplibre-gl-js/blob/main/CHANGELOG.md) - [Commits](https://github.com/maplibre/maplibre-gl-js/compare/v5.24.0...v6.1.0) --- updated-dependencies: - dependency-name: maplibre-gl dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: maplibre-stack ... Signed-off-by: dependabot[bot] --- apps/web/package.json | 2 +- packages/integration-framework/package.json | 2 +- pnpm-lock.yaml | 107 ++++++++------------ 3 files changed, 42 insertions(+), 69 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index 8c3224c1c..a462725a8 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -55,7 +55,7 @@ "better-auth": "^1.6.18", "emoji-mart": "^5.6.0", "hls.js": "^1.6.16", - "maplibre-gl": "^5.24.0", + "maplibre-gl": "^6.1.0", "maplibre-theme": "^1.0.0", "next": "^16.2.9", "next-intl": "^4.13.0", diff --git a/packages/integration-framework/package.json b/packages/integration-framework/package.json index 6b46cfb25..6d4920ab1 100644 --- a/packages/integration-framework/package.json +++ b/packages/integration-framework/package.json @@ -63,7 +63,7 @@ "@types/node": "^24.13.2", "@types/react": "^19.2.17", "esbuild": "^0.28.0", - "maplibre-gl": "^5.24.0", + "maplibre-gl": "^6.1.0", "react": "19.2.8", "typescript": "^6.0.3", "vitest": "^4.1.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01bc15711..af2b59583 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -310,8 +310,8 @@ importers: specifier: ^1.6.16 version: 1.6.16 maplibre-gl: - specifier: ^5.24.0 - version: 5.24.0 + specifier: ^6.1.0 + version: 6.1.0 maplibre-theme: specifier: ^1.0.0 version: 1.0.0 @@ -1957,8 +1957,8 @@ importers: specifier: '>=0.28.1' version: 0.28.1 maplibre-gl: - specifier: ^5.24.0 - version: 5.24.0 + specifier: ^6.1.0 + version: 6.1.0 react: specifier: 19.2.7 version: 19.2.7 @@ -3361,9 +3361,9 @@ packages: '@mapbox/glyph-pbf-composite@0.0.3': resolution: {integrity: sha512-VcsYpDcFDuly8P4sbqBpFKpTrNsOqyvCkuAsoaQrQv9Y4cQnwrwdWgY3zBXJdS6OgukWfVaRwcUE6dwrDC0URA==} - '@mapbox/jsonlint-lines-primitives@2.0.2': - resolution: {integrity: sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==} - engines: {node: '>= 0.6'} + '@mapbox/jsonlint-lines-primitives@2.0.3': + resolution: {integrity: sha512-0SElaV0uMxEnxzBhhX9WTuPyUeMsAN/SS0i16tjuba4/mio63MG9khjC1a0JAiPGXAwvwm4UfHJURCN7nyudQg==} + engines: {node: '>= 22'} '@mapbox/maki@8.2.0': resolution: {integrity: sha512-sTd/fEBfkBSidVwwtbijHZYJC7NhqvgLrXzSRHgxbLi52x4IciyTVUufqvJr8oIChw7hT7MIBHu5fyqrrpfFdA==} @@ -3374,28 +3374,21 @@ packages: '@mapbox/tiny-sdf@2.2.0': resolution: {integrity: sha512-LVL4wgI9YAum5V+LNVQO6QgFBPw7/MIIY4XJPNsPDMrjEwcE+JfKk1LuIl8GnF197ejVdC9QdPaxrx5gfgdGXg==} - '@mapbox/unitbezier@0.0.1': - resolution: {integrity: sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==} - '@mapbox/unitbezier@1.0.0': resolution: {integrity: sha512-fqd515fjBmANKGGsQ286E2Wvj/XvDFpGzwJxq4CI6jMQue6Oy04uCKp+JWKF00xRTmk6cEu1jPJ9p3xqH8YWqQ==} - '@mapbox/vector-tile@2.0.5': - resolution: {integrity: sha512-pXj8m7KTsqZt+1jsE0xIpGvqTSbblfkuEJL/NJmNePMtEwxO8V3XMDo9WMSfDeqHvCtBI9Lmt4mGcGR10zecmw==} - - '@mapbox/whoots-js@3.1.0': - resolution: {integrity: sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==} - engines: {node: '>=6.0.0'} + '@mapbox/vector-tile@3.0.0': + resolution: {integrity: sha512-Qf10S1uIHMk20ri/IVBnpS+esUEkVaR5Hftmz88jTInrpmWgPGJfPe3LVjjlE77trLx8tH6qjTG7uWH9hIq/0Q==} - '@maplibre/geojson-vt@6.1.0': - resolution: {integrity: sha512-2eIY4gZxeKIVOZVNkAMb+5NgXhgsMQpOveTQAvnp53LYqHGJZDidk7Ew0Tged9PThidpbS+NFTh0g4zivhPDzQ==} + '@maplibre/geojson-vt@6.1.1': + resolution: {integrity: sha512-FVMOcmSP/yqol45t7StApEyTL5/vmqBCuFhH9n+fFuINenhaX+YgHHIt1yJ86S8kln3uJLcMvmEU2cfn6E2eCQ==} - '@maplibre/maplibre-gl-style-spec@24.10.0': - resolution: {integrity: sha512-lichxSiagMEBBrqHF0trtMQH9RKh+9jUlIJl0qW0QHvt2H/tbvUWdE+ZzI2Jd0/pT7j/iavLonlPu7EQ/ixTOw==} + '@maplibre/maplibre-gl-style-spec@26.2.1': + resolution: {integrity: sha512-QFKCXkOeSzOr8jF75jm6kySOg+dUvOehPhRi68gcOYPHb7U5JloUq0dJW0Y5/fZV8ygfT0Vp2RWodvq+fyxFWA==} hasBin: true - '@maplibre/mlt@1.1.11': - resolution: {integrity: sha512-dKvjKdITw9d0y3ndGkSqLUEpWCizMtdq8NB06cHohH/JZ2sJoM7dClR9wzJLUWykjbw9RXDFmhjjNBnNW27mzw==} + '@maplibre/mlt@1.1.12': + resolution: {integrity: sha512-ZeK5w2TTeHOajcLaEQs1KZXw2V9wIKo1PmThlxlsHoXsQsYlBqLJzPOd6tJHRtGTChUY3DPPmjXRArYVvAbmZw==} '@maplibre/vt-pbf@4.3.2': resolution: {integrity: sha512-j6p0AdjvAR19Z3XaCysle7A4ZSo08tYOzxD0Y9NQylwPAkwJJeYub5b2eVucdeDh7erhv69DahoLOevDRERRUw==} @@ -5579,8 +5572,8 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} - earcut@3.0.2: - resolution: {integrity: sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==} + earcut@3.2.3: + resolution: {integrity: sha512-vnS4AVwp1KHAF13i1vp1/2D5evWy3k5u/iW/B81QVsUZtV8cv2tU0b2VNFlqvh4kYwrFMDdjPCfAmfyJW9y14Q==} eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -6523,8 +6516,8 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} - maplibre-gl@5.24.0: - resolution: {integrity: sha512-ALyFxgtd5R+65UqZ/++lOqwWcC0SNho9c27fYSyLmG7AfnAul2o46F05aDJGPbFU57wos9dgcIySHs0Xe6ia3A==} + maplibre-gl@6.1.0: + resolution: {integrity: sha512-vLRukjvbUai4SXW2/jKo8rPsw6YMXuA/b4fKFVSulZKFVRHkOvk4ZmNlDSVZpTYPV0/7/iTqq8ltYdyr764b7w==} engines: {node: '>=16.14.0', npm: '>=8.1.0'} maplibre-theme@1.0.0: @@ -6839,12 +6832,8 @@ packages: resolution: {integrity: sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==} hasBin: true - pbf@4.0.2: - resolution: {integrity: sha512-J0ajxARhZfpUEebxYs1vhMGMuLSXtBe1e+fFPDrf2uA2hgo+UshKfNUWOz92HJNz6/NFEXseQPddnHkTreWRqg==} - hasBin: true - - pbf@5.1.0: - resolution: {integrity: sha512-Wv0yo0+uZepnoNEKsquhar1F18LogB8oeEikIhUXG16udbiXG7JecHGySwoo6kuMgjmbQYzdrTZlO+/K9t8eZg==} + pbf@5.1.2: + resolution: {integrity: sha512-mnvGdvOrIvJOBGUEdGkrVXjN8E/VkIJCkf2eS1DH2yv82ORUlLttmDt0rWY38yYZmVwciZwBUvHM20qxBZf40w==} hasBin: true perfect-debounce@2.1.0: @@ -7750,10 +7739,6 @@ packages: undici-types@7.24.6: resolution: {integrity: sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==} - undici@7.28.0: - resolution: {integrity: sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==} - engines: {node: '>=20.18.1'} - undici@7.29.0: resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==} engines: {node: '>=20.18.1'} @@ -9146,7 +9131,7 @@ snapshots: dependencies: protocol-buffers: 2.7.0 - '@mapbox/jsonlint-lines-primitives@2.0.2': {} + '@mapbox/jsonlint-lines-primitives@2.0.3': {} '@mapbox/maki@8.2.0': {} @@ -9154,32 +9139,28 @@ snapshots: '@mapbox/tiny-sdf@2.2.0': {} - '@mapbox/unitbezier@0.0.1': {} - '@mapbox/unitbezier@1.0.0': {} - '@mapbox/vector-tile@2.0.5': + '@mapbox/vector-tile@3.0.0': dependencies: '@mapbox/point-geometry': 1.1.0 '@types/geojson': 7946.0.16 - pbf: 4.0.2 - - '@mapbox/whoots-js@3.1.0': {} + pbf: 5.1.2 - '@maplibre/geojson-vt@6.1.0': + '@maplibre/geojson-vt@6.1.1': dependencies: kdbush: 4.1.0 - '@maplibre/maplibre-gl-style-spec@24.10.0': + '@maplibre/maplibre-gl-style-spec@26.2.1': dependencies: - '@mapbox/jsonlint-lines-primitives': 2.0.2 + '@mapbox/jsonlint-lines-primitives': 2.0.3 '@mapbox/unitbezier': 1.0.0 json-stringify-pretty-compact: 4.0.0 minimist: 1.2.8 quickselect: 3.0.0 tinyqueue: 3.0.0 - '@maplibre/mlt@1.1.11': + '@maplibre/mlt@1.1.12': dependencies: '@mapbox/point-geometry': 1.1.0 @@ -9187,7 +9168,7 @@ snapshots: dependencies: '@mapbox/point-geometry': 1.1.0 '@types/geojson': 7946.0.16 - pbf: 5.1.0 + pbf: 5.1.2 '@microsoft/api-extractor-model@7.33.10(@types/node@24.13.2)': dependencies: @@ -11220,7 +11201,7 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 - earcut@3.0.2: {} + earcut@3.2.3: {} eastasianwidth@0.2.0: {} @@ -11888,7 +11869,7 @@ snapshots: saxes: 6.0.0 symbol-tree: 3.2.4 tough-cookie: 6.0.2 - undici: 7.28.0 + undici: 7.29.0 w3c-xmlserializer: 5.0.0 webidl-conversions: 8.0.1 whatwg-mimetype: 5.0.0 @@ -12097,24 +12078,22 @@ snapshots: dependencies: semver: 7.8.5 - maplibre-gl@5.24.0: + maplibre-gl@6.1.0: dependencies: - '@mapbox/jsonlint-lines-primitives': 2.0.2 '@mapbox/point-geometry': 1.1.0 '@mapbox/tiny-sdf': 2.2.0 - '@mapbox/unitbezier': 0.0.1 - '@mapbox/vector-tile': 2.0.5 - '@mapbox/whoots-js': 3.1.0 - '@maplibre/geojson-vt': 6.1.0 - '@maplibre/maplibre-gl-style-spec': 24.10.0 - '@maplibre/mlt': 1.1.11 + '@mapbox/unitbezier': 1.0.0 + '@mapbox/vector-tile': 3.0.0 + '@maplibre/geojson-vt': 6.1.1 + '@maplibre/maplibre-gl-style-spec': 26.2.1 + '@maplibre/mlt': 1.1.12 '@maplibre/vt-pbf': 4.3.2 '@types/geojson': 7946.0.16 - earcut: 3.0.2 + earcut: 3.2.3 gl-matrix: 3.4.4 kdbush: 4.1.0 murmurhash-js: 1.0.0 - pbf: 4.0.2 + pbf: 5.1.2 potpack: 2.1.0 quickselect: 3.0.0 tinyqueue: 3.0.0 @@ -12391,11 +12370,7 @@ snapshots: ieee754: 1.2.1 resolve-protobuf-schema: 2.1.0 - pbf@4.0.2: - dependencies: - resolve-protobuf-schema: 2.1.0 - - pbf@5.1.0: + pbf@5.1.2: dependencies: resolve-protobuf-schema: 2.1.0 @@ -13384,8 +13359,6 @@ snapshots: undici-types@7.24.6: {} - undici@7.28.0: {} - undici@7.29.0: {} undici@8.7.0: {} From 14c665c3f5492c2bd89b29a311963cc7db3f9877 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 4 Aug 2026 02:59:20 +0200 Subject: [PATCH 2/3] fix(deps): adapt integration types to MapLibre 6 --- integrations/overlay-3d-buildings/building-style.ts | 2 +- integrations/road-conditions/visual-style.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/overlay-3d-buildings/building-style.ts b/integrations/overlay-3d-buildings/building-style.ts index 0e43a9784..0cd0a9df7 100644 --- a/integrations/overlay-3d-buildings/building-style.ts +++ b/integrations/overlay-3d-buildings/building-style.ts @@ -1,4 +1,4 @@ -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; export interface BuildingSourceReference { source: string; diff --git a/integrations/road-conditions/visual-style.ts b/integrations/road-conditions/visual-style.ts index 573d62f19..51f496965 100644 --- a/integrations/road-conditions/visual-style.ts +++ b/integrations/road-conditions/visual-style.ts @@ -1,5 +1,5 @@ import type { RoadConditionEvent } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; /** Whether a condition has been announced but has not started yet. */ export function isFutureRoadCondition( From fc22167a31c4cc01829c3a9554c75b01136f31db Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 4 Aug 2026 03:14:51 +0200 Subject: [PATCH 3/3] fix(deps): migrate MapLibre imports to v6 --- .../settings/offline/AreaPickerMap.test.tsx | 4 +-- .../app/settings/offline/AreaPickerMap.tsx | 4 +-- .../settings/offline/OfflineMapView.test.tsx | 2 +- .../app/settings/offline/OfflineMapView.tsx | 4 +-- .../src/components/map/DeepLinkManager.tsx | 2 +- .../components/map/ElevationHoverMarker.tsx | 4 +-- .../src/components/map/LocationMinimap.tsx | 5 ++-- apps/web/src/components/map/MapCanvas.tsx | 18 ++++------- .../src/components/map/MapClickHandler.tsx | 4 +-- .../map/MapStylePoiClickHandler.tsx | 4 +-- .../src/components/map/UserLocationMarker.tsx | 4 +-- .../src/components/map/WaypointMarkers.tsx | 4 +-- .../components/map/layers/DataSourceLayer.tsx | 2 +- .../components/map/layers/FlightArcLayer.tsx | 2 +- .../components/map/layers/GlobeProjection.tsx | 2 +- .../map/layers/NavigationRouteLayer.tsx | 2 +- .../src/components/map/layers/RouteLayer.tsx | 2 +- .../map/layers/dataSourceContextStyle.ts | 2 +- .../src/components/map/layers/desiredStack.ts | 2 +- .../src/components/map/layers/layerStack.ts | 2 +- .../components/map/layers/layerStyleUtils.ts | 2 +- .../components/map/layers/mapLayerGroup.ts | 2 +- .../useGeoJsonSourceDataBridge.test.tsx | 2 +- .../map/layers/useStyleSyncedLayer.ts | 2 +- .../map/overlay/mapInteractionArbiter.test.ts | 2 +- .../map/overlay/mapInteractionArbiter.ts | 4 +-- .../navigation/RouteSearchResultsLayer.tsx | 2 +- .../category/CategoryResultsContent.tsx | 2 +- apps/web/src/hooks/usePinMarker.ts | 4 +-- apps/web/src/lib/MapContext.tsx | 2 +- apps/web/src/lib/launchExplore.ts | 2 +- apps/web/src/lib/navigation/useNavCamera.ts | 4 +-- apps/web/src/lib/trafficFlowExpression.ts | 2 +- .../__tests__/building-style.test.ts | 2 +- .../overlay-3d-buildings/map-layer.tsx | 2 +- .../__tests__/map-layer.test.tsx | 28 ++++++++--------- .../overlay-air-quality/map-layer.tsx | 2 +- integrations/overlay-cycling/map-layer.tsx | 2 +- .../overlay-earthquakes/map-layer.tsx | 2 +- .../__tests__/map-layer.test.tsx | 28 ++++++++--------- .../overlay-environment/map-layer.tsx | 2 +- integrations/overlay-hiking/shelter-layer.tsx | 2 +- .../overlay-live-transit/map-layer.tsx | 2 +- .../overlay-natural-events/map-layer.tsx | 2 +- integrations/overlay-nautical/map-layer.tsx | 2 +- .../overlay-ourairports/map-layer.tsx | 2 +- integrations/overlay-satellite/map-layer.tsx | 2 +- .../__tests__/map-layer.test.tsx | 30 +++++++++---------- .../overlay-traffic-flow/map-layer.tsx | 2 +- .../overlay-weather-alerts/map-layer.tsx | 2 +- integrations/overlay-wildfires/map-layer.tsx | 2 +- .../overlay-winter-sports/map-layer.tsx | 2 +- .../__tests__/map-layer.test.tsx | 28 ++++++++--------- .../__tests__/route-layer.test.tsx | 30 +++++++++---------- integrations/road-conditions/map-layer.tsx | 2 +- integrations/road-conditions/route-layer.tsx | 2 +- 56 files changed, 135 insertions(+), 152 deletions(-) diff --git a/apps/web/src/app/settings/offline/AreaPickerMap.test.tsx b/apps/web/src/app/settings/offline/AreaPickerMap.test.tsx index 3d3a1d289..65c4a6a2c 100644 --- a/apps/web/src/app/settings/offline/AreaPickerMap.test.tsx +++ b/apps/web/src/app/settings/offline/AreaPickerMap.test.tsx @@ -56,10 +56,10 @@ vi.mock("maplibre-gl", () => { } } - return { default: { Map: FakeMap } }; + return { Map: FakeMap }; }); -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { AreaPickerMap } from "./AreaPickerMap"; const fakeMapClass = maplibregl.Map as unknown as { diff --git a/apps/web/src/app/settings/offline/AreaPickerMap.tsx b/apps/web/src/app/settings/offline/AreaPickerMap.tsx index 661837fce..8381136f6 100644 --- a/apps/web/src/app/settings/offline/AreaPickerMap.tsx +++ b/apps/web/src/app/settings/offline/AreaPickerMap.tsx @@ -3,7 +3,7 @@ import Box from "@mui/material/Box"; import { useColorScheme } from "@mui/material/styles"; import type { AreaGeometry } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { createGeoJsonSourceDataBridge } from "@/components/map/layers/layerStyleUtils"; import { MapCredits } from "@/components/map/MapCredits"; @@ -97,7 +97,7 @@ export function AreaPickerMap({ initialCenter, initialZoom, onChange, fitBbox, b let replayBoundary: (() => void) | null = null; const init = async () => { - const maplibregl = (await import("maplibre-gl")).default; + const maplibregl = await import("maplibre-gl"); if (destroyed || !containerRef.current) return; const style = env.styleProvider === "openmapx" diff --git a/apps/web/src/app/settings/offline/OfflineMapView.test.tsx b/apps/web/src/app/settings/offline/OfflineMapView.test.tsx index 7eadf5c37..ca2c0aa16 100644 --- a/apps/web/src/app/settings/offline/OfflineMapView.test.tsx +++ b/apps/web/src/app/settings/offline/OfflineMapView.test.tsx @@ -39,7 +39,7 @@ vi.mock("maplibre-gl", () => { on = vi.fn(); remove = vi.fn(); } - return { default: { Map: FakeMap } }; + return { Map: FakeMap }; }); import * as offlineAreas from "@/lib/offlineAreas"; diff --git a/apps/web/src/app/settings/offline/OfflineMapView.tsx b/apps/web/src/app/settings/offline/OfflineMapView.tsx index ec9add23f..b05714f57 100644 --- a/apps/web/src/app/settings/offline/OfflineMapView.tsx +++ b/apps/web/src/app/settings/offline/OfflineMapView.tsx @@ -2,7 +2,7 @@ import Box from "@mui/material/Box"; import { useColorScheme } from "@mui/material/styles"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { MapCredits } from "@/components/map/MapCredits"; import { useEnv } from "@/lib/EnvProvider"; @@ -96,7 +96,7 @@ export function OfflineMapView({ packages, fitTo, height = 360 }: Props) { const frame = fitTo ?? unionBbox(packages); void (async () => { - const maplibregl = (await import("maplibre-gl")).default; + const maplibregl = await import("maplibre-gl"); let resolver = getDefaultOfflinePackageResolver(); if (!resolver) { resolver = configureDefaultOfflinePackageResolver({ diff --git a/apps/web/src/components/map/DeepLinkManager.tsx b/apps/web/src/components/map/DeepLinkManager.tsx index ca0b0e9f6..6800c8884 100644 --- a/apps/web/src/components/map/DeepLinkManager.tsx +++ b/apps/web/src/components/map/DeepLinkManager.tsx @@ -59,7 +59,7 @@ import { useStreetLevelStore, } from "@openmapx/core"; import type { TransportMode } from "@openmapx/mobility-core/transit"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { DEEPLINK_UPDATE_EVENT, diff --git a/apps/web/src/components/map/ElevationHoverMarker.tsx b/apps/web/src/components/map/ElevationHoverMarker.tsx index 125b4f7be..fd28d2f60 100644 --- a/apps/web/src/components/map/ElevationHoverMarker.tsx +++ b/apps/web/src/components/map/ElevationHoverMarker.tsx @@ -1,6 +1,6 @@ "use client"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { useElevationHover } from "@/components/elevation/ElevationHoverContext"; import { useMap } from "@/lib/MapContext"; @@ -26,7 +26,7 @@ export function ElevationHoverMarker() { let cancelled = false; - import("maplibre-gl").then(({ default: maplibregl }) => { + import("maplibre-gl").then((maplibregl) => { if (cancelled || !mapRef.current) return; if (markerRef.current) { diff --git a/apps/web/src/components/map/LocationMinimap.tsx b/apps/web/src/components/map/LocationMinimap.tsx index 618322de8..cdd95722a 100644 --- a/apps/web/src/components/map/LocationMinimap.tsx +++ b/apps/web/src/components/map/LocationMinimap.tsx @@ -2,6 +2,7 @@ import Box from "@mui/material/Box"; import { type SxProps, type Theme, useColorScheme } from "@mui/material/styles"; +import type { StyleSpecification } from "maplibre-gl"; import { useEffect, useRef } from "react"; import { useEnv } from "@/lib/EnvProvider"; import { baseMapCreditsHtml, loadMaptilerStyle, loadOpenMapXStyle } from "@/lib/map"; @@ -36,7 +37,7 @@ export function LocationMinimap({ lng, lat, zoom = 16, onClick, sx }: LocationMi let cancelled = false; (async () => { - const [{ default: maplibregl }, style] = await Promise.all([ + const [maplibregl, style] = await Promise.all([ import("maplibre-gl"), env.styleProvider === "openmapx" ? loadOpenMapXStyle(env, variant) @@ -46,7 +47,7 @@ export function LocationMinimap({ lng, lat, zoom = 16, onClick, sx }: LocationMi const map = new maplibregl.Map({ container: el, - style: style as string | maplibregl.StyleSpecification, + style: style as string | StyleSpecification, center: [lng, lat], zoom, interactive: false, diff --git a/apps/web/src/components/map/MapCanvas.tsx b/apps/web/src/components/map/MapCanvas.tsx index 9a0b42f07..56fce754a 100644 --- a/apps/web/src/components/map/MapCanvas.tsx +++ b/apps/web/src/components/map/MapCanvas.tsx @@ -3,7 +3,7 @@ import { useColorScheme } from "@mui/material/styles"; import type { LngLat } from "@openmapx/core"; import { useMapStore, useNavigationStore } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useLocale } from "next-intl"; import { useEffect, useRef } from "react"; import { useEnv } from "@/lib/EnvProvider"; @@ -80,14 +80,12 @@ export function MapCanvas() { const initMap = async (initialCenter: LngLat, initialZoom: number) => { setCenter(initialCenter); setZoom(initialZoom); - // The maplibre-gl type definitions don't expose a typed `default` field - // on the module namespace, so we widen the runtime binding to `unknown` - // until inside the guard and then trust the top-level type-only import - // (`import type maplibregl`) for member typing. + // Keep the dynamically loaded module as a namespace: MapLibre 6 no longer + // exposes a synthetic default export. let maplibreRuntime: unknown; let viewportStyle: ViewportStyle | undefined; try { - maplibreRuntime = (await import("maplibre-gl")).default; + maplibreRuntime = await import("maplibre-gl"); if (destroyed || !containerRef.current) return; const maplibregl = maplibreRuntime as unknown as MapLibreRuntime; viewportStyle = await loadStyleForViewport( @@ -297,13 +295,7 @@ export function MapCanvas() { const center = map.getCenter(); Promise.all([import("maplibre-gl"), Promise.resolve([center.lng, center.lat] as LngLat)]) .then(([module, currentCenter]) => - loadStyleForViewport( - env, - variant, - mapStyle, - currentCenter, - module.default as unknown as MapLibreRuntime, - ), + loadStyleForViewport(env, variant, mapStyle, currentCenter, module as MapLibreRuntime), ) .then((s) => { // The persistent `style.load` listener registered at map creation bumps diff --git a/apps/web/src/components/map/MapClickHandler.tsx b/apps/web/src/components/map/MapClickHandler.tsx index 61d1190e3..f17fc374b 100644 --- a/apps/web/src/components/map/MapClickHandler.tsx +++ b/apps/web/src/components/map/MapClickHandler.tsx @@ -10,7 +10,7 @@ import { usePlaceStore, useSidebarStore, } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import type { MapMouseEvent } from "maplibre-gl"; import { useEffect, useRef } from "react"; import { INTERACTIVE_LAYER_IDS } from "@/lib/interactiveLayers"; @@ -93,7 +93,7 @@ export function MapClickHandler() { } let destroyed = false; - import("maplibre-gl").then(({ default: ml }) => { + import("maplibre-gl").then((ml) => { if (destroyed || !mapRef.current) return; const el = document.createElement("div"); el.innerHTML = ` diff --git a/apps/web/src/components/map/MapStylePoiClickHandler.tsx b/apps/web/src/components/map/MapStylePoiClickHandler.tsx index 35c10c990..08efb6f86 100644 --- a/apps/web/src/components/map/MapStylePoiClickHandler.tsx +++ b/apps/web/src/components/map/MapStylePoiClickHandler.tsx @@ -176,10 +176,10 @@ export function MapStylePoiClickHandler() { }; map.on("mousemove", onMouseMove); - map.on("mouseleave", onMouseLeave); + map.on("mouseout", onMouseLeave); return () => { map.off("mousemove", onMouseMove); - map.off("mouseleave", onMouseLeave); + map.off("mouseout", onMouseLeave); }; }, [mapRef, mapReady, styleVersion]); diff --git a/apps/web/src/components/map/UserLocationMarker.tsx b/apps/web/src/components/map/UserLocationMarker.tsx index efbaa49d1..9dbbad502 100644 --- a/apps/web/src/components/map/UserLocationMarker.tsx +++ b/apps/web/src/components/map/UserLocationMarker.tsx @@ -1,7 +1,7 @@ "use client"; import { useMapStore } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { useMap } from "@/lib/MapContext"; @@ -23,7 +23,7 @@ export function UserLocationMarker() { let destroyed = false; - import("maplibre-gl").then(({ default: maplibregl }) => { + import("maplibre-gl").then((maplibregl) => { if (destroyed || !mapRef.current) return; if (markerRef.current) { diff --git a/apps/web/src/components/map/WaypointMarkers.tsx b/apps/web/src/components/map/WaypointMarkers.tsx index 54f0a6941..dd4e83470 100644 --- a/apps/web/src/components/map/WaypointMarkers.tsx +++ b/apps/web/src/components/map/WaypointMarkers.tsx @@ -2,7 +2,7 @@ import type { LngLat } from "@openmapx/core"; import { useDirectionsStore } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { useMap } from "@/lib/MapContext"; import { BRAND } from "@/lib/theme"; @@ -79,7 +79,7 @@ export function WaypointMarkers() { let destroyed = false; - import("maplibre-gl").then(({ default: maplibregl }) => { + import("maplibre-gl").then((maplibregl) => { if (destroyed || !mapRef.current) return; const currentIds = new Set(); diff --git a/apps/web/src/components/map/layers/DataSourceLayer.tsx b/apps/web/src/components/map/layers/DataSourceLayer.tsx index 4c56bd43a..b9ed44000 100644 --- a/apps/web/src/components/map/layers/DataSourceLayer.tsx +++ b/apps/web/src/components/map/layers/DataSourceLayer.tsx @@ -23,7 +23,7 @@ import { dataSourceToAttribution } from "@openmapx/integration-framework"; import { useIntegrationRegistry } from "@openmapx/integration-framework/react"; import { isI18nToken, type Translatable } from "@openmapx/integration-framework/strings"; import type { Attribution } from "@openmapx/mobility-core/attribution"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import type { Map as MaplibreMap, MapMouseEvent } from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; diff --git a/apps/web/src/components/map/layers/FlightArcLayer.tsx b/apps/web/src/components/map/layers/FlightArcLayer.tsx index 58d46decc..78fb9df0d 100644 --- a/apps/web/src/components/map/layers/FlightArcLayer.tsx +++ b/apps/web/src/components/map/layers/FlightArcLayer.tsx @@ -1,7 +1,7 @@ "use client"; import { greatCircleArc, useDirectionsStore, useFlightStore } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useMemo } from "react"; import { useMap } from "@/lib/MapContext"; import { PRIMARY_BLUE_HEX } from "@/lib/theme"; diff --git a/apps/web/src/components/map/layers/GlobeProjection.tsx b/apps/web/src/components/map/layers/GlobeProjection.tsx index 36c3a803b..7680e966f 100644 --- a/apps/web/src/components/map/layers/GlobeProjection.tsx +++ b/apps/web/src/components/map/layers/GlobeProjection.tsx @@ -2,7 +2,7 @@ import { useColorScheme } from "@mui/material/styles"; import { useLayerStore } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { useMap } from "@/lib/MapContext"; diff --git a/apps/web/src/components/map/layers/NavigationRouteLayer.tsx b/apps/web/src/components/map/layers/NavigationRouteLayer.tsx index 6ab0467b9..89e1b5054 100644 --- a/apps/web/src/components/map/layers/NavigationRouteLayer.tsx +++ b/apps/web/src/components/map/layers/NavigationRouteLayer.tsx @@ -2,7 +2,7 @@ import { useNavigationStore } from "@openmapx/core"; import { useIntegrationRegistry } from "@openmapx/integration-framework/react"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useMemo } from "react"; import { attributionsForProviders } from "@/lib/attributionForProviders"; import { useMap } from "@/lib/MapContext"; diff --git a/apps/web/src/components/map/layers/RouteLayer.tsx b/apps/web/src/components/map/layers/RouteLayer.tsx index e31eefb3a..0e302aec4 100644 --- a/apps/web/src/components/map/layers/RouteLayer.tsx +++ b/apps/web/src/components/map/layers/RouteLayer.tsx @@ -3,7 +3,7 @@ import type { LngLat } from "@openmapx/core"; import { useDataSources, useDirectionsStore } from "@openmapx/core"; import { useIntegrationRegistry } from "@openmapx/integration-framework/react"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import type { MapMouseEvent } from "maplibre-gl"; import { useEffect, useMemo } from "react"; import { attributionsForProviders } from "@/lib/attributionForProviders"; diff --git a/apps/web/src/components/map/layers/dataSourceContextStyle.ts b/apps/web/src/components/map/layers/dataSourceContextStyle.ts index 1f908d7a2..609bb906d 100644 --- a/apps/web/src/components/map/layers/dataSourceContextStyle.ts +++ b/apps/web/src/components/map/layers/dataSourceContextStyle.ts @@ -1,4 +1,4 @@ -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; const LIGHT = { no_ride: "#C62828", diff --git a/apps/web/src/components/map/layers/desiredStack.ts b/apps/web/src/components/map/layers/desiredStack.ts index ff9f65d9e..e9414702c 100644 --- a/apps/web/src/components/map/layers/desiredStack.ts +++ b/apps/web/src/components/map/layers/desiredStack.ts @@ -1,6 +1,6 @@ "use client"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; interface DesiredEntry { sourceIds: string[]; diff --git a/apps/web/src/components/map/layers/layerStack.ts b/apps/web/src/components/map/layers/layerStack.ts index 6802c9ae4..fa6451d72 100644 --- a/apps/web/src/components/map/layers/layerStack.ts +++ b/apps/web/src/components/map/layers/layerStack.ts @@ -1,6 +1,6 @@ "use client"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; /** * The canonical bottom-to-top order of every map layer this app draws. A layer diff --git a/apps/web/src/components/map/layers/layerStyleUtils.ts b/apps/web/src/components/map/layers/layerStyleUtils.ts index 590bb4747..542211b91 100644 --- a/apps/web/src/components/map/layers/layerStyleUtils.ts +++ b/apps/web/src/components/map/layers/layerStyleUtils.ts @@ -1,6 +1,6 @@ "use client"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import type { GeoJSONSource, GeoJSONSourceDiff } from "maplibre-gl"; export type GeoJsonSourceData = Parameters[0]; diff --git a/apps/web/src/components/map/layers/mapLayerGroup.ts b/apps/web/src/components/map/layers/mapLayerGroup.ts index 00e2d3238..7f10964da 100644 --- a/apps/web/src/components/map/layers/mapLayerGroup.ts +++ b/apps/web/src/components/map/layers/mapLayerGroup.ts @@ -1,6 +1,6 @@ "use client"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { addLayerInSlot, layerRank, type MapLayerSlot, unregisterLayerSlot } from "./layerStack"; /** A layer spec plus the slot that decides its depth. */ diff --git a/apps/web/src/components/map/layers/useGeoJsonSourceDataBridge.test.tsx b/apps/web/src/components/map/layers/useGeoJsonSourceDataBridge.test.tsx index 7612c6da0..44c09ffeb 100644 --- a/apps/web/src/components/map/layers/useGeoJsonSourceDataBridge.test.tsx +++ b/apps/web/src/components/map/layers/useGeoJsonSourceDataBridge.test.tsx @@ -1,5 +1,5 @@ import { act, renderHook } from "@testing-library/react"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import type { MutableRefObject } from "react"; import { afterEach, describe, expect, it } from "vitest"; import { type CapturedConsoleErrors, captureConsoleErrors, createFakeMap } from "@/test"; diff --git a/apps/web/src/components/map/layers/useStyleSyncedLayer.ts b/apps/web/src/components/map/layers/useStyleSyncedLayer.ts index 39f572b59..c68e655ef 100644 --- a/apps/web/src/components/map/layers/useStyleSyncedLayer.ts +++ b/apps/web/src/components/map/layers/useStyleSyncedLayer.ts @@ -1,6 +1,6 @@ "use client"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { type DependencyList, useEffect } from "react"; import type { MapContextValue } from "@/lib/MapContext"; import { setLayerVisibility } from "./layerStyleUtils"; diff --git a/apps/web/src/components/map/overlay/mapInteractionArbiter.test.ts b/apps/web/src/components/map/overlay/mapInteractionArbiter.test.ts index 64ddaa395..fd816830c 100644 --- a/apps/web/src/components/map/overlay/mapInteractionArbiter.test.ts +++ b/apps/web/src/components/map/overlay/mapInteractionArbiter.test.ts @@ -135,7 +135,7 @@ describe("map interaction arbiter", () => { state.setHits("test-flow", [feature("flow")]); state.emit("mousemove", event()); - state.emit("mouseleave", {}); + state.emit("mouseout", {}); expect(state.getCanvasContainer().style.cursor).toBe(""); unregister(); diff --git a/apps/web/src/components/map/overlay/mapInteractionArbiter.ts b/apps/web/src/components/map/overlay/mapInteractionArbiter.ts index b843168c5..341f19b5e 100644 --- a/apps/web/src/components/map/overlay/mapInteractionArbiter.ts +++ b/apps/web/src/components/map/overlay/mapInteractionArbiter.ts @@ -121,7 +121,7 @@ function createMapState(map: MaplibreMap): MapInteractionState { map.on("click", state.onClick); map.on("mousemove", state.onMouseMove); - map.on("mouseleave", state.onMouseLeave); + map.on("mouseout", state.onMouseLeave); mapStates.set(map, state); return state; } @@ -151,7 +151,7 @@ export function registerMapOverlayInteraction( map.off("click", state.onClick); map.off("mousemove", state.onMouseMove); - map.off("mouseleave", state.onMouseLeave); + map.off("mouseout", state.onMouseLeave); setCursor(map, ""); mapStates.delete(map); }; diff --git a/apps/web/src/components/navigation/RouteSearchResultsLayer.tsx b/apps/web/src/components/navigation/RouteSearchResultsLayer.tsx index 6b4addb33..f55781f82 100644 --- a/apps/web/src/components/navigation/RouteSearchResultsLayer.tsx +++ b/apps/web/src/components/navigation/RouteSearchResultsLayer.tsx @@ -1,7 +1,7 @@ "use client"; import type { AlongRoutePoi, CategoryPlace } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect } from "react"; import { addLayerInSlot } from "@/components/map/layers/layerStack"; import { useGeoJsonSourceDataBridge } from "@/components/map/layers/useGeoJsonSourceDataBridge"; diff --git a/apps/web/src/components/panels/category/CategoryResultsContent.tsx b/apps/web/src/components/panels/category/CategoryResultsContent.tsx index 88e037e0c..98520d1d6 100644 --- a/apps/web/src/components/panels/category/CategoryResultsContent.tsx +++ b/apps/web/src/components/panels/category/CategoryResultsContent.tsx @@ -23,7 +23,7 @@ import { } from "@openmapx/core"; import { useIntegrationRegistry } from "@openmapx/integration-framework/react"; import type { TransitStop, TransportMode } from "@openmapx/mobility-core/transit"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useEffect, useRef } from "react"; import { useExpandOnBackgroundTap } from "@/components/panels/sheet/sheetState"; diff --git a/apps/web/src/hooks/usePinMarker.ts b/apps/web/src/hooks/usePinMarker.ts index 702aab5bf..e26fe0635 100644 --- a/apps/web/src/hooks/usePinMarker.ts +++ b/apps/web/src/hooks/usePinMarker.ts @@ -1,7 +1,7 @@ "use client"; import type { LngLat } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { useMap } from "@/lib/MapContext"; @@ -45,7 +45,7 @@ export function usePinMarker( let destroyed = false; - import("maplibre-gl").then(({ default: maplibregl }) => { + import("maplibre-gl").then((maplibregl) => { if (destroyed || !mapRef.current) return; // Move and relabel existing marker instead of recreating diff --git a/apps/web/src/lib/MapContext.tsx b/apps/web/src/lib/MapContext.tsx index e60b77286..13542b460 100644 --- a/apps/web/src/lib/MapContext.tsx +++ b/apps/web/src/lib/MapContext.tsx @@ -1,6 +1,6 @@ "use client"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { createContext, useCallback, useContext, useRef, useState } from "react"; export interface MapContextValue { diff --git a/apps/web/src/lib/launchExplore.ts b/apps/web/src/lib/launchExplore.ts index 2e6f15b8a..921c61ced 100644 --- a/apps/web/src/lib/launchExplore.ts +++ b/apps/web/src/lib/launchExplore.ts @@ -7,7 +7,7 @@ import { useSearchStore, useSidebarStore, } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; const FRAME_RADIUS_METRES = 1000; diff --git a/apps/web/src/lib/navigation/useNavCamera.ts b/apps/web/src/lib/navigation/useNavCamera.ts index 95243a7ac..47464a8d4 100644 --- a/apps/web/src/lib/navigation/useNavCamera.ts +++ b/apps/web/src/lib/navigation/useNavCamera.ts @@ -7,7 +7,7 @@ import { useNavigationStore, useSettingsStore, } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { useMapOptional } from "@/lib/MapContext"; @@ -140,7 +140,7 @@ export function useNavCamera(): void { const map = mapRef?.current; if (!map || !mapReady || markerRef.current) return; let destroyed = false; - import("maplibre-gl").then(({ default: maplibregl }) => { + import("maplibre-gl").then((maplibregl) => { if (destroyed || markerRef.current) return; const el = document.createElement("div"); el.style.cssText = `width:${PUCK_PX}px;height:${PUCK_PX}px;display:flex;align-items:center;justify-content:center;filter:drop-shadow(0 1px 3px rgba(0,0,0,.45));`; diff --git a/apps/web/src/lib/trafficFlowExpression.ts b/apps/web/src/lib/trafficFlowExpression.ts index c5f1668ef..17d31034d 100644 --- a/apps/web/src/lib/trafficFlowExpression.ts +++ b/apps/web/src/lib/trafficFlowExpression.ts @@ -1,5 +1,5 @@ import { FLOW_FALLBACK_COLOR, FLOW_LOS_COLORS, FLOW_RATIO_STOPS } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; /** * The shared traffic ramp as a MapLibre paint expression. The property names diff --git a/integrations/overlay-3d-buildings/__tests__/building-style.test.ts b/integrations/overlay-3d-buildings/__tests__/building-style.test.ts index 985aea134..b0bc57c4b 100644 --- a/integrations/overlay-3d-buildings/__tests__/building-style.test.ts +++ b/integrations/overlay-3d-buildings/__tests__/building-style.test.ts @@ -1,4 +1,4 @@ -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { describe, expect, it } from "vitest"; import { EXTRUSION_BASE, EXTRUSION_HEIGHT, findBuildingSourceReference } from "../building-style"; diff --git a/integrations/overlay-3d-buildings/map-layer.tsx b/integrations/overlay-3d-buildings/map-layer.tsx index c13f52564..a77459afc 100644 --- a/integrations/overlay-3d-buildings/map-layer.tsx +++ b/integrations/overlay-3d-buildings/map-layer.tsx @@ -1,7 +1,7 @@ "use client"; import { useOverlayExclusion } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { addLayerInSlot } from "@/components/map/layers/layerStack"; import { setLayerVisibility } from "@/components/map/layers/layerStyleUtils"; diff --git a/integrations/overlay-air-quality/__tests__/map-layer.test.tsx b/integrations/overlay-air-quality/__tests__/map-layer.test.tsx index d3478ad86..38de04cd6 100644 --- a/integrations/overlay-air-quality/__tests__/map-layer.test.tsx +++ b/integrations/overlay-air-quality/__tests__/map-layer.test.tsx @@ -22,21 +22,19 @@ vi.mock("@/lib/EnvProvider", () => ({ })); vi.mock("maplibre-gl", () => ({ - default: { - Popup: class FakePopup { - setLngLat() { - return this; - } - setHTML() { - return this; - } - addTo() { - return this; - } - remove() { - return this; - } - }, + Popup: class FakePopup { + setLngLat() { + return this; + } + setHTML() { + return this; + } + addTo() { + return this; + } + remove() { + return this; + } }, })); diff --git a/integrations/overlay-air-quality/map-layer.tsx b/integrations/overlay-air-quality/map-layer.tsx index 076786ee9..bca1e7a05 100644 --- a/integrations/overlay-air-quality/map-layer.tsx +++ b/integrations/overlay-air-quality/map-layer.tsx @@ -2,7 +2,7 @@ import { escapeHtml, sanitizeUrl, useDebouncedCallback, useOverlayExclusion } from "@openmapx/core"; import type { MapLayerMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; import { useGeoJsonSourceDataBridge } from "@/components/map/layers/useGeoJsonSourceDataBridge"; diff --git a/integrations/overlay-cycling/map-layer.tsx b/integrations/overlay-cycling/map-layer.tsx index 6fc7285b9..e783c96fc 100644 --- a/integrations/overlay-cycling/map-layer.tsx +++ b/integrations/overlay-cycling/map-layer.tsx @@ -1,7 +1,7 @@ "use client"; import { useDirectionsStore, useOverlayExclusion } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useEffect, useRef } from "react"; import { CYCLING_COLORS, diff --git a/integrations/overlay-earthquakes/map-layer.tsx b/integrations/overlay-earthquakes/map-layer.tsx index 32eff6f56..a9da6a396 100644 --- a/integrations/overlay-earthquakes/map-layer.tsx +++ b/integrations/overlay-earthquakes/map-layer.tsx @@ -2,7 +2,7 @@ import { escapeHtml, relativeTime, sanitizeUrl, useOverlayExclusion } from "@openmapx/core"; import type { MapLayerMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/overlay-environment/__tests__/map-layer.test.tsx b/integrations/overlay-environment/__tests__/map-layer.test.tsx index 6648d259f..8ba95633e 100644 --- a/integrations/overlay-environment/__tests__/map-layer.test.tsx +++ b/integrations/overlay-environment/__tests__/map-layer.test.tsx @@ -22,21 +22,19 @@ vi.mock("@/lib/EnvProvider", () => ({ })); vi.mock("maplibre-gl", () => ({ - default: { - Popup: class FakePopup { - setLngLat() { - return this; - } - setHTML() { - return this; - } - addTo() { - return this; - } - remove() { - return this; - } - }, + Popup: class FakePopup { + setLngLat() { + return this; + } + setHTML() { + return this; + } + addTo() { + return this; + } + remove() { + return this; + } }, })); diff --git a/integrations/overlay-environment/map-layer.tsx b/integrations/overlay-environment/map-layer.tsx index b88e2a68d..9449c67c0 100644 --- a/integrations/overlay-environment/map-layer.tsx +++ b/integrations/overlay-environment/map-layer.tsx @@ -2,7 +2,7 @@ import { escapeHtml, useDebouncedCallback, useOverlayExclusion } from "@openmapx/core"; import type { MapLayerMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; import { useGeoJsonSourceDataBridge } from "@/components/map/layers/useGeoJsonSourceDataBridge"; diff --git a/integrations/overlay-hiking/shelter-layer.tsx b/integrations/overlay-hiking/shelter-layer.tsx index ea530ffa3..f229bfb11 100644 --- a/integrations/overlay-hiking/shelter-layer.tsx +++ b/integrations/overlay-hiking/shelter-layer.tsx @@ -2,7 +2,7 @@ import { useDebouncedCallback } from "@openmapx/core"; import type { MapMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/overlay-live-transit/map-layer.tsx b/integrations/overlay-live-transit/map-layer.tsx index 793bdae70..b07ffb6b0 100644 --- a/integrations/overlay-live-transit/map-layer.tsx +++ b/integrations/overlay-live-transit/map-layer.tsx @@ -9,7 +9,7 @@ import { } from "@openmapx/core"; import { useIntegrationRegistry } from "@openmapx/integration-framework/react"; import type { GeoJSONFeatureDiff, GeoJSONSourceDiff, MapLayerMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; import { useGeoJsonSourceDataBridge } from "@/components/map/layers/useGeoJsonSourceDataBridge"; diff --git a/integrations/overlay-natural-events/map-layer.tsx b/integrations/overlay-natural-events/map-layer.tsx index 7586cd384..72d9e2a41 100644 --- a/integrations/overlay-natural-events/map-layer.tsx +++ b/integrations/overlay-natural-events/map-layer.tsx @@ -2,7 +2,7 @@ import { escapeHtml, useOverlayExclusion } from "@openmapx/core"; import type { MapLayerMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/overlay-nautical/map-layer.tsx b/integrations/overlay-nautical/map-layer.tsx index 07ee9a566..203a38ed5 100644 --- a/integrations/overlay-nautical/map-layer.tsx +++ b/integrations/overlay-nautical/map-layer.tsx @@ -7,7 +7,7 @@ import { usePlaceStore, useSidebarStore, } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import type { MapLayerMouseEvent } from "maplibre-gl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/overlay-ourairports/map-layer.tsx b/integrations/overlay-ourairports/map-layer.tsx index 7c57f3362..b3ffe45ed 100644 --- a/integrations/overlay-ourairports/map-layer.tsx +++ b/integrations/overlay-ourairports/map-layer.tsx @@ -80,7 +80,7 @@ function typeQueryParams(filter: AirportTypeFilter): string { } // Importing `maplibre-gl` types only — runtime instance comes from the page. -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; export function AirportsOverlay() { const { mapRef, mapReady, styleVersion } = useMap(); diff --git a/integrations/overlay-satellite/map-layer.tsx b/integrations/overlay-satellite/map-layer.tsx index 39f60bd25..7d32b679f 100644 --- a/integrations/overlay-satellite/map-layer.tsx +++ b/integrations/overlay-satellite/map-layer.tsx @@ -1,7 +1,7 @@ "use client"; import { useOverlayExclusion } from "@openmapx/core"; -import type maplibregl from "maplibre-gl"; +import type * as maplibregl from "maplibre-gl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; import { useEnv } from "@/lib/EnvProvider"; diff --git a/integrations/overlay-traffic-flow/__tests__/map-layer.test.tsx b/integrations/overlay-traffic-flow/__tests__/map-layer.test.tsx index 40d6162fe..12b5b51cb 100644 --- a/integrations/overlay-traffic-flow/__tests__/map-layer.test.tsx +++ b/integrations/overlay-traffic-flow/__tests__/map-layer.test.tsx @@ -25,22 +25,20 @@ vi.mock("next-intl", async () => (await import("@/test/intl")).mockNextIntl()); // check for those stable keys rather than the real translated copy. const popupState = vi.hoisted(() => ({ html: "" })); vi.mock("maplibre-gl", () => ({ - default: { - Popup: class FakePopup { - setLngLat() { - return this; - } - setHTML(html: string) { - popupState.html = html; - return this; - } - addTo() { - return this; - } - remove() { - return this; - } - }, + Popup: class FakePopup { + setLngLat() { + return this; + } + setHTML(html: string) { + popupState.html = html; + return this; + } + addTo() { + return this; + } + remove() { + return this; + } }, })); diff --git a/integrations/overlay-traffic-flow/map-layer.tsx b/integrations/overlay-traffic-flow/map-layer.tsx index 2f7286687..5b2074c92 100644 --- a/integrations/overlay-traffic-flow/map-layer.tsx +++ b/integrations/overlay-traffic-flow/map-layer.tsx @@ -1,7 +1,7 @@ "use client"; import { useOverlayExclusion } from "@openmapx/core"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useEffect, useRef } from "react"; import { addLayerInSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/overlay-weather-alerts/map-layer.tsx b/integrations/overlay-weather-alerts/map-layer.tsx index b4f63d4da..b4901e1e3 100644 --- a/integrations/overlay-weather-alerts/map-layer.tsx +++ b/integrations/overlay-weather-alerts/map-layer.tsx @@ -2,7 +2,7 @@ import { escapeHtml, useOverlayExclusion } from "@openmapx/core"; import type { MapLayerMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/overlay-wildfires/map-layer.tsx b/integrations/overlay-wildfires/map-layer.tsx index ab1ec4818..8cf6b6c56 100644 --- a/integrations/overlay-wildfires/map-layer.tsx +++ b/integrations/overlay-wildfires/map-layer.tsx @@ -2,7 +2,7 @@ import { relativeTime, useOverlayExclusion } from "@openmapx/core"; import type { MapLayerMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/overlay-winter-sports/map-layer.tsx b/integrations/overlay-winter-sports/map-layer.tsx index dedb32c08..b8acd807b 100644 --- a/integrations/overlay-winter-sports/map-layer.tsx +++ b/integrations/overlay-winter-sports/map-layer.tsx @@ -2,7 +2,7 @@ import { escapeHtml, useDebouncedCallback, useOverlayExclusion } from "@openmapx/core"; import type { MapLayerMouseEvent, MapMouseEvent } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; import { useGeoJsonSourceDataBridge } from "@/components/map/layers/useGeoJsonSourceDataBridge"; diff --git a/integrations/road-conditions/__tests__/map-layer.test.tsx b/integrations/road-conditions/__tests__/map-layer.test.tsx index 542e338bf..1b4e8a196 100644 --- a/integrations/road-conditions/__tests__/map-layer.test.tsx +++ b/integrations/road-conditions/__tests__/map-layer.test.tsx @@ -30,21 +30,19 @@ vi.mock("@/lib/useDrawnDirectionsRoutes", () => ({ })); vi.mock("maplibre-gl", () => ({ - default: { - Popup: class FakePopup { - setLngLat() { - return this; - } - setHTML() { - return this; - } - addTo() { - return this; - } - remove() { - return this; - } - }, + Popup: class FakePopup { + setLngLat() { + return this; + } + setHTML() { + return this; + } + addTo() { + return this; + } + remove() { + return this; + } }, })); diff --git a/integrations/road-conditions/__tests__/route-layer.test.tsx b/integrations/road-conditions/__tests__/route-layer.test.tsx index 4fce5c04e..39ed201be 100644 --- a/integrations/road-conditions/__tests__/route-layer.test.tsx +++ b/integrations/road-conditions/__tests__/route-layer.test.tsx @@ -94,22 +94,20 @@ vi.mock("@openmapx/core", async (importOriginal) => { const popupState = vi.hoisted(() => ({ html: "" })); vi.mock("maplibre-gl", () => ({ - default: { - Popup: class FakePopup { - setLngLat() { - return this; - } - setHTML(html: string) { - popupState.html = html; - return this; - } - addTo() { - return this; - } - remove() { - return this; - } - }, + Popup: class FakePopup { + setLngLat() { + return this; + } + setHTML(html: string) { + popupState.html = html; + return this; + } + addTo() { + return this; + } + remove() { + return this; + } }, })); diff --git a/integrations/road-conditions/map-layer.tsx b/integrations/road-conditions/map-layer.tsx index 394795bcd..ceae61c97 100644 --- a/integrations/road-conditions/map-layer.tsx +++ b/integrations/road-conditions/map-layer.tsx @@ -2,7 +2,7 @@ import { type RoadConditionEvent, useDebouncedCallback, useOverlayExclusion } from "@openmapx/core"; import type { GeoJSONSource, MapGeoJSONFeature } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useCallback, useEffect, useRef } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack"; diff --git a/integrations/road-conditions/route-layer.tsx b/integrations/road-conditions/route-layer.tsx index f4713f223..ac0cae4ee 100644 --- a/integrations/road-conditions/route-layer.tsx +++ b/integrations/road-conditions/route-layer.tsx @@ -7,7 +7,7 @@ import { useNavigationStore, } from "@openmapx/core"; import type { MapGeoJSONFeature } from "maplibre-gl"; -import maplibregl from "maplibre-gl"; +import * as maplibregl from "maplibre-gl"; import { useTranslations } from "next-intl"; import { useEffect, useMemo, useRef, useState } from "react"; import { addLayerInSlot, unregisterLayerSlot } from "@/components/map/layers/layerStack";