Socket
Socket
Sign inDemoInstall

@mapbox/mapbox-gl-directions

Package Overview
Dependencies
9
Maintainers
28
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mapbox/mapbox-gl-directions

A mapboxgl plugin for the Mapbox Directions API


Version published
Weekly downloads
6.4K
decreased by-1.02%
Maintainers
28
Install size
2.47 MB
Created
Weekly downloads
 

Changelog

Source

4.3.1

  • [internal] Improve performance of marker dragging #316

Readme

Source

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, MapboxDirections.swift, and MapboxNavigation.swift.

Usage

var mapboxgl = require('mapbox-gl');
var MapboxDirections = require('@mapbox/mapbox-gl-directions');

var directions = new MapboxDirections({
  accessToken: 'YOUR-MAPBOX-ACCESS-TOKEN',
  unit: 'metric',
  profile: 'mapbox/cycling'
});

var map = new mapboxgl.Map({
  container: 'map'
});

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.

Keywords

FAQs

Last updated on 03 Apr 2024

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc