Indoor JS API v1.4

Indoor JS API Reference v1.4
  1. IndoorRenderer class
  2. IndoorService class
  3. IndoorWidget class
  4. Building Interface
  5. Prediction Interface
  6. Predictions Interface
  7. IndoorDirectionLeg Interface
  8. IndoorDirectionRequest Interface
  9. IndoorDirectionResult Interface
  10. IndoorDirectionRoute Interface
  11. IndoorDirectionsBounds Interface
  12. IndoorDirectionsIcons Interface
  13. IndoorDistance Interface
  14. IndoorDuration 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. Venue Interface
  26. 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)
Return Type: void

Sets the map where to render the Indoor map.

getLevel()
Parameters: None
Return Type: number

Get the displayed level.

getSelectedFeature()
Parameters: None
Return Type: (GeoJSONFeature | 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
Return Type: void

Call this function to draw a polyline on map.

highlightStep(stepToHighlight?, fitBounds?, tilt?, soundEnabled?)
Parameters:
  • stepToHighlight: (GeoJSONFeature | null)
  • fitBounds: boolean
  • tilt: boolean
  • soundEnabled: boolean
Return Type: void

Highlight the step of the directions

displayRoutingPath(show)
Parameters:
  • show: boolean true to show the routing paths or false to hide them
Return Type: void

Show or hide the routing path on the map

unselectFeature()
Parameters: None
Return Type: void

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
Return Type: void

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
Return Type: void

Sets the floor for the venue

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

Renders map with the selected venue

highlightFeature(featureid, silent, padding?)
Parameters:
  • featureid: string The unique id of the feature to highlight
  • silent: boolean will prevent the indoor_feature_selected event to trigger
  • padding: Padding The padding to apply to the map container while highlighting the POI on map. All properties of this object must be non-negative integers.
Return Type: void

Renders a map with a POI highlighted by pk or id

highlightFeatureByRef(ref, padding?)
Parameters:
  • ref: string The unique reference of the poi to highlight
  • padding: Padding The padding to apply to the map container while highlighting the POI on map. All properties of this object must be non-negative integers.
Return Type: void

Renders a map with a POI highlighted by ref

filterPois(advancedFilter, disableZoomMin)
Parameters:
  • advancedFilter: string Use an advanced filter (same format as search)
  • disableZoomMin: boolean Disable the zoom min property on filtered POIs

Filter the map to display only labels and icons of POIs which are matching the filters

setTheme(theme)
Parameters:
  • theme: string Theme name
Return Type: void

Renders map with custom theme

setBaseFilter(filter)
Parameters:
  • filter: string base filter
Return Type: void

Sets the default filter applied

resetUserMarker()
Parameters: None
Return Type: void

Resets the user marker

notifyUserDeviated(currentLocation)
Parameters:
  • currentLocation: GeoJSONFeature User’s current location
Return Type: void

Triggers event to notify user has deviated from path during navigation


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 a direction step is highlighted during turn by turn navigation

This event is fired when the indoor user location is changed

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

This event is fired when the user deviates from the path in navigation mode


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:
Return Type: void

Retrieve all the venues

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

Retrieve detailed venue data

search(venueId, query, callback, ref?, id?, advancedFilter?)
Parameters:
  • venueId: string
  • query: string
  • callback: (featureCollection: GeoJSONFeatureCollection) => any
  • ref: (string | null)
  • id: (string | null)
  • advancedFilter: (string | null)
Return Type: void

Search for features by their names

directions(request, callback)
Parameters:
Return Type: void

Gets indoor directions

feature(venueId, featureId, callback)
Parameters:
  • venueId: string
  • featureId: number
  • callback: (feature: GeoJSONFeature) => void
Return Type: void

Gets feature by feature id

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

Autocomplete for pois


IndoorWidget class

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

Creates a new Indoor widget.


Methods
setMap(map)
Parameters:
  • map: Map
Return Type: void

Sets the map where to render the Indoor widget.

setVenue(venueId)
Parameters:
  • venueId: string
Return Type: void

Renders map with the selected venue

highlightFeature(id, silent, padding?)
Parameters:
  • id: string
  • silent: boolean
  • padding: Padding
Return Type: void

Renders a map with a POI highlighted by pk / id silent parameter will prevent the indoor_feature_selected event to trigger padding parameter will apply padding to the map container while highlighting the POI on map

highlightFeatureByRef(ref, padding?)
Parameters:
  • ref: string
  • padding: Padding
Return Type: void

Renders a map with a POI highlighted by its ref padding parameter will apply padding to the map container while highlighting the POI on map

unselectFeature()
Parameters: None
Return Type: void

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

setDirections(directions?)
Parameters:
Return Type: void

Call this function to draw a polyline on map.

setUnits(units)
Parameters:
  • units: "imperial" | "metric"
Return Type: void

Sets the distance units.

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

Gets the distance units.

setDirectionsMode(profile)
Parameters:
  • profile: string
Return Type: void

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

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

Gets the distance units.

setBaseFilter(filter?)
Parameters:
  • filter: (string | null)
Return Type: void

Sets the baseFilter.

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

Gets the baseFilter

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

Sets the current user location.

setNavigationMode(allowNavigation)
Parameters:
  • allowNavigation: boolean
Return Type: void

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
Return Type: void

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
Return Type: void

Sets the floor for the venue

getRenderer()
Parameters: None
Return Type: IndoorRenderer

Gets the underlying instance of Indoor Renderer when using the Indoor Widget

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

Adds a listener for eventName.

trigger(instance, eventName, eventArgs?)
Parameters:
  • instance: Object
  • eventName: string
  • eventArgs: (any[] | null)
Return Type: void

Triggers the given event. All arguments after eventName are passed as arguments to the listeners.


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)

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"

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) | string
Type: (number | null)
Type: (string | null)
Type: (string | null)
Type: (boolean | null)
Type: (LatLng | null)
Type: (number | null) | string
Type: (number | null)
Type: "metric" | "imperial"
Type: string
Type: (string | null)

IndoorDirectionResult Interface

Indoor directions result.

Properties

IndoorDirectionRoute Interface

Indoor directions route.

Properties

IndoorDirectionsBounds Interface

Type: number[]

Indoor directions bounds.

IndoorDirectionsIcons Interface

Icons to indicate origin and destination on route

Properties

IndoorDistance Interface

Indoor distance object.

Properties
Type: string
Type: number

IndoorDuration Interface

Indoor duration object.

Properties
Type: string
Type: number

IndoorInstruction Interface

Indoor instruction 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: string

Filter the map to display only labels and icons of POIs which are matching the filters

Type: boolean

Center the map on the venue when initializing.

Type: number

Set default floor for the venue

Icons to indicate origin and destination on the route

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: "auto" | "top" | "right"

The position to place the level selector. Possible values are top(left) and right.

Type: "mobile" | "desktop" | "auto"

Enforces the view of the renderer.

Type: boolean

Show the routing paths

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 level;lat,lng;lat,lng;lat,lng|level;lat,lng;lat,lng;lat,lng

Type: string

Filter the map and the autocomplete to display/search only labels and icons of POIs which are matching the filters

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: GeoJSONPosition[]

Array of lat, lon coordinates.

Venue Interface

Defines the indoor venue information. An indoor venue consists of one or more buildings, geometry other information describing the 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