Constructor
new MapsIndoors(options)
Creates a new instance of MapsIndoors.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
|||
map |
google.maps.Map | The Google Map instance that MapsIndoors will be bound to. See google.maps.Map | |
venue |
string |
<optional> |
Id of the initial venue. |
buildingOutlineOptions |
BuildingOutlineOptions |
<optional> |
Settings for the polygon outlining the building thats in focus. |
labelOptions |
LabelOptions |
<optional> |
Styling options for labels on the map. |
Example
new mapsindoors.MapsIndoors({map: googleMap});
Members
static onAuthRequired
Sets a handler for when authentication is required
static onAuthRequired
Gets the authentication handler.
Methods
static getLanguage() → {string}
Gets the current configured language for mapsindoors.
string
static setApiKey(apiKey)
Sets a new mapsindoors api key.
Parameters:
Name | Type | Description |
---|---|---|
apiKey |
string |
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 |
* |
static setLanguage(language)
Sets a language for mapsindoors.
Parameters:
Name | Type | Description |
---|---|---|
language |
string |
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(building) → {Promise}
Fits the building's geometry in the map's bounding box.
Parameters:
Name | Type | Description |
---|---|---|
building |
Building |
Promise
fitVenue(venueId) → {Promise}
Changes the map view to show the default venue or pass in a venue ID to go to another venue
Parameters:
Name | Type | Description |
---|---|---|
venueId |
string | venue ID |
Promise
getDisplayRule(feature) → {DisplayRule}
Gets the DisplayRule for a given location
Parameters:
Name | Type | Description |
---|---|---|
feature |
Location |
getFloor() → {string}
Gets the floor
floor
string
getMap() → {google.maps.Map}
Gets the current Google Maps instance
google.maps.Map
getMapStyles() → {Array.<MapStyle>}
Gets a list of available MapsIndoors map styles.
Array.<MapStyle>
setBuildingOutlineOptions(options)
Sets the building outline options
Parameters:
Name | Type | Description |
---|---|---|
options |
BuildingOutlineOptions |
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 locaiton id or type name, or an array of locations ids and type names. |
displayRule |
DisplayRule |
setFloor(floor)
Sets the floor
Parameters:
Name | Type | Description |
---|---|---|
floor |
string |
setMap(map)
Sets the Google Maps instance
Parameters:
Name | Type | Description |
---|---|---|
map |
google.maps.Map | google.maps.Map |
Events
building_changed
This event will fire if the building focus changes after the map has moved or by calling `mapsIndoors.fitBuilding(building)`.
Properties:
Name | Type | Description |
---|---|---|
building |
Building |
Example
google.maps.event.addListener(mapsIndoors, 'building_changed', (building) => {...});
click
This event will fire when a location is clicked on the map.
Properties:
Name | Type | Description |
---|---|---|
location |
Location |
Example
google.maps.event.addListener(mapsIndoors, 'click', (location) => {...});
floor_changed
This event will fire when the floor index has changed.
The floor index can be changed by calling `mapsIndoors.setFloor(index)` or through interaction with the FloorSelector.
Properties:
Name | Type | Description |
---|---|---|
floorIndex |
number |
Example
google.maps.event.addListener(mapsIndoors, 'floor_changed', (floorIndex) => {...});
ready
This event will fire when MapsIndoors has been initilaized and is ready.
Example
google.maps.event.addListener(mapsIndoors, 'ready', () => {...});