@scoova/routing
v1.1.3
Published
Routing client for the Scoova routing gateway (api.scoo-va.info/api/v1/routing) — route, optimizedRoute, isochrone, matrix, height (elevation), mapMatch, locate, status. Polyline6 decode included.
Maintainers
Readme
@scoova/routing
Routing client for routing.scoo-va.info.
npm install @scoova/routingimport { RoutingClient, decodePolyline } from '@scoova/routing';
const client = new RoutingClient({
defaultCosting: 'scooter',
locale: 'ar-EG', // every request gets ?locale=ar-EG + Accept-Language
apiKey: process.env.SCOOVA_API_KEY,
});
const result = await client.route(
[{ lat: 30.04, lon: 31.24 }, { lat: 30.06, lon: 31.25 }],
);
const path = decodePolyline(result.trip.legs[0].shape);Endpoints
route, optimizedRoute, isochrone, matrix, height (alias elevation),
mapMatch, locate, status.
Locale
Set a default locale once on the client and every call carries it as both the
?locale= query parameter and the Accept-Language HTTP header. Per-call
options.locale overrides the client default. The server falls back to en
for any unsupported code.
Tests
npm testRepo: https://github.com/Scoova/scoova-routing-web. License: Apache-2.0.
