本文介绍了如何使用Google路线服务获取不同运输方式的多个航点的路线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我了解如何使用Google路线服务添加航点并更改交通模式,但是是否可以使用相同的API调用进行操作?

So I understand how to use the Google Directions service to add waypoints and to change the transit mode but is it possible to do both with the same API call?

我试图获得将涉及步行,然后骑自行车,然后再走一些路线的方向,但我不确定如何使用一个API调用来做到这一点。我知道我可以将它分成几部分,但它会迫使我使用setDirections方法处理Google的响应。

I'm trying to get directions that will involve walking, then biking, and then some more walking but I'm not sure how to do it using one API call. I know I can split it up into a few but it will then force me to process Google's response vs using the setDirections method.

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

These are the docs I'm going from: https://developers.google.com/maps/documentation/javascript/directions

推荐答案

目前还没有。

你为什么这么说?除非您想做一些特别的事情,否则您应该可以使用DirectionsRenderer将多次调用的结果显示给DirectionsService,方法是将它们组合或对不同的方块使用不同的DirectionRenderer对象。

Why do you say that? Unless you want to do something special, you should be able to use the DirectionsRenderer to display the results from multiple calls to the DirectionsService either by combining them or using different DirectionRenderer objects for the different pieces.

这篇关于如何使用Google路线服务获取不同运输方式的多个航点的路线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 01:10