Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Latest commit

 

History

History
33 lines (21 loc) · 1.35 KB

README.md

File metadata and controls

33 lines (21 loc) · 1.35 KB

Leaflet Routing Machine / HERE

Extends Leaflet Routing Machine with support for Here routing API.

Some brief instructions follow below, but the Leaflet Routing Machine tutorial on alternative routers is recommended.

Installing

Go to the download page to get the script to include in your page. Put the script after Leaflet and Leaflet Routing Machine has been loaded.

To use with for example Browserify:

npm install --save lrm-here

Using

There's a single class exported by this module, L.Routing.Here. It implements the IRouter interface. Use it to replace Leaflet Routing Machine's default OSRM router implementation:

var L = require('leaflet');
require('leaflet-routing-machine');
require('lrm-here'); // This will tack on the class to the L.Routing namespace

L.Routing.control({
    router: new L.Routing.Here('your Here app id', 'your Here app code'),
}).addTo(map);

Note that you will need to pass a valid Here app code and app id to the constructor.