Source: https://developers.woosmap.com/products/indoor-api/indoor-js-api/reference/

> For clean Markdown of any page, append `.md` to the page URL.

> For a complete documentation index, see https://developers.woosmap.com/llms.txt

# Indoor JS API v1.4



## IndoorRenderer class

`woosmap.map.IndoorRenderer`

This class extends `MVCObject`. 

### Constructor

#### `IndoorRenderer`

`IndoorRenderer(options?)`

**Parameters:**
- `options`: `IndoorRendererOptions` IndoorRendererOptions

Creates an Indoor renderer.

  

### Methods

#### `setMap`

`setMap(map?)`

**Parameters:**
- `map`: `(woosmap.map.Map | null)` 

**Return Type** : `void`

Sets the map where to render the Indoor map.

#### `getLevel`

`getLevel()`

**Parameters:** None

**Return Type** : `number`

Get the displayed level.

#### `getSelectedFeature`

`getSelectedFeature()`

**Parameters:** None

**Return Type** : `(GeoJSONFeature | null)`

Get the selected feature.

#### `getVenue`

`getVenue()`

**Parameters:** None

**Return Type** : `(Venue | null)`

Get the displayed venue.

#### `getView`

`getView()`

**Parameters:** None

**Return Type** : `"mobile"`

Gets view set for the renderer

#### `setDirections`

`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`

`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`

`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`

`unselectFeature()`

**Parameters:** None

**Return Type** : `void`

Unselect a selected feature

#### `setUserLocation`

`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`

`getUserLocation()`

**Parameters:** None

**Return Type** : `IndoorPosition`

Returns the current user location.

#### `isUserInsideVenue`

`isUserInsideVenue(lat, lng)`

**Parameters:**
- `lat`: `number` 
- `lng`: `number` 

**Return Type** : `boolean`

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

#### `setFloor`

`setFloor(floor)`

**Parameters:**
- `floor`: `number` The floor value to set

**Return Type** : `void`

Sets the floor for the venue

#### `setVenue`

`setVenue(venueId)`

**Parameters:**
- `venueId`: `string` The unique id of the venue

**Return Type** : `void`

Renders map with the selected venue

#### `highlightFeature`

`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`

`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`

`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`

`setTheme(theme)`

**Parameters:**
- `theme`: `string` Theme name

**Return Type** : `void`

Renders map with custom theme

#### `setBaseFilter`

`setBaseFilter(filter)`

**Parameters:**
- `filter`: `string` base filter

**Return Type** : `void`

Sets the default filter applied

#### `resetUserMarker`

`resetUserMarker()`

**Parameters:** None

**Return Type** : `void`

Resets the user marker

#### `notifyUserDeviated`

`notifyUserDeviated(currentLocation)`

**Parameters:**
- `currentLocation`: `GeoJSONFeature` User’s current location

**Return Type** : `void`

Triggers event to notify user has deviated from path during navigation

#### `notifyProximityToDest`

`notifyProximityToDest()`

**Parameters:** None

**Return Type** : `void`

Triggers event to notify user’s proximity to destination

  

### Events

#### `indoor_venue_loaded`

This event is fired when the indoor venue is loaded

#### `indoor_level_changed`

This event is fired when the indoor level is changed

#### `indoor_highlight_step`

This event is fired when a direction step is highlighted during turn by turn navigation

#### `indoor_user_location`

This event is fired when the indoor user location is changed

#### `indoor_feature_selected`

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

#### `indoor_user_deviated`

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

#### `indoor_user_near_arrival`

This event is fired when the user has reached closed to their destination. If the user’s location is within 10 meters of their destination, this event will be triggered.

  

## IndoorService class

`woosmap.map.IndoorService`

Service used to call the Indoor API.

### Constructor

#### `IndoorService`

`IndoorService()`

**Parameters:** None

Service used to call the Indoor API.

  

### Methods

#### `venues`

`venues(callback)`

**Parameters:**
- `callback`: `(venues: VenuesResult) => void` 

**Return Type** : `void`

Retrieve all the venues

#### `venue`

`venue(venueId, callback)`

**Parameters:**
- `venueId`: `string` 
- `callback`: `(venue: Venue) => void` 

**Return Type** : `void`

Retrieve detailed venue data

#### `search`

`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`

`directions(request, callback)`

**Parameters:**
- `request`: `IndoorDirectionRequest` 
- `callback`: `(directions: IndoorDirectionResult) => void` 

**Return Type** : `void`

Gets indoor directions

#### `feature`

`feature(venueId, featureId, callback)`

**Parameters:**
- `venueId`: `string` 
- `featureId`: `number` 
- `callback`: `(feature: GeoJSONFeature) => void` 

**Return Type** : `void`

Gets feature by feature id

#### `autocomplete`

`autocomplete(venueId, query, callback, ref?, id?, fromLocation?, advancedFilter?, maxResponses?)`

**Parameters:**
- `venueId`: `string` 
- `query`: `string` 
- `callback`: `(predictions: Predictions) => any` 
- `ref`: `(string | null)` 
- `id`: `(string | null)` 
- `fromLocation`: `(string | null)` 
- `advancedFilter`: `(string | null)` 
- `maxResponses`: `(number | null)` 

**Return Type** : `void`

Autocomplete for pois

  

## IndoorWidget class

`woosmap.map.IndoorWidget`

### Constructor

#### `IndoorWidget`

`IndoorWidget(widgetOptions?, rendererOptions?)`

**Parameters:**
- `widgetOptions`: `IndoorWidgetOptions` IndoorWidgetOptions
- `rendererOptions`: `IndoorRendererOptions` IndoorRendererOptions

Creates a new Indoor widget.

  

### Methods

#### `setMap`

`setMap(map)`

**Parameters:**
- `map`: `Map` 

**Return Type** : `void`

Sets the map where to render the Indoor widget.

#### `setVenue`

`setVenue(venueId)`

**Parameters:**
- `venueId`: `string` 

**Return Type** : `void`

Renders map with the selected venue

#### `highlightFeature`

`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`

`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`

`unselectFeature()`

**Parameters:** None

**Return Type** : `void`

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

#### `setDirections`

`setDirections(directions?)`

**Parameters:**
- `directions`: `(IndoorDirectionResult | null)` 

**Return Type** : `void`

Call this function to draw a polyline on map.

#### `setUnits`

`setUnits(units)`

**Parameters:**
- `units`: `"imperial"` 

**Return Type** : `void`

Sets the distance units.

#### `getUnits`

`getUnits()`

**Parameters:** None

**Return Type** : `"imperial"`

Gets the distance units.

#### `setDirectionsMode`

`setDirectionsMode(profile)`

**Parameters:**
- `profile`: `string` 

**Return Type** : `void`

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

#### `getDirectionsMode`

`getDirectionsMode()`

**Parameters:** None

**Return Type** : `(string | null)`

Gets the distance units.

#### `setBaseFilter`

`setBaseFilter(filter?)`

**Parameters:**
- `filter`: `(string | null)` 

**Return Type** : `void`

Sets the baseFilter.

#### `getBaseFilter`

`getBaseFilter()`

**Parameters:** None

**Return Type** : `(string | null)`

Gets the baseFilter

#### `setUserLocation`

`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`

`setNavigationMode(allowNavigation)`

**Parameters:**
- `allowNavigation`: `boolean` 

**Return Type** : `void`

Sets the navigation mode

#### `getNavigationMode`

`getNavigationMode()`

**Parameters:** None

**Return Type** : `boolean`

Gets the navigates mode

#### `getAutocompleteWithDistance`

`getAutocompleteWithDistance()`

**Parameters:** None

**Return Type** : `boolean`

Gets the autocompleteWithDistance option

#### `getAutocompleteMaxResponses`

`getAutocompleteMaxResponses()`

**Parameters:** None

**Return Type** : `number`

Gets the autocomplete’s maxResponses option value if set to determine the number of search suggestions to retrieve. The default value is 5 and the maximum limit is 10.

#### `setTheme`

`setTheme(theme)`

**Parameters:**
- `theme`: `string` Theme name

**Return Type** : `void`

Renders map with custom theme

#### `setZonesToAvoid`

`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`

`getZonesToAvoid()`

**Parameters:** None

**Return Type** : `(string | null)`

Gets the zones to avoid while routing

#### `setIsAutofocusDisabled`

`setIsAutofocusDisabled(disableFocus)`

**Parameters:**
- `disableFocus`: `boolean` 

**Return Type** : `(boolean | null)`

Sets whether to disable the autofocus for the search input.

#### `getIsAutofocusDisabled`

`getIsAutofocusDisabled()`

**Parameters:** None

**Return Type** : `boolean`

Gets whether auto focus on search input is enabled/disabled

#### `setFloor`

`setFloor(floor)`

**Parameters:**
- `floor`: `number` 

**Return Type** : `void`

Sets the floor for the venue

#### `getRenderer`

`getRenderer()`

**Parameters:** None

**Return Type** : `IndoorRenderer`

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

#### `addListener`

`addListener(eventName, handler)`

**Parameters:**
- `eventName`: `string` 
- `handler`: `any` 

**Return Type** : `MapEventListener`

Adds a listener for eventName.

#### `trigger`

`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.

#### `showItinerary`

`showItinerary(origin?, destination?)`

**Parameters:**
- `origin`: `GeoJSONFeature` Origin can be any of the following, A GeoJSON feature or string of coordinates in the format(lat,lng,level) or user’s current location
- `destination`: `GeoJSONFeature` Destination can be any of the following, A GeoJSON feature or string of coordinates in the format(lat,lng,level) or user’s current location

Opens the widget’s panel in itinerary mode.

  

## Building Interface

Building of a venue.

### Properties

#### `cover?`

**Type** : ` (string | null)`

#### `description?`

**Type** : ` (string | null)`

#### `levels`

**Type** : ` Level[]`

#### `localized_name?`

**Type** : ` ({} | null)`

#### `logo?`

**Type** : ` (string | null)`

#### `name?`

**Type** : ` (string | null)`

#### `opening_hours?`

**Type** : ` (string | null)`

#### `ref?`

**Type** : ` (string | null)`
  

## Prediction Interface

Autocomplete predictions

### Properties

#### `building?`

**Type** : ` (string | null)`

#### `distance?`

**Type** : ` (number | null)`

#### `id`

**Type** : ` number`

#### `level`

**Type** : ` number`

#### `name`

**Type** : ` string`

#### `ref?`

**Type** : ` (string | null)`
  

## Predictions Interface

Collection of poi predictions

### Properties

#### `predictions`

**Type** : ` Prediction[]`

#### `type`

**Type** : ` "Array"`
  

## IndoorDirectionLeg Interface

Indoor directions leg.

### Properties

#### `distance`

**Type** : ` IndoorDistance`

#### `duration`

**Type** : ` IndoorDuration`

#### `end_location`

**Type** : ` LatLngLevel`

#### `start_location`

**Type** : ` LatLngLevel`

#### `steps`

**Type** : ` IndoorStep[]`
  

## IndoorDirectionRequest Interface

Request to get directions between an origin and a destination.

### Properties

#### `avoid?`

**Type** : ` (string | null)`

#### `destination?`

**Type** : ` (LatLng | null)`

#### `destinationId`

**Type** : ` (number | null)`

#### `destinationLevel?`

**Type** : ` (number | null)`

#### `language?`

**Type** : ` (string | null)`

#### `mode?`

**Type** : ` (string | null)`

#### `optimize?`

**Type** : ` (boolean | null)`

#### `origin?`

**Type** : ` (LatLng | null)`

#### `originId`

**Type** : ` (number | null)`

#### `originLevel?`

**Type** : ` (number | null)`

#### `units`

**Type** : ` "metric"`

#### `venueId`

**Type** : ` string`

#### `waypoints?`

**Type** : ` (string | null)`
  

## IndoorDirectionResult Interface

Indoor directions result.

### Properties

#### `routes`

**Type** : ` IndoorDirectionRoute[]`
  

## IndoorDirectionRoute Interface

Indoor directions route.

### Properties

#### `bounds`

**Type** : ` IndoorDirectionsBounds`

#### `legs`

**Type** : ` IndoorDirectionLeg[]`
  

## IndoorDirectionsBounds Interface

Type: `number[]`

Indoor directions bounds.

## IndoorDirectionsIcons Interface

Icons to indicate origin and destination on route

### Properties

#### `destinationIcon?`

**Type** : ` IndoorRendererOptionsIcon`

#### `originIcon?`

**Type** : ` IndoorRendererOptionsIcon`
  

## IndoorDistance Interface

Indoor distance object.

### Properties

#### `text`

**Type** : ` string`

#### `value`

**Type** : ` number`
  

## IndoorDuration Interface

Indoor duration object.

### Properties

#### `text`

**Type** : ` string`

#### `value`

**Type** : ` number`
  

## IndoorInstruction Interface

Indoor instruction object.

### Properties

#### `instruction_type`

**Type** : ` string`

#### `summary`

**Type** : ` string`
  

## IndoorPolylineOptions Interface

Indoor polyline customisation options

### Properties

#### `color?`

**Type** : ` string`

#### `highlightColor?`

**Type** : ` string`

#### `strokeColor?`

**Type** : ` string`
  

## IndoorPosition Interface

Position indoor.

### Properties

#### `adjusted?`

**Type** : ` (boolean | null)`

#### `bearing?`

**Type** : ` (number | null)`

#### `forceFocus?`

**Type** : ` (boolean | null)`

#### `level`

**Type** : ` number`

#### `position`

**Type** : ` LatLngLiteral`
  

## IndoorRendererOptions Interface

Options to configure the Indoor Renderer.

### Properties

#### `baseFilter?`

**Type** : ` string`

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

#### `centerMap?`

**Type** : ` boolean`

Center the map on the venue when initializing.

#### `defaultFloor?`

**Type** : ` number`

Set default floor for the venue

#### `directionsIcons?`

**Type** : ` IndoorDirectionsIcons`

Icons to indicate origin and destination on the route

#### `forceExtrusion?`

**Type** : ` boolean`

Force the extrusion to be always visible.

#### `hideLevelSelector?`

**Type** : ` boolean`

Hide the level selector

#### `highlightPOI?`

**Type** : ` string`

Renders map with a POI selected by pk or id

#### `highlightPOIByRef?`

**Type** : ` string`

Renders map with a POI selected by ref

#### `icon?`

**Type** : ` IndoorRendererOptionsIcon`

Sets custom icon for venue markers

#### `levelSelectorPosition?`

**Type** : ` "auto"`

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

#### `polylineOptions?`

**Type** : ` IndoorPolylineOptions`

Customise the appearance of the indoor polyline/route. Acceptable values for custom colors are in in hexadecimal or RGB format.

- `color`: Define color of the polyline path.
- `highlightColor`: Set a custom color to highlight a step of a polyline.
- `strokeColor`: Specify a custom color for the polyline stroke.

#### `responsive?`

**Type** : ` "mobile"`

Enforces the view of the renderer.

#### `showRoutingPaths?`

**Type** : ` boolean`

Show the routing paths

#### `snapToVenueBounds?`

**Type** : ` boolean`

If the map pans out of the venue boundaries reset the map to venue bounds.

#### `theme?`

**Type** : ` string`

Renders map with the custom theme provided.

#### `useInfoWindow?`

**Type** : ` boolean`

Display an infowindow to highlight a selected POI

#### `venue?`

**Type** : ` string`

Set default venue

  

## IndoorRendererOptionsIcon Interface

Icons to use to display venues on the map.

### Properties

#### `anchor?`

**Type** : ` {x: number, y: number}`

#### `scaledSize`

**Type** : ` {height: number, width: number}`

#### `url`

**Type** : ` string`
  

## IndoorStep Interface

Indoor directions step.

### Properties

#### `bearing_end`

**Type** : ` number`

#### `bearing_start`

**Type** : ` number`

#### `distance`

**Type** : ` IndoorDistance`

#### `duration`

**Type** : ` IndoorDuration`

#### `end_location`

**Type** : ` LatLngLevel`

#### `instruction?`

**Type** : ` (IndoorInstruction | null)`

#### `polyline`

**Type** : ` PolylineCoords`

#### `start_location`

**Type** : ` LatLngLevel`
  

## IndoorWidgetAutocompleteOptions Interface

Widget’s autocomplete options

### Properties

#### `autocompleteWithDistance`

**Type** : ` boolean`

If set true, search responses will be retrived with distance from the user’s location

#### `baseFilter`

**Type** : ` string`

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

#### `disableAutoFocus?`

**Type** : ` boolean`

Sets whether to disable the autofocus for the search input.

#### `maxResponses`

**Type** : ` number`

Number of search responses to retrieve. Default is 5 and the maximum limit is 10.

  

## IndoorWidgetOptions Interface

Options of the Indoor widget.

### Properties

#### `autocomplete?`

**Type** : ` IndoorWidgetAutocompleteOptions`

A set of optional autocomplete options to enrich the autocomplete backend request.

#### `autocompleteWithDistance?`

**Type** : ` boolean`

#### `avoidZones?`

**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`

#### `baseFilter?`

**Type** : ` string`

#### `directionsMode?`

**Type** : ` string`

Set directions mode/routing profile

#### `navigationMode?`

**Type** : ` boolean`

Sets whether to enable/disable navigation mode.

#### `ui?`

**Type** : ` IndoorWidgetOptionsui`

Set the custom colors of the indoor widget

#### `units?`

**Type** : ` "imperial"`

Set units to use to show distance in directions itinerary

  

## IndoorWidgetOptionsui Interface

UI Option of the Indoor widget.

### Properties

#### `primaryColor`

**Type** : ` string`

#### `secondaryColor`

**Type** : ` string`
  

## LatLngLevel Interface

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

### Properties

#### `lat`

**Type** : ` number`

#### `level`

**Type** : ` number`

#### `lng`

**Type** : ` number`
  

## Level Interface

Level of a Venue

### Properties

#### `bbox`

**Type** : ` number[]`

#### `level`

**Type** : ` number`

#### `name?`

**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

#### `bbox`

**Type** : ` number[]`

#### `buildings?`

**Type** : ` (Building[] | null)`

#### `categories?`

**Type** : ` (string[] | null)`

#### `levels`

**Type** : ` Level[]`

#### `name?`

**Type** : ` (string | null)`

#### `routing_profiles?`

**Type** : ` (string[] | null)`

#### `venue_id`

**Type** : ` string`
  

## VenuesResult Interface

List of venues.

### Properties

#### `venues`

**Type** : ` Venue[]`
