高德地图

https://lbs.amap.com/api/wx/summary

高德地图帮您在应用中获取高德丰富的地址描述、POI和实时天气数据。

https://ext.dcloud.net.cn/plugin?id=4

import amap from ‘@/components/amap-wx/lib/amap-wx.js’;
然后使用:
var myAmapFun = new amap.AMapWX({ key: ‘b526b09b86cd2996e7732be8ab8c4430’ });
myAmapFun.getDrivingRoute({
origin: strpoint,
destination: endpoint,
waypoints: midpoints,
success: function(data) {
if (data.paths && data.paths[0] && data.paths[0].steps) {
var steps = data.paths[0].steps;
for (var i = 0; i < steps.length; i++) {
var poLen = steps[i].polyline.split(‘;’);
for (var j = 0; j < poLen.length; j++) {
points.push({
latitude: parseFloat(poLen[j].split(‘,’)[1]),
longitude: parseFloat(poLen[j].split(‘,’)[0])
});
}
}
}
},
fail: function(info) {}
});

作者:Jeebiz  创建时间:2023-02-25 01:32
最后编辑:Jeebiz  更新时间:2023-02-25 01:45