Class

MapboxV3View

mapsindoors.mapView.MapboxV3View(args)

Constructor

# new MapboxV3View(args)

MapboxV3View is the MapsIndoors MapView for https://github.com/mapbox/mapbox-gl-js/blob/main/MIGRATION_GUIDE_v3.md.
Parameters:
Name Type Attributes Default Description
args Object A complete list of Mapbox parameters can be found here.
element HTMLElement The HTML element in which the map will be rendered.
accessToken string The Mapbox access token.
center Object | LatLngLiteral <optional>
{lat: 0, lng: 0} The inital geographical centerpoint of the map.
zoom number <optional>
0 The initial zoom level of the map.
maxZoom number <optional>
The maximum zoom level of the map.
pitch number <optional>
0 The initial pitch (tilt) of the map, in degrees.
bearing number <optional>
0 The initial bearing (rotation) of the map, in degrees.
mapsIndoorsTransitionLevel number <optional>
The zoom level on which to transition from Mapbox to MapsIndoors data.
lightPreset string <optional>
The type of the lightning - dawn, day, dusk or night.
showMapMarkers boolean <optional>
The visibility of Mapbox' markers, place labels and transit labels on the map.
showRoadLabels boolean <optional>
The visibility of Mapbox' road labels on the map.
Example
const mapView = new mapsindoors.mapView.MapboxV3View(...);
const mapsIndoors = new mapsindoors.MapsIndoors({mapView: mapView})

Extends

Members

Object

# readonly FeatureType

FeatureType
Properties:
Name Type Description
MODEL2D string
WALLS2D string
MODEL3D string
WALLS3D string
EXTRUSION3D string
EXTRUDEDBUILDINGS string
Object

# readonly MapboxFeatures

MapboxFeatures
Properties:
Name Type Description
MODEL2D string
WALLS2D string
MODEL3D string
WALLS3D string
EXTRUSION3D string
EXTRUDEDBUILDINGS string
Deprecated:
  • Yes

# rotatable

Get whether the current Mapbox map can be rotated.

# tiltable

Get whether the current Mapbox map can be tilted.

Methods

# get(key) → {*}

Parameters:
Name Type Description
key string
Overrides:
*

# getBearing() → {number}

Get the current bearing of the map.
number

# getHiddenFeatures() → {Array}

Gets features that are hidden.
Array

# getMapboxZoomLevel(zoomLevel) → {number}

Aligns MapsIndoors zoom levels with Mapbox' zoom levels by extracting 1 from provided zoomLevel.
Parameters:
Name Type Description
zoomLevel number
number

# getPitch() → {number}

Get the current pitch of the map.
number

# getSlot(layerId) → {string}

Gets current slot property value for a specific layer.
Parameters:
Name Type Description
layerId string
string

# getValues() → {Object}

Returns all values as key value pairs.
Overrides:
Object

# hideFeatures(mapboxFeaturesToHide)

Sets visibility to none for MapboxFeatures that are passed inside the array.
Parameters:
Name Type Description
mapboxFeaturesToHide Array:.<string:>
Example
mapView.hideFeatures([mapView.MapboxFeatures.EXTRUSION3D, mapView.MapboxFeatures.WALLS2D]);

# rotate(rotation)

Adjust rotation on the map.
Parameters:
Name Type Description
rotation number

# set(key, value, overwriteopt)

Sets the value for the given key. If the new value is different from the old value, or if the overwrite parameter is true, the value is set and the appropriate events are emitted.
Parameters:
Name Type Attributes Default Description
key string The key to set.
value * The new value.
overwrite boolean <optional>
false If true, the value is set even if it's the same as the old value.
Overrides:

# setSlot(layerId, slot)

Sets new slot value for a specific layer.
Parameters:
Name Type Description
layerId string
slot string

# setValues(values)

Parameters:
Name Type Description
values Object
Overrides:

# tilt(pitch, duration)

Adjust pitch on the map.
Parameters:
Name Type Description
pitch number The pitch to set, measured in degrees away from the plane of the screen.
duration number Duration of pitch change. Measured in milliseconds.

Events

# changed

This event will fire when any value is changed.
Properties:
Name Type Description
args Object
key string The key of the value that has changed.
newValue * The new value.
oldValue * The old value.
Overrides:
Example
instance.addListener('changed', (args) => {...});