Constructor
# new MapsIndoors(options)
Creates a new instance of MapsIndoors.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
object
|
Configuration options for the MapsIndoors instance. | ||
mapView |
mapsindoors.mapView.GoogleMapsView
|
mapsindoors.mapView.MapboxView
|
An instance of a MapView. | ||
venue |
string
|
<optional> |
The ID of the initial venue. Optional. | |
buildingOutlineOptions |
BuildingOutlineOptions
|
<optional> |
Settings for the polygon outlining the building in focus. Optional. | |
labelOptions |
LabelOptions
|
<optional> |
Styling options for labels on the map. Optional. | |
floorSelectionMode |
'manual'
|
'automatic'
|
<optional> |
'automatic' | Sets the floor selection mode. Can be 'automatic' or 'manual'. Defaults to 'automatic'. |
buildingSelectionMode |
'manual'
|
'automatic'
|
<optional> |
'automatic' | Sets the building selection mode. Can be 'automatic' or 'manual'. Defaults to 'automatic'. |
- mapsindoors.MapsIndoors#event:building_changed
- mapsindoors.MapsIndoors#event:click
- mapsindoors.MapsIndoors#event:mouseenter
- mapsindoors.MapsIndoors#event:mouseleave
- mapsindoors.MapsIndoors#event:floor_changed
- mapsindoors.MapsIndoors#event:ready
- mapsindoors.MapsIndoors#event:venue_changed
- mapsindoors.MapsIndoors#event:zoom_changed
Example
new mapsindoors.MapsIndoors({
mapView: mapsindoors.mapView.GoogleMapsView|mapsindoors.mapView.MapboxView
});
Members
function
# static onAuthRequired
The onAuthRequired property is an EventHandler that processes the AuthRequired event.
The AuthRequired is raised when authentication is required for the requested solution.
Example
mapsindoors.MapsIndoors.onAuthRequired = () => {...};
Methods
# (target) → {Array}
Retrieves the display rules for a given target.
Parameters:
Name | Type | Description |
---|---|---|
target |
Location
|
The target for which to retrieve the display rules. |
- An array of display rules.
Array
# (locationId) → {DisplayRule}
Returns the current state DisplayRule for a location.
Parameters:
Name | Type | Description |
---|---|---|
locationId |
string
|
# deallocate()
Clean up and release resources associated with this MapsIndoors instance.
This includes event bindings and other internal ressources.
Use this method when you are done using the instance and wish to ensure that it no longer consumes browser resources.
Afterwards, you must not call any other methods on the instance.
# filter(filter, fitView)
Filter locations on the map by array of ids
Parameters:
Name | Type | Description |
---|---|---|
filter |
Array:.<string:>
|
An array of location ids to filter the map by. |
fitView |
boolean
|
Change the map viewport to fit the current filter. |
# fitBuilding(buildingopt) → {Promise}
Fits a building's geometry in the map's bounding box.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
building |
Building
|
string
|
<optional> |
building (object or id). If not given, the currently set building will be used. |
Promise
# fitVenue(venueopt) → {Promise}
Fits a venue's geometry in the map's bounding box.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
venue |
Venue
|
string
|
<optional> |
venue (object or id). If not given, the current venue will be used. |
Promise
# getBuildingSelectionMode() → {'manual'|'automatic'}
Retrieves the building selection mode.
The building selection mode, either 'automatic' or 'manual'.
'manual'
|
'automatic'
# getDirectionsRenderer() → {DirectionsRenderer}
Returns the DirectionsRenderer instance.
The DirectionsRenderer is responsible for rendereing routes on the map.
DirectionsRenderer
# getDisplayRule(target, ignoreOverridesopt) → {DisplayRule}
Gets the DisplayRule for a given location
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
target |
Location
|
|||
ignoreOverrides |
boolean
|
<optional> |
false | When true the display rule is returned without the overrides. |
# getFloorSelectionMode() → {'manual'|'automatic'}
Retrieves the floor selection mode.
The floor selection mode, either 'automatic' or 'manual'.
'manual'
|
'automatic'
# getLocationSettings(location) → {Object}
Gets location settings object.
Parameters:
Name | Type | Description |
---|---|---|
location |
Location
|
Object
# getMap() → {google.maps.Map|mapboxgl.Map}
Gets the current map instance.
google.maps.Map
|
mapboxgl.Map
# getMapIndoorsStyles() → {Array:.<MapStyle:>}
Gets a list of available MapsIndoors map styles.
Array:.<MapStyle:>
# getMapView(mapView)
Gets the map view.
The map view is the adapter between the SDK and the specific map provider. This could be Google Maps or MapBox.
Parameters:
Name | Type | Description |
---|---|---|
mapView |
*
|
MapView
# getMaxZoom() → {number}
Gets the MapsIndoors current max zoom level.
This function gets a normalized zoom level. Due to the difference in zoom levels between map providers is recommended to use this function to get the max zoom level as it returns a normalized max zoom level. The SDK uses the normalized zoom level for evaluating DisplayRules.
number
# getStatefulDisplayRule(target, ignoreOverridesopt) → {DisplayRule}
Gets the stateful display rule for a given location.
A stateful display rule is a display rule that is combined with the location's current state display rule.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
target |
Location
|
|||
ignoreOverrides |
boolean
|
<optional> |
false | When true the display rule is returned without the overrides. |
# getZoom() → {number}
Gets the MapsIndoors zoom level.
This function gets a normalized zoom level. Due to the difference in zoom levels between map providers is recommended to use this function to get the zoom level as it returns a normalized zoom level. The SDK uses the normalized zoom level for evaluating DisplayRules.
number
# highlight(ids, fitView)
Highlight locations on the map by array of ids.
Parameters:
Name | Type | Description |
---|---|---|
ids |
Array:.<string:>
|
An array of location ids to highlight on the map. |
fitView |
boolean
|
Change the map viewport to fit the current filter. |
# hoverLocation(location)
Sets the Location to be hovered. (Until another Location is hovered, either by calling this method again or by moving the mouse).
Parameters:
Name | Type | Description |
---|---|---|
location |
Location
|
The Location be hovered. |
# overrideDisplayRule(target, displayRule)
Will override the default display rule for the target.
Parameters:
Name | Type | Description |
---|---|---|
target |
string
|
Array:.<string:>
|
Target id (type or location). |
displayRule |
DisplayRule
|
The display rule. |
# selectLocation(location)
Select a Location.
Parameters:
Name | Type | Description |
---|---|---|
location |
Location
|
The Location be selected. |
# setBuilding(building) → {void}
Sets the building in focus.
Parameters:
Name | Type | Description |
---|---|---|
building |
Building
|
void
# setBuildingOutlineOptions(options)
Sets the building outline options
Parameters:
Name | Type | Description |
---|---|---|
options |
BuildingOutlineOptions
|
# setBuildingSelectionMode(mode)
Sets the building selection mode.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
mode |
'manual'
|
'automatic'
|
automatic | The building selection mode. Defaults to 'automatic'. |
# setDisplayRule(target, displayRule)
Sets a DisplayRule for one or more types or locations
Parameters:
Name | Type | Description |
---|---|---|
target |
string
|
Array:.<string:>
|
Can be a single location id or type name, or an array of locations ids and type names. |
displayRule |
DisplayRule
|
# setFloorSelectionMode(mode)
Sets the floor selection mode.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
mode |
'manual'
|
'automatic'
|
automatic | The floor selection mode. Defaults to 'automatic'. |
# setLabelOptions(opts)
Sets the label options used for rendering labels on the map.
Parameters:
Name | Type | Description |
---|---|---|
opts |
LabelOptions
|
# setMapView(mapView)
Sets the map view.
The map view is the adapter between the SDK and the specific map provider. This could be Google Maps or MapBox.
Parameters:
Name | Type | Description |
---|---|---|
mapView |
*
|
# setMapsIndoorsStyle(mapStyle)
Sets the map style.
Parameters:
Name | Type | Description |
---|---|---|
mapStyle |
MapStyle
|
# setSolutionConfig(solutionConfig)
Sets the solution config.
Parameters:
Name | Type | Description |
---|---|---|
solutionConfig |
SolutionConfig
|
Solution Config object. |
# setZoom(zoom)
Sets the MapsIndoors zoom level.
This function sets the map zoom level. Due to the difference in zoom levels between map providers is recommended to use this function to set the zoom level as it normalizes the zoom level across different map providers. The SDK uses the normalized zoom level for evaluating DisplayRules.
Parameters:
Name | Type | Description |
---|---|---|
zoom |
number
|
# static disableEventLogging(boolean)
Enable or disable the SDK logging.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
boolean |
boolean
|
true | A boolean to enable or disable the SDK logging. |
# static getUserRoles() → {Array:.<UserRole:>}
Gets the user roles that will be applied when querying routes and locations.
# static setAuthToken(authToken)
Sets the MapsIndoors authentication token. The token is required for retriving data from solutions behind a login.
Parameters:
Name | Type | Description |
---|---|---|
authToken |
string
|
# static setLanguage(language)
Sets a language for mapsindoors.
Parameters:
Name | Type | Description |
---|---|---|
language |
string
|
# static setMapsIndoorsApiKey(apiKey)
Sets a new mapsindoors api key.
Parameters:
Name | Type | Description |
---|---|---|
apiKey |
string
|
# static setUserRoles(userRoles)
Sets the user roles that will be applied when querying routes and locations.
Parameters:
Example
mapsindoors.services.SolutionsService.getUserRoles().then(userRoles => {
const roles = userRoles.filter(role => ["Maintenance", "Staff"].includes(role.name));
mapsindoors.MapsIndoors.setUserRoles(roles);
});