Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.1k views
in Technique[技术] by (71.8m points)

vue中使用高德地图api,路线规划调起app不生效

image.png
image.png

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方法就是调起地图的方法,但是一直没生效,也不报错,高德官网的例子却是正常生效的,不知道哪里出了问题


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...