API

Table of Contents

IndoorEqual

Load the indoor= source and layers in your map.

Parameters

  • map object the maplibre-gl instance of the map

  • options object (optional, default {})

    • options.url string? Override the default tiles URL (https://tiles.indoorequal.org/).
    • options.geojson object? GeoJSON data with with key as layer name and value with geojson features
    • options.apiKey string? The API key if you use the default tile URL (get your free key at indoorequal.com).
    • options.layers array? The layers to be used to style indoor= tiles. Take a look a the layers.js file file and the vector schema
    • options.heatmap boolean? Should the heatmap layer be visible at start (true : visible, false : hidden). Defaults to true/visible.

Properties

  • level string The current level displayed
  • levels array 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
  • name string the name of the event
  • fn function the function to be called when the event is emitted

off

Remove an event listener.

Parameters
  • name string the name of the event
  • fn function the same function when on() was called

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
  • level string the level to be displayed

updateLevel

Set the displayed level.

Parameters
  • level string the level to be displayed

Meta

  • deprecated: Use setLevel instead

loadSprite

Load a sprite and add all images to the map

Parameters
  • baseUrl string the baseUrl where to load the sprite

  • options object (optional, default {})

    • options.update boolean? Update existing image (default false)

Returns Promise It resolves an hash of images.

setHeatmapVisible

Change the heatmap layer visibility

Parameters
  • visible boolean 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