Constructor
# new MapboxView(args)
MapboxView is the MapsIndoors MapView for MapBox.
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. |
Example
const mapView = new mapsindoors.mapView.MapboxView(...);
const mapsIndoors = new mapsindoors.MapsIndoors({mapView: mapView})
Extends
Members
Methods
# 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:
# 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) => {...});