Package Exports
- trackasia-gl-directions
- trackasia-gl-directions/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (trackasia-gl-directions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mapbox GL Directions
A full featured directions plugin for Mapbox GL JS using the Mapbox Directions API. Quickly add UI to display driving, cycling, or walking directions on the map. The Mapbox Directions API is powered by the OSRM routing engine and open data from the OpenStreetMap project.
For directions functionality in native mobile and desktop applications, see Mapbox Android Services, TrackAsiaDirections.swift, and MapboxNavigation.swift.
Usage
var trackasiagl = require('mapbox-gl');
var TrackAsiaDirections = require('@mapbox/mapbox-gl-directions');
var directions = new TrackAsiaDirections({
accessToken: 'YOUR-MAPBOX-ACCESS-TOKEN',
unit: 'metric',
profile: 'drive'
});
var map = new trackasiagl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v12'
});
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.