2.1.0 • Published 2 years ago

leaflet-routing-machine-here v2.1.0

Weekly downloads
69
License
ISC
Repository
github
Last release
2 years ago

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

PropertyTypeDefaultOptions
alternativesnumber0
noticesTypeAsRouteErrorstring'critical', 'info''critical'
routeRestrictionobject
truckRestrictionobject
urlParametersobject{}Available options

RouteRestriction routeRestriction

PropertyTypeDefaultOptions
avoidHighwaysbooleanfalse
avoidTollsbooleanfalse
avoidFerriesbooleanfalse
avoidDirtRoadbooleanfalse
departureTimestringanyAvailable options
transportModestringcarAvailable options
routingModestringfastAvailable options

TruckRestriction truckRestriction

PropertyTypeHumanTypeMinMax
heightintcentimeters0-
widthintcentimeters0-
lengthintcentimeters0-
grossWeightintkilograms0-
weightPerAxleintkilograms0-
shippedHazardousGoodsarray Available options
trailerCountintcount04

This is forked version based on trailbehind

2.1.0

2 years ago

2.0.0

2 years ago

1.6.1

3 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.2.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago