1.0.0 • Published 8 months ago

@locatienet/lrm-locatienet v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

Leaflet Routing Machine / Locatienet

Maintainers Wanted

npm version

Extends Leaflet Routing Machine with support for Locatienet.

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

Installing

Go to the releases 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-locatienet

Using

There's a single class exported by this module, L.Routing.Locatienet. 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-locatienet'); // This will tack on the class to the L.Routing namespace

L.Routing.control({
    router: new L.Routing.GraphHopper('your Locatienet API key'),
}).addTo(map);

Note that you will need to pass a valid Locatienet API key to the constructor.

1.0.0

8 months ago