var that = this;
AMap.plugin(["AMap.Driving"], function () {
var drivingOption = {
policy: AMap.DrivingPolicy.LEAST_TIME,
};
var driving = new AMap.Driving(drivingOption); //构造驾车导航类
driving.search(
new AMap.LngLat(that.positionLng, that.positionLat),
new AMap.LngLat(
that.stationDetail.longitude,
that.stationDetail.latitude
),
function (status, result) {
console.log(result);
driving.searchOnAMAP({
origin: result.origin,
destination: result.destination,
});
}
);
});
点击导航到此处弹出选项,选择高德地图要调起高德app
但是现在仅仅是规划了路线,没有调起app
查了一下资料,driving.searchOnAMAP方法就是调起地图的方法,但是一直没生效,也不报错,高德官网的例子却是正常生效的,不知道哪里出了问题
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…