lrm-graphhopper

WebJar for lrm-graphhopper

Лицензия

Лицензия

ISC
Категории

Категории

Github Инструменты разработки Контроль версий GraphHopper Прикладные библиотеки Geospatial
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

github-com-perliedman-lrm-graphhopper
Последняя версия

Последняя версия

1.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

lrm-graphhopper
WebJar for lrm-graphhopper
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/perliedman/lrm-graphhopper

Скачать github-com-perliedman-lrm-graphhopper

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-perliedman-lrm-graphhopper/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-perliedman-lrm-graphhopper</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-perliedman-lrm-graphhopper/
implementation 'org.webjars.npm:github-com-perliedman-lrm-graphhopper:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-perliedman-lrm-graphhopper/
implementation ("org.webjars.npm:github-com-perliedman-lrm-graphhopper:1.2.0")
'org.webjars.npm:github-com-perliedman-lrm-graphhopper:jar:1.2.0'
<dependency org="org.webjars.npm" name="github-com-perliedman-lrm-graphhopper" rev="1.2.0">
  <artifact name="github-com-perliedman-lrm-graphhopper" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-perliedman-lrm-graphhopper', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-perliedman-lrm-graphhopper" % "1.2.0"
[org.webjars.npm/github-com-perliedman-lrm-graphhopper "1.2.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : corslite jar 0.0.6
org.webjars.npm : polyline jar 0.0.3

Модули Проекта

Данный проект не имеет модулей.

Leaflet Routing Machine / GraphHopper

Maintainers Wanted

I no longer use this module, and have not done so in a long while. If you use it, please consider taking over maintenance of this module (it's not a lot of work). Because of this situation, I have very limited time and expertise to answer any questions regarding this module

npm version

Extends Leaflet Routing Machine with support for GraphHopper.

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 and Leaflet Routing Machine has been loaded.

To use with for example Browserify:

npm install --save lrm-graphhopper

Using

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

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

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

To keep track of the GraphHopper credits consumption, the application may listen to the response event fired by the Router object. This event holds the values from GraphHopper's response HTTP headers:

  • status: The HTTP status code (see GraphHopper error codes)
  • limit: The X-RateLimit-Limit header
  • remaining: The X-RateLimit-Remaining header
  • reset: The X-RateLimit-Reset header
  • credits: The X-RateLimit-Credits header
var router = myRoutingControl.getRouter();
router.on('response',function(e){
  console.log('This routing request consumed ' + e.credits + ' credit(s)');
  console.log('You have ' + e.remaining + ' left');
});

Версии библиотеки

Версия
1.2.0