Indoor Direction Service

How to calculate and display the shortest route between 2 locations

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 (indoorService.directions()) and display the route on the map thanks to the setDirection() method of the IndoorRenderer.

8 parameters are available to provide a suitable navigation experience to your user:

Field Type Mandatory Default Description
venueId String X   Id of the Venue
origin LatLng X   Origin coordinate
originLevel Integer X   Origin floor level
destination LatLng X   Destination coordinate
destinationLevel Integer X   Destination floor level
language String   en Language for instructions
unit String   metric Distance value unit
mode String   null Routing profile for using suitable path only
avoid String   null Exclude one/multiple zone from the walkbale network of the venue, expected zone format level;lat,lng;lat,lng; ... ;lat,lng

Here a code sample following by a working sample of the Parisian railway station - Gare du Nord:

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

indoorService.directions(
  {
        venueId: indoorRenderer.getVenue().venue_id,
        origin: new woosmap.map.LatLng(x.latlng),
        originLevel: 0,
        destination: new woosmap.map.LatLng(y.latlng),
        destinationLevel: 0,
        language: "en",
        units: "metric",
        mode: "wheelchair"
      },
      (result) => {
        indoorRenderer.setDirections(result);
      }
);

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