Skip to content

Commit

Permalink
custom styling
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jul 13, 2024
1 parent 88df464 commit 644d498
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion webclient/components/DetailsInteractiveMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,36 @@ async function initMap(containerId: string) {
map.addControl(attrib);
attrib._toggleAttribution();
});
addIndoorTo(map);
// Retrieve the geojson from the path and add the map
const geojson = await (await fetch("/example.geojson")).json();
await map.indoor.addMap(IndoorMap.fromGeojson(geojson));
const layers = [
{
filter: ["filter-==", "indoor", "room"],
id: "indoor-rooms",
type: "fill",
source: "indoor",
paint: {
"fill-color": "#FF0000",
"fill-opacity": 0.5,
},
},
{
filter: ["filter-==", "indoor", "area"],
id: "indoor-areas",
type: "fill",
source: "indoor",
paint: {
"fill-color": "#0000FF",
"fill-opacity": 0.5,
},
},
];
const indoorMap = IndoorMap.fromGeojson(geojson, { layers, showFeaturesWithEmptyLevel: true });
await map.indoor.addMap(indoorMap);
// Add the specific control
map.addControl(new IndoorControl(), "bottom-left");
Expand Down

0 comments on commit 644d498

Please sign in to comment.