API
Table of Contents
IndoorEqual
Load the indoor= source and layers in your map.
Parameters
-
mapobject the maplibre-gl instance of the map -
optionsobject (optional, default)-
options.urlstring? Override the default tiles URL (https://tiles.indoorequal.org/). -
options.geojsonobject? GeoJSON data with with key as layer name and value with geojson features -
options.apiKeystring? The API key if you use the default tile URL (get your free key at indoorequal.com). -
options.layersarray? The layers to be used to style indoor= tiles. Take a look a the layers.js file file and the vector schema -
options.heatmapboolean? Should the heatmap layer be visible at start (true : visible, false : hidden). Defaults to true/visible.
-
Properties
-
levelstring The current level displayed -
levelsarray The levels that can be displayed in the current view
Returns IndoorEqual this
remove
Remove any layers, source and listeners and controls
on
Add an event listener
Parameters
off
Remove an event listener.
Parameters
onAdd
Add the level control to the map Used when adding the control via the map instance: map.addControl(indoorEqual)
onRemove
Remove the level control Used when removing the control via the map instance: map.removeControl(indoorEqual)
setLevel
Set the displayed level.
Parameters
-
levelstring the level to be displayed
updateLevel
Set the displayed level.
Parameters
-
levelstring the level to be displayed
Meta
- deprecated: Use setLevel instead
loadSprite
Load a sprite and add all images to the map
Parameters
-
baseUrlstring the baseUrl where to load the sprite -
optionsobject (optional, default)-
options.updateboolean? Update existing image (default false)
-
Returns Promise It resolves an hash of images.
setHeatmapVisible
Change the heatmap layer visibility
Parameters
-
visibleboolean True to make it visible, false to hide it
IndoorEqual#levelschange
Emitted when the list of available levels has been updated
Type: array
IndoorEqual#levelchange
Emitted when the current level has been updated
Type: string