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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?