@routingjs/osrm
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

RoutingJS: OSRM

Promise-based web client for the Open Source Routing Machine.

Example

import { OSRM } from "@routingjs/osrm"

const osrm = new OSRM() // URL defaults to https://routing.openstreetmap.de/routed-bike
osrm.directions([
    [8.512516, 47.380742],
    [8.557835, 47.359467],
]).then((d) => {
    // do stuff with the directions response
    d.directions.forEach((direction) => {
        console.log(direction.feature)
    })
})

Installation

npm install @routingjs/osrm

This package is part of the RoutingJS project, which aims to provide consistent access to various vehicle routing APIs.

/@routingjs/osrm/

    Package Sidebar

    Install

    npm i @routingjs/osrm

    Weekly Downloads

    100

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    69 kB

    Total Files

    19

    Last publish

    Collaborators

    • routingjs