mapbox-gl-directions

Directions plugin for mapbox-gl-js using Mapbox Directions API.

Github星跟踪图

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',
  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.

主要指标

概览
名称与所有者mapbox/mapbox-gl-directions
主编程语言JavaScript
编程语言CSS (语言数: 3)
平台
许可证ISC License
所有者活动
创建于2015-08-25 04:39:46
推送于2025-05-15 14:50:30
最后一次提交
发布数24
最新版本名称v4.3.1 (发布于 )
第一版名称v0.0.0 (发布于 2015-12-02 11:28:37)
用户参与
星数247
关注者数118
派生数129
提交数392
已启用问题?
问题数199
打开的问题数92
拉请求数81
打开的拉请求数21
关闭的拉请求数22
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?