var origins = _this.form.onlatitude + ',' + _this.form.onlongitude
var destinations = _this.form.overlatitude + ',' + _this.form.overlongitude
wx.request({
dataType: "jsonp",
jsonp: "callback",
type: "get",
url: `https://router.hereapi.com/v8/routes?transportMode=car&origin=${origins}&destination=${destinations}&return=polyline,summary&apikey=XXXXXXX`,
success: (res) => {
var points = [];
var data = JSON.parse(res.data).routes
console.log(decode.decode(data[0].sections[0].polyline))
var steps = decode.decode(data[0].sections[0].polyline).polyline
for (var i = 0; i < steps.length; i++) {
points.push({
latitude: steps[i][0],
longitude: steps[i][1]
})
console.log(points)
}
_this.polyline = [{
points: points,
color: "#ff0000",
width: 8,
dottedLine: false
}]
}
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。