Skip to main content
Calculate navigation route between origin and destination.

Parameters

PropertyTypeRequiredDescription
searchTypeStringNoRoute type: walk, bus, drive, ride
startLatNumberYesStart latitude
startLngNumberYesStart longitude
endLatNumberYesEnd latitude
endLngNumberYesEnd longitude
successFunctionNoCallback with route
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Code Example

my.calculateRoute({
  searchType: 'drive',
  startLat: 40.7128,
  startLng: -74.0060,
  endLat: 40.7580,
  endLng: -73.9855,
  success: (res) => {
    console.log('Route:', res);
  }
});