perliedman / lrm-graphhopper

Support for GraphHopper in Leaflet Routing Machine
ISC License
31 stars 52 forks source link

Local installation #1

Closed karussell closed 9 years ago

karussell commented 9 years ago

Hi, thanks a lot for this work! Is it possible to use this against a local installation too? From the readme it looks it supports only the Directions API. Which is of course nice, but there might be demand for a local installation too.

perliedman commented 9 years ago

Yes, good point. Documentation is lacking, but it is possible through options to the constructor:

L.Routing.control({
    router: new L.Routing.GraphHopper('your GraphHopper API key', {
        serviceUrl: 'http://your-own-instance/'
    }),
}).addTo(map);

serviceUrl otherwise defaults to 'https://graphhopper.com/api/1/route'

Will add this once I get to do a more complete readme/docs.

karussell commented 9 years ago

Ah, ok!