Skip to content
Support for GeoPortail in Leaflet Routing Machine
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
dist
src
.eslintrc.json
.gitignore
LICENSE.md
README.md
index.html
package-lock.json
package.json

README.md

Leaflet Routing Machine / GeoPortail

npm version

Extends Leaflet Routing Machine with support for GeoPortail.

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, Leaflet Routing Machine and GeoPortail have been loaded.

To use with for example Browserify:

npm install --save lrm-geoportail

Using

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

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

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

Credits

This projet is a complete rip-off of Per Liedman's lrm-graphhopper module.

You can’t perform that action at this time.