我在响应对象中从浏览器中mapbox的方向API请求方向
我得到了方向的几何图形,但格式未知 上面的图片显示了我得到的响应,我想要这些格式的响应我在响应对象中从浏览器中mapbox的方向API请求方向,mapbox,mapbox-gl,Mapbox,Mapbox Gl,我得到了方向的几何图形,但格式未知 上面的图片显示了我得到的响应,我想要这些格式的响应 "coordinates": [ [ -73.917114, 40.770058
"coordinates": [
[
-73.917114,
40.770058
]
],
"type": "LineString"
} ```
my code for map & direction initialization :
``` var map = new mapboxgl.Map({
container: "map", // Specify the container ID
style: "mapbox://styles/mapbox/light-v10", // Specify which map style to use
center: [-84.5, 38.05], // Specify the starting position [lng, lat]
zoom: 11 ,// Specify the starting zoom
geometries: "geojson"
});
var directions = new MapboxDirections({
accessToken: mapboxgl.accessToken,
unit: "metric",
profile: "mapbox/driving",
alternatives: false,
geometries: "geojson",
controls: { instructions: false },
flyTo: false
});```
虽然几何图形中从未明确说明。它可以用这个来解码