Socket
Book a DemoInstallSign in
Socket

leaflet-routing-machine-here

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leaflet-routing-machine-here

Support for here in Leaflet Routing Machine, including route restrictions

2.1.0
latest
Source
npmnpm
Version published
Weekly downloads
512
22.49%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

leaflet

FAQs

Package last updated on 17 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.