gpt4 book ai didi

google-maps - 如何使用 Google 路线服务获取具有不同交通方式的多个航点的路线?

转载 作者:行者123 更新时间:2023-12-04 16:37:45 26 4
gpt4 key购买 nike

所以我了解如何使用 Google Directions 服务来添加航点和更改交通模式,但是否可以使用相同的 API 调用同时进行?

我正在尝试获取涉及步行、骑自行车和再步行的路线,但我不确定如何使用一个 API 调用来实现。我知道我可以把它分成几个,但它会迫使我处理谷歌的响应而不是使用 setDirections 方法。

这些是我要去的文档:https://developers.google.com/maps/documentation/javascript/directions

最佳答案

but is it possible to do both with the same API call?



目前没有。

it will then force me to process Google's response vs using the setDirections method.



你为什么这么说?除非你想做一些特别的事情,否则你应该能够使用 DirectionsRenderer 来显示来自对 DirectionsService 的多次调用的结果,方法是将它们组合起来,或者对不同的部分使用不同的 DirectionRenderer 对象。

关于google-maps - 如何使用 Google 路线服务获取具有不同交通方式的多个航点的路线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16926928/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com