Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Daredzik/leaflet-routing-machine-locationiq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published