New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

lrm-mapbox

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lrm-mapbox

Support for Mapbox directions API in Leaflet Routing Machine

latest
npmnpm
Version
1.0.4
Version published
Weekly downloads
45
-26.23%
Maintainers
1
Weekly downloads
 
Created
Source

Leaflet Routing Machine / Mapbox

npm version

Extends Leaflet Routing Machine with support for Mapbox's directions API.

See the lrm-mapbox demo

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

Installing

Go to the download 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-mapbox

Using

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

L.Routing.control({
    router: new L.Routing.Mapbox('your mapbox access token'),
}).addTo(map);

Note that you will need to pass a valid Mapbox access token to the constructor.

Keywords

leaflet

FAQs

Package last updated on 05 May 2016

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