This package has been deprecated

Author message:

This module is now under the @mapbox namespace: install @mapbox/mapbox-gl-directions instead

mapbox-gl-directions

3.0.3 • Public • Published

Mapbox GL Directions

A full featured directions plugin for mapbox-gl-js using the Mapbox Directions API.

Usage

var mapboxgl = require('mapbox-gl');
var MapboxDirections = require('mapbox-gl-directions');
 
var directions = new MapboxDirections({
  accessToken: 'YOUR-MAPBOX-ACCESS-TOKEN',
  unit: 'metric',
  profile: 'cycling'
});
 
var map = new mapboxgl.Map({
  container: 'map',
  style: 'mapbox://styles/mapbox/streets-v9'
});
 
map.addControl(directions, 'top-left');

Live example: https://www.mapbox.com/mapbox-gl-js/example/mapbox-gl-directions/

Deeper dive

See API.md for complete reference.

Contributing

See CONTRIBUTING.md.

Package Sidebar

Install

npm i mapbox-gl-directions

Weekly Downloads

127

Version

3.0.3

License

ISC

Last publish

Collaborators

  • mapbox-admin