Giter VIP home page Giter VIP logo

lrm-here's Introduction

Leaflet Routing Machine / HERE

Extends Leaflet Routing Machine with support for Here routing API.

Some brief instructions follow below, but the Leaflet Routing Machine tutorial on alternative routers is recommended.

Installing

npm install --save leaflet-routing-machine-here

Using

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

L.Routing.control({
    router: new L.Routing.Here('your Here api key', { 
        routeRestriction: {
            transportMode: 'truck'
        },
        truckRestriction: {
            height: 300
        },
        urlParameters: { 
            avoid: {
                tollTransponders: 'all'
            }
        } 
    }),
}).addTo(map);

Note that you will need to pass a valid Here apiKey to the constructor.

Options

Property Type Default Options
alternatives number 0
noticesTypeAsRouteError string['critical', 'info'] ['critical']
routeRestriction object
truckRestriction object
urlParameters object {} Available options

RouteRestriction routeRestriction

Property Type Default Options
avoidHighways boolean false
avoidTolls boolean false
avoidFerries boolean false
avoidDirtRoad boolean false
departureTime string any Available options
transportMode string car Available options
routingMode string fast Available options

TruckRestriction truckRestriction

Property Type HumanType Min Max
height int centimeters 0 -
width int centimeters 0 -
length int centimeters 0 -
grossWeight int kilograms 0 -
weightPerAxle int kilograms 0 -
shippedHazardousGoods array Available options
trailerCount int count 0 4

This is forked version based on trailbehind

lrm-here's People

Contributors

daredzik avatar perliedman avatar jessecrocker avatar luizfonseca avatar marucjmar avatar mpalese avatar

Stargazers

Joshua Barua avatar Kevin avatar  avatar  avatar Paweł Niekłań avatar  avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.