Skip to content

Commit

Permalink
potentially fixed the layer not using the custom configured style
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Aug 2, 2024
1 parent 92d6cfb commit 58d6f7e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions webclient/app/components/IndoorMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 58d6f7e

Please sign in to comment.