Calculate a distance matrix between points
client.routing.matrix(RoutingMatrixParams { destinations, origins, mode } body, RequestOptionsoptions?): MatrixResult { distances, durations }
POST/api/v1/matrix
Calculate a distance matrix between 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 matrixResult = await client.routing.matrix({
destinations: { coordinates: [0], type: 'Point' },
origins: { coordinates: [0], type: 'Point' },
});
console.log(matrixResult.distances);{
"distances": [
[
0
]
],
"durations": [
[
0
]
]
}Returns Examples
{
"distances": [
[
0
]
],
"durations": [
[
0
]
]
}