在谷歌地图可拖动方向中,您如何识别拖动到的位置

In Google Maps Draggable Directions how do you identify the location dragged to

本文关键字:拖动 识别 位置 何识别 谷歌地图 方向      更新时间:2023-09-26

关于...

https://developers.google.com/maps/documentation/javascript/examples/directions-draggable

并且使用可拖动的

转...
var rendererOptions = {
    draggable: true
};

并使用侦听器...

google.maps.event.addListener(directionsDisplay, 
    'directions_changed', function() {}

我只能通过使用...

result = directionsDisplay.directions;

但我想要的不在这个对象中。

想知道的是我刚刚用来改变路线的点在哪里。因为我想存储这一点,而不是沿途的每一点。

感谢您的任何帮助,因为它是需要的。

找到了。它位于:

directionsDisplay.directions.routes[0].legs[0].via_waypoints;