Indoor Direction Service

How to calculate and display the shortest route between 2 locations

  1. Indoor direction service

Woosmap Indoor Js API provides you tools to create an optimized navigation experience:

Indoor direction service

Use the IndoorService class to calculate the shortest route between 2 locations and display the route on the map thanks to the setDirection() method of the IndoorRenderer.

Fetching Indoor Direction API

The indoorService.directions() method expects a JSON object that fits with IndoorDirectionRequest interface. The venue identifier, the origin, and the destination are required.

Choose one of the two following ways to define the origin and destination:

Coordinates (latitude, longitude and floor level)

POI identifier (id or ref)

Displaying the calculated route

The IndoorRenderer provides a method for displaying the calculated route on the map.

Here is a code sample, followed by a live demo in a Parisian railway station:

JavaScript
        const indoorService = new window.woosmap.map.IndoorService();

indoorService.directions(
  {
        venueId: indoorRenderer.getVenue().venue_id,
        origin: new woosmap.map.LatLng(x.latlng),
        originLevel: 0,
        destinationId: "ref:bakery001"
      },
      (result) => {
        indoorRenderer.setDirections(result);
      }
);

    

Advanced usage of the Indoor direction service

Some optional properties allow you to:

Find all these optional properties in the reference page: IndoorDirectionRequest interface

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