README
Leaflet Routing Machine / GeoPortail
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.