From 58d6f7e96355a604e33e8965999b30f5517150e1 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 2 Aug 2024 22:48:42 +0200 Subject: [PATCH] potentially fixed the layer not using the custom configured style --- webclient/app/components/IndoorMap.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webclient/app/components/IndoorMap.vue b/webclient/app/components/IndoorMap.vue index 87a47c9d7..43660c484 100644 --- a/webclient/app/components/IndoorMap.vue +++ b/webclient/app/components/IndoorMap.vue @@ -4,7 +4,7 @@ import { addIndoorTo, IndoorControl, IndoorMap } from "map-gl-indoor"; import { AttributionControl, FullscreenControl, GeolocateControl, Map, Marker, NavigationControl } from "maplibre-gl"; import { webglSupport } from "~/composables/webglSupport"; // @ts-expect-error library does not provide proper types -import type { MaplibreMapWithIndoor } from "map-gl-indoor"; +import type { MaplibreMapWithIndoor, IndoorMapOptions } from "map-gl-indoor"; import type { components } from "~/api_types"; import { indoorLayers } from "~/composables/indoorLayer"; @@ -176,7 +176,12 @@ async function initMap(containerId: string) { // Retrieve the geojson from the path and add the map const geojson = await (await fetch("/example.geojson")).json(); - const indoorMap = IndoorMap.fromGeojson(geojson, { indoorLayers, showFeaturesWithEmptyLevel: true }); + const indoorOptions = { + beforeLayerId: "poi_z16", + layers: indoorLayers, + showFeaturesWithEmptyLevel: true, + } as IndoorMapOptions; + const indoorMap = IndoorMap.fromGeojson(geojson, indoorOptions); await map.indoor.addMap(indoorMap); // Add the specific control