1.0.0 • Published 4 years ago

leaflet-routing-machine-locationiq v1.0.0

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Leaflet Routing Machine / Locationiq

Extends Leaflet Routing Machine with support for Locationiq directions API.

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

Installing

npm install --save leaflet-routing-machine-locationiq

Using

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

L.Routing.control({
    router: new L.Routing.Locationiq('your api key'),
}).addTo(map);

Note that you will need to pass a valid Locationiq Api key to the constructor.

This is forked version based on OSRMv1 perliedman