Google Map route dragging becomes unstable when suppressMarkers is set to true

邮差的信 提交于 2019-12-07 02:02:27

问题


I have a Google Map where I can add multiple points/stops(waypoints) between source and destination route.

After the route is created (google.maps.DirectionsService) and put on the map (google.maps.DirectionsRenderer), you can drag the route middle-points to adjust the route as you wish -- draggable=true is set in the constructor of DirectionsRenderer.

   directionsDisplay = new google.maps.DirectionsRenderer({
    suppressMarkers: true,
    draggable:true
});

The problem is when I change the route between two stops by dragging and later i again want to change the route by dragging same changed route point, it doesn't allow me.

But if I set suppressMarkers: false, then it works good. Since I have to place custom marker I cannot mark suppressMarkers to true.

Any help would be highly appreciated.

来源:https://stackoverflow.com/questions/45769485/google-map-route-dragging-becomes-unstable-when-suppressmarkers-is-set-to-true

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!