0.0.8 • Published 2 years ago

@relive/graphhopper-api-client v0.0.8

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

graphhopper-api-client

A wrapper around the Graphhopper API.

The code is generated from the GraphHopper OpenAPI spec with npm run generate.

Besides this we also support a couple of APIs not in the OpenAPI spec: src/experimentalAPI.ts.

Usage

npm install @relive/graphhopper-api-client

Code:

import * as graphhopper from "@relive/graphhopper-api-client";
import { VehicleProfileId } from '@relive/graphhopper-api-client/build/generated/graphhopper-api/model';

// Endpoint of graphhopper-web
const GRAPHHOPPER_BASE_URI = "http://localhost:8989";

// Execute a routing request
const routingAPI = new graphhopper.RoutingAPIApi(undefined, GRAPHHOPPER_BASE_URI);

const routes = await routingAPI.getRoute({
    point: [
        [52.379189, 4.899431],  // Amsterdam
        [51.9225, 4.47917]      // Rotterdam
    ].map(c => c.join()),
    vehicle: VehicleProfileId.Bike,
    elevation: false
});
0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago