Functions
All commands below are issued on the map object returned after the SDK has been initialized. See the Fullscreen Map sample.
clearLines(groupName)
clearLines(groupName)
Clears a line group (see the drawLines command).
Arguments
groupName
- An identifier for the group of lines to remove (string).
Returns
None.
destroy()
destroy()
This should be a called when a map is removed from the DOM, especially in SPAs.
Arguments
None.
Returns
None.
drawLines(groupName, [coords], style, ordinal)
drawLines(groupName, [coords], style, ordinal)
*Draws a series of connected lines of a specified style on the map. If an ordinal is not specified, the lines are drawn on the current ordinal/floor. If a user changes floors, the lines will disappear and if the user changes back to this floor they reappear.
If this command is called with the same groupName, the newly specified lines/styles override the previous call. If a different groupName is used, the newly specified lines are drawn in addition to other lines.
This is useful for drawing boundaries around areas, or paths. The endpoint does not need to equal the starting point - and they will not be connected (i.e. it can be used to draw paths - not just closed shapes).*
Arguments
groupName
- An identifier for the lines (string).
coords
- A 2 dimensional array of lat & lons e.g [[123.45, 89.23], [456.78, 90.24]].
style
- A dictionary with 2 keys "color" and "width" to specify line color and width. The color value is a string hex color code. The width value is an integer. E.g. { color: '#FF0088', width: 4 } (optional)
ordinal
- The floor ordinal (integer, optional). If not supplied, the lines will be drawn on the current floor.
Returns
None.
drawMarker(name, location, [imageUrl])
drawMarker(name, location, [imageUrl])
Draws a marker on the map at the specified point, visible at any zoom level.
Arguments
name
- An identifier for the marker (string).
location
- A valid location where the marker should be placed.
imageUrl
- A url to an image to be used for the marker. (string, optional).
Returns
None.
enablePoiSelection()
enablePoiSelection()
If set to False, clicking on a POI on the map will be ignored and not open the POI window. Default: True.
Arguments
True or False.
Returns
None.
getDirections(from, to, [accessible], [security_lanes])
getDirections(from, to, [accessible], [security_lanes])
This command is available in headless mode. Gets detailed directions between 2 points.
Arguments
from
- A valid start location.
to
- A valid end location.
accessible
- Pass true to request wheelchair accessible directions (boolean, optional).
security_lanes
- Pass one or more valid security lane types (array of strings, optional). Use the "getVenueData" call to obtain the venue object and inspect the "securityQueueTypes" property for valid lane types.
Returns
A Directions object with eta, distance, detailed steps and other related properties.
getDirectionsMultiple(waypoints, [accessible], [security_lanes])
getDirectionsMultiple(waypoints, [accessible], [security_lanes])
This command is available in headless mode. Gets detailed directions between 2 points.
Arguments
waypoints
- An array of valid location dictionary
accessible
- Pass true to request wheelchair accessible directions (boolean, optional).
security_lanes
- Pass one or more valid security lane types (array of strings, optional). Use the "getVenueData" call to obtain the venue object and inspect the "securityQueueTypes" property for valid lane types.
Returns
A Directions object with eta, distance, detailed steps and other related properties.
getPOIDetails(poiId)
getPOIDetails(poiId)
This command is available in headless mode. Gets detailed data for the POI represented by the passed-in id.
Arguments
poiId
- A valid POI id (integer).
Returns
A POI object with name, description, position, keywords, category and other related properties.
getPosition()
getPosition()
Gets the current latitude, longitude and floor of the map.
Arguments
None
Returns
A Position object with lat, lng, ordinal, floorId and structureId properties.
getState()
getState()
Arguments
None
Returns
A string identifier representing the current state of the map including position, zoom etc. This can be used to restore this map to this state at launch or an arbitrary time.
getStructures()
getStructures()
This command is available in headless mode. It returns data describing the buildings in the venue.
Arguments
None
Returns
A Structure object with name, id, levels and other related properties.
getVenueData()
getVenueData()
This command is available in headless mode. Gets data representing the venue itself.
Arguments
None
Returns
A Venue object with name, id, category, address and other related properties.
getZoom()
getZoom()
Gets the current zoom level.
Arguments
None
Returns
A float representing the current zoom level of the map.
hideMarker(name)
hideMarker(name)
Hides the marker with the name specified.
Arguments
name
- The name assigned when creating the marker (string).
Returns
None.
hidePOIResults()
hidePOIResults()
This hides any results shown by a call to showPOIResults.
Arguments
None.
Returns
None.
maxZoom()
maxZoom()
Sets the maximum zoom level. Range 0 - 24. Default: 22.
Arguments
None
Returns
None
minZoom()
minZoom()
Sets the minimum zoom level. Range 0 - 24. Default: 12.
Arguments
None
Returns
None
resetMap()
resetMap()
Resets the map to its initial view.
Arguments
None.
Returns
None.
resetSearch()
resetSearch()
Clears the search bar and any displayed search results on the map.
Arguments
None.
Returns
None.
search(term, [details])
search(term, [details])
This command is available in headless mode.
Arguments
term
- The search term (string).
details
- A boolean indicating whether POI Ids or objects should be returned (boolean, optional).
Returns
An array of POI Ids or POI objects depending on the value set for the "detail" argument. A POI object includes name, description, position, keywords, category and other related properties.
setBearing(bearing)
setBearing(bearing)
Sets the rotation of the map by setting the bearing. 0 sets north to be directly up, while 90 sets north pointing directly to the left and east pointing up.
Arguments
bearing
- The rotation in degrees (float).
Returns
None.
setLanguage(languageCode)
setLanguage(languageCode)
Sets the UI language for all map-driven dialogs. If a seperate venue is available in that language, that venue will be loaded as well.
Arguments
languageCode
- The 2 letter language code (string).
Returns
None.
setPitch(pitch)
setPitch(pitch)
Sets the pitch of the map, specified by an angle with 0 being directly overhead, and 60 is 60 degrees from overhead, or at a 30 degree angle from the ground.
Arguments
pitch
- The pitch in degrees (float).
Returns
None.
setPosition(location)
setPosition(location)
Sets the position of the map.
Arguments
position
- A valid location dictionary
.
To specify a zoom, bearing or other detail, please see Panning, Zooming & Level Changes.
Returns
None.
setState(stateIdentifier)
setState(stateIdentifier)
Sets the map to the state it was in when the "getState" command was issued.
Arguments
stateIdentifier
- The state to restore the map to (string).
Returns
None.
setViewportBounds(minLat, maxLat, minLng, maxLng, [ordinal])
setViewportBounds(minLat, maxLat, minLng, maxLng, [ordinal])
Repositions and zooms the map so that the specified Lat/Lng boundaries fit just inside the view. This is useful when you know the "bounding box" of an area of interest and wish to focus the map on that area. Providing the optional ordinal will switch to that ordinal.
Arguments
minLat
- The lower latitude (float).
maxLat
- The upper latitude (float).
minLng
- The lower longitude (float).
maxLng
- The upper longitude (float).
ordinal
- The floor ordinal (integer).
Returns
None.
showLevel(ordinal)
showLevel(ordinal)
Switches the map to the floor specified by the passed-in ordinal.
Arguments
ordinal
- The floor ordinal (integer).
Returns
None.
showNavigation(from, to, [accessible], [security_lanes])
showNavigation(from, to, [accessible], [security_lanes])
Shows step-by-step directions between any 2 points using the built-in directions overlay.
Arguments
from
- A valid start location dictionary
.
to
- A valid end location dictionary
.
accessible
- Pass true to request wheelchair accessible directions (boolean, optional).
security_lanes
- Pass one or more valid security lane types (array of strings, optional). Use the "getVenueData" call to obtain the venue object and inspect the "securityQueueTypes" property for valid lane types.
Returns
None.
showNavigationMultiple(waypoints, [accessible], [security_lanes])
showNavigationMultiple(waypoints, [accessible], [security_lanes])
Shows step-by-step directions between multiple waypoints using the built-in directions overlay.
Arguments
waypoints
- An array of valid location dictionary
accessible
- Pass true to request wheelchair accessible directions (boolean, optional).
security_lanes
- Pass one or more valid security lane types (array of strings, optional). Use the "getVenueData" call to obtain the venue object and inspect the "securityQueueTypes" property for valid lane types.
Returns
None.
showPOI(poiId)
showPOI(poiId)
Shows an overlay for the specified POI including details like name, images, etc.
Arguments
poiId
- A valid POI Id (integer).
Returns
None.
showPOIResults(poiIds)
showPOIResults(poiIds)
Displays POI markers at each of the POI locations specified in the poiIds list.
Arguments
poiIds
- A list of POI Ids (array of integers).
Returns
None.
showSearch(searchTerm)
showSearch(searchTerm)
Initiates a search on the search dialog box (if shown), just as if a user had typed it themselves. Search results are shown below the search input, result counts (per floor) in the building/level selector (if shown) and POI markers are displayed on the map for each result.
Arguments
searchTerm
- The term to search for (string).
Returns
None.
showStructure(structureId)
showStructure(structureId)
Repositions the map to focus on the structure/building specified.
Arguments
structureId
- The id for the structure/building (string).
Returns
None.
switchVenue(venueId)
switchVenue(venueId)
Changes the currently displayed venue to the one specified.
Arguments
venueId
- A valid venue id available for your account (string).
Returns
None.
zoomBy(zoomDelta)
zoomBy(zoomDelta)
Zoom the map by the value specified. This can be a negative number (zoom out) or a positive number (zoom in). The value represents a difference to zoom by. If the current zoom level is 15.5 and map.zoomBy(-1.75) is called, the resulting map zoom will be 13.75. If the resulting value lies outside the min/max zoom values, the map will zoom as closely as is valid in the direction specified.
Arguments
zoomDelta
- The amount, in meters, to change the current zoom by (float).
Returns
None.
zoomTo(zoom)
zoomTo(zoom)
Zooms the map to the radius specified.
Arguments
zoom
- The amount, in meters, to zoom to (float).
Returns
None.
Location Dictionary
Location Dictionary
POI ID
{poiId: <string>}
Coordinates with an ordinal
{lat:<float>, lng:<float>, ordinal:<integer>}
Coordinates with a floor id
{lat:<float>, lng:<float>, floorId:<string>}
Updated 6 months ago