Calculate a route between two points
client.routing.route(RoutingRouteParams { destination, origin, mode } body, RequestOptionsoptions?): RouteResult { geometry, properties, type }
POST/api/v1/route
Calculate a route between two points
import Plaza from '@plazafyi/sdk';
const client = new Plaza({
apiKey: process.env['PLAZA_API_KEY'], // This is the default and can be omitted
});
const routeResult = await client.routing.route({
destination: { coordinates: [0], type: 'Point' },
origin: { coordinates: [0], type: 'Point' },
});
console.log(routeResult.geometry);