Indoor JS API v1.4

Indoor JS API Reference v1.4
  1. IndoorRenderer class
  2. IndoorService class
  3. IndoorWidget class
  4. Building Interface
  5. Feature Interface
  6. FeatureCollection Interface
  7. IndoorDirectionLeg Interface
  8. IndoorDirectionRequest Interface
  9. IndoorDirectionResult Interface
  10. IndoorDirectionRoute Interface
  11. IndoorDirectionsBounds Interface
  12. IndoorDistance Interface
  13. IndoorDuration Interface
  14. IndoorGeometryType Interface
  15. IndoorInstruction Interface
  16. IndoorPosition Interface
  17. IndoorRendererOptions Interface
  18. IndoorRendererOptionsIcon Interface
  19. IndoorStep Interface
  20. IndoorWidgetOptions Interface
  21. IndoorWidgetOptionsui Interface
  22. LatLngLevel Interface
  23. Level Interface
  24. PolylineCoords Interface
  25. Prediction Interface
  26. Predictions Interface
  27. Venue Interface
  28. VenuesResult Interface

IndoorRenderer class

woosmap.map.IndoorRenderer
This class extends MVCObject.
Constructor
IndoorRenderer(options?)
Parameters:

Creates an Indoor renderer.


Methods
setMap(map?)
Parameters:
  • map: (woosmap.map.Map | null)

Sets the map where to render the Indoor map.

getDirectionsRenderer()
Parameters: None
Return Type: IndoorDirectionsRenderer

Gets the directions renderer.

getLevel()
Parameters: None
Return Type: number

Get the displayed level.

getSelectedFeature()
Parameters: None
Return Type: (Feature | null)

Get the selected feature.

getVenue()
Parameters: None
Return Type: (Venue | null)

Get the displayed venue.

getView()
Parameters: None
Return Type: "mobile" | "desktop" | "auto"

Gets view set for the renderer

setDirections(directions?, padding?)
Parameters:
  • directions: (IndoorDirectionResult | null) result from the indoor directions API
  • padding: (number | null) padding to apply

Call this function to draw a polyline on map.

highlightStep(stepToHighlight?, fitBounds, tilt)
Parameters:
  • stepToHighlight: (Feature | null)
  • fitBounds: boolean
  • tilt: boolean

Highlight the step of the directions

unselectFeature()
Parameters: None

Unselect a selected feature

setUserLocation(lat, lng, level, bearing, forceFocus, adjusted)
Parameters:
  • lat: number Latitude
  • lng: number Longitude
  • level: number user level
  • bearing: number user location bearing/heading
  • forceFocus: boolean center on user location
  • adjusted: boolean

Set the current user location. A blue dot is going to be displayed.

getUserLocation()
Parameters: None
Return Type: IndoorPosition

Returns the current user location.

isUserInsideVenue(lat, lng)
Parameters:
  • lat: number
  • lng: number
Return Type: boolean

Detects whether user location is found inside venue’s bounding box

setFloor(floor)
Parameters:
  • floor: number The floor value to set

Sets the floor for the venue

setVenue(venueId)
Parameters:
  • venueId: string The unique id of the venue

Renders map with the selected venue

highlightFeature(featureid, silent)
Parameters:
  • featureid: string The unique id of the feature to highlight
  • silent: boolean will prevent the indoor_feature_selected event to trigger

Renders a map with a POI highlighted by pk or id

highlightFeatureByRef(ref)
Parameters:
  • ref: string The unique reference of the poi to highlight

Renders a map with a POI highlighted by ref

setTheme(theme)
Parameters:
  • theme: string Theme name

Renders map with custom theme


Events

This event is fired when the indoor venue is loaded

This event is fired when the indoor level is changed

This event is fired when the indoor user location is changed

This event is fired when any indoor feature on the map is clicked


IndoorService class

woosmap.map.IndoorService

Service used to call the Indoor API.

Constructor
IndoorService()
Parameters: None

Service used to call the Indoor API.


Methods
venues(callback)
Parameters:

Retrieve all the venues

venue(venueId, callback)
Parameters:
  • venueId: string
  • callback: (venue: Venue) => void

Retrieve detailed venue data

search(venueId, query, ref?, id?, callback)
Parameters:
  • venueId: string
  • query: string
  • ref: (string | null)
  • id: (string | null)
  • callback: (featureCollection: FeatureCollection) => any

Search for features by their names

directions(request, callback)
Parameters:

Gets indoor directions

feature(venueId, featureId, callback)
Parameters:
  • venueId: string
  • featureId: number
  • callback: (feature: Feature) => void

Gets feature by feature id

autocomplete(venueId, query, ref?, id?, callback, fromLocation?)
Parameters:
  • venueId: string
  • query: string
  • ref: (string | null)
  • id: (string | null)
  • callback: (predictions: Predictions) => any
  • fromLocation: (string | null)

Autocomplete for pois


IndoorWidget class

woosmap.map.IndoorWidget
Constructor
IndoorWidget(widgetOptions?, rendererOptions?)
Parameters:

Creates a new Indoor widget.


Methods
setMap(map)
Parameters:
  • map: Map

Sets the map where to render the Indoor.

setVenue(venueId)
Parameters:
  • venueId: string

Renders map with the selected venue

highlightFeature(id, silent)
Parameters:
  • id: string
  • silent: boolean

Renders a map with a POI highlighted by pk / id silent parameter will prevent the indoor_feature_selected event to trigger

highlightFeatureByRef(ref)
Parameters:
  • ref: string

Renders a map with a POI highlighted by its ref

unselectFeature()
Parameters: None

Unselect a selected feature: it closes the widget and unhighlight the feature.

setDirections(directions?)
Parameters:

Call this function to draw a polyline on map.

setUnits(units)
Parameters:
  • units: "imperial" | "metric"

Sets the distance units.

getUnits()
Parameters: None
Return Type: "imperial" | "metric"

Gets the distance units.

setDirectionsMode(profile)
Parameters:
  • profile: string

Sets the routing profile (or directions mode) (‘security’ | ‘wheelchair’) for way finding

getDirectionsMode()
Parameters: None
Return Type: (string | null)

Gets the distance units.

setUserLocation(lat, lng, level, bearing?, forceFocus)
Parameters:
  • lat: number
  • lng: number
  • level: number
  • bearing: number
  • forceFocus: boolean

Sets the current user location.

setNavigationMode(allowNavigation)
Parameters:
  • allowNavigation: boolean

Sets the navigation mode

getNavigationMode()
Parameters: None
Return Type: boolean

Gets the navigates mode

getAutocompleteWithDistance()
Parameters: None
Return Type: boolean

Gets the autocompleteWithDistance option

setTheme(theme)
Parameters:
  • theme: string Theme name

Renders map with custom theme

setZonesToAvoid(avoidZones)
Parameters:
  • avoidZones: string
Return Type: (string | null)

Sets the zones to avoid during routing. Argument expected in the format level;lat,lng;lat,lng;lat,lng…|level;lat,lng;lat,lng;lat,lng…

getZonesToAvoid()
Parameters: None
Return Type: (string | null)

Gets the zones to avoid while routing

setFloor(floor)
Parameters:
  • floor: number

Sets the floor for the venue

addListener(eventName, handler)
Parameters:
  • eventName: string
  • handler: any
Return Type: MapEventListener

Adds a listener for eventName.


Building Interface

Building of a venue.

Properties
Type: (string | null)
Type: (string | null)
Type: Level[]
Type: ({} | null)
Type: (string | null)
Type: (string | null)
Type: (string | null)
Type: (string | null)

Feature Interface

Feature

Properties
Type: {coordinates: any, type: IndoorGeometryType}
Type: (number | null)
Type: {}

FeatureCollection Interface

Collection of features

Properties
Type: Feature[]
Type: "FeatureCollection"

IndoorDirectionLeg Interface

Indoor directions leg.

Properties
Type: IndoorStep[]

IndoorDirectionRequest Interface

Request to get directions between an origin and a destination.

Properties
Type: (string | null)
Type: (LatLng | null)
Type: (number | null)
Type: (number | null)
Type: (string | null)
Type: (string | null)
Type: (LatLng | null)
Type: (number | null)
Type: (number | null)
Type: "metric" | "imperial"
Type: string

IndoorDirectionResult Interface

Indoor directions result.

Properties

IndoorDirectionRoute Interface

Indoor directions route.

Properties

IndoorDirectionsBounds Interface

Type: number[]

Indoor directions bounds.

IndoorDistance Interface

Indoor distance object.

Properties
Type: string
Type: number

IndoorDuration Interface

Indoor duration object.

Properties
Type: string
Type: number

IndoorGeometryType Interface

Type: "Point" | "LineString" | "Polygon"

Type of Indoor geometry

IndoorInstruction Interface

Indoor instrction object.

Properties
Type: string
Type: string

IndoorPosition Interface

Position indoor.

Properties
Type: (boolean | null)
Type: (number | null)
Type: (boolean | null)
Type: number
Type: LatLngLiteral

IndoorRendererOptions Interface

Options to configure the Indoor Renderer.

Properties
Type: boolean

Center the map on the venue when initializing.

Type: number

Set default floor for the venue

Type: boolean

Force the extrusion to be always visible.

Type: boolean

Hide the level selector

Type: string

Renders map with a POI selected by pk or id

Type: string

Renders map with a POI selected by ref

Sets custom icon for venue markers

Type: "mobile" | "desktop" | "auto"
Enforces the view of the renderer. Possible values could be ‘auto’ ‘mobile’ ‘desktop’
Type: string

Renders map with the custom theme provided.

Type: boolean

Display an infowindow to highlight a selected POI

Type: string

Set default venue


IndoorRendererOptionsIcon Interface

Icons to use to display venues on the map.

Properties
Type: {x: number, y: number}
Type: {height: number, width: number}
Type: string

IndoorStep Interface

Indoor directions step.

Properties
Type: number
Type: number
Type: (IndoorInstruction | null)

IndoorWidgetOptions Interface

Options of the Indoor widget.

Properties
Type: boolean

Set directions mode/routing profile

Type: string
Areas to avoid while routing. Useful when certain areas of the venues are restricted or under maintenance. Expected format evel;lat,lng;lat,lng;lat,lng… level;lat,lng;lat,lng;lat,lng…
Type: string

Set directions mode/routing profile

Type: boolean

Sets whether to enable/disable navigation mode.

Set the custom colors of the indoor widget

Type: "imperial" | "metric" | ""

Set units to use to show distance in directions itinerary


IndoorWidgetOptionsui Interface

UI Option of the Indoor widget.

Properties
Type: string
Type: string

LatLngLevel Interface

Indoor location composed of a latitude, a longitude and a level.

Properties
Type: number
Type: number
Type: number

Level Interface

Level of a Venue

Properties
Type: number[]
Type: number
Type: (string | null)

PolylineCoords Interface

Type: Array<[number, number]>

Array of lat, lon coordinates.

Prediction Interface

Autocomplete predictions

Properties
Type: (string | null)
Type: (number | null)
Type: number
Type: number
Type: string
Type: (string | null)

Predictions Interface

Collection of poi predictions

Properties
Type: Prediction[]
Type: "Array"

Venue Interface

Venue

Properties
Type: number[]
Type: (Building[] | null)
Type: (string[] | null)
Type: Level[]
Type: (string | null)
Type: (string[] | null)
Type: string

VenuesResult Interface

List of venues.

Properties
Type: Venue[]

Was this article helpful?
Have more questions? Submit a request