Bing maps 如何从bing的snap to road api的json响应在bing地图中绘制路线
必应快速上路空气污染指数-Bing maps 如何从bing的snap to road api的json响应在bing地图中绘制路线,bing-maps,bing-api,Bing Maps,Bing Api,必应快速上路空气污染指数- 如何在bing地图上投影响应?您必须将点阵列转换为位置对象的阵列,然后将其传递到多段线,以便在地图上以直线的形式呈现。例如: var coords = []; response.points.forEach(p => { coords.push(new Microsoft.Maps.Location(p.latitude, p.longitude)); }); //Create a polyline var line = new Microsoft.
如何在bing地图上投影响应?您必须将点阵列转换为位置对象的阵列,然后将其传递到多段线,以便在地图上以直线的形式呈现。例如:
var coords = [];
response.points.forEach(p => {
coords.push(new Microsoft.Maps.Location(p.latitude, p.longitude));
});
//Create a polyline
var line = new Microsoft.Maps.Polyline(coords, {
strokeColor: 'red'
});
//Add the polyline to map
map.entities.push(line);
非常感谢你