A mapboxgl-js plugin to enable multi-floors maps
Note: This is a work in progress and we welcome contributions.
https://indoor.thibaud-michel.com/caserne
Create an OSM indoor map following the Simple Indoor Tagging guidelines.
Transform the osm file into a geojson using osmtogeojson.
Then use the following code:
// Create the indoor handler
const indoor = new Indoor(map);
// Retrieve the geojson from the path and add the map
fetch('maps/gare-de-l-est.geojson')
.then(res => res.json())
.then(geojson => {
indoor.addMap(IndoorMap.fromGeojson(geojson));
});
// Add the specific control
map.addControl(new IndoorControl(indoor));
For the moment, refer to samples.
The library parses the geojson to find level tags and retrieve the map range (minimum and maximum levels).
If the viewport of the map intersects the building bounds, then the map is selected and the IndoorControl
is visible.
When a level is set (initialisation or user click), only the geojson features which have the level property equals (or in the range of) to the current level are shown.
npm install & npm start
Visit http://localhost:9966/ to load the samples
Install and start: docker-compose up --build