1
プロフィールui(交通、運転、歩行、サイクリング)をマップボックスの方向から非表示/削除するオプションはありません。利用可能なオプションはありますか?プロフィールui(交通、運転、歩行、サイクリング)
プロファイルuiセクションエリアのスクリーンショットこれはセクションで、私は私はあなたがcontrols.profileSwitcherパラメータでプロファイルUIを非表示にすることができ、
enableMapboxDirection() {
mapboxgl.accessToken = 'pk.eyJ1Ijoid2FsYWEtbWFwIiwiYSI6ImNqN2VuYmluZjBwZ2UzMnBqM20wNnJieWkifQ.2pKH-XbfOZuXzX9pEqGBjw';
var directions = new MapboxDirections({
accessToken: mapboxgl.accessToken,
controls: {
instructions: false,
},
unit: 'metric',
profile: 'driving',
});
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v9'
});
map.on('load', function() {
directions.on('route', function(e) {
console.log(e); // Logs the current route shown in the interface.
console.log('Your Destination ',directions.getDestination());
console.log('Your Origin ',directions.getOrigin());
});
});
map.addControl(directions, 'top-left');
}