0

我已经使用谷歌地图 API来获取到具有 3 个不同航点的地点的路线。

我找到了一种将方向作为 JSON 传递给应用程序的方法,并且我知道如何通过腿解析它,但我的问题是如何调用地图来遵循这些方向?它必须遵循谷歌发送的自定义方向,因为它使用他们的旅行推销员算法,并且它必须停在不同的航点。

有任何想法吗?

这是将使用的 JSON 消息的示例

任何帮助,将不胜感激。

谢谢

4

1 回答 1

0

It looks like you just need to input your origin, destination, and waypoints into the directions render service and plot to the map.

Look at this link and scroll down to the waypoint portion.

https://developers.google.com/maps/documentation/javascript/directions#DirectionsRequests

This will show you an example of how to get directions from the directions service.

From looking at your file though if you don't have an actual account that you are paying for with google maps, you are going to hit the 8 waypoint maximum very quickly due to all of your waypoints (lats/longs).

Here is a post that describes how to get around that, but if you have an account it shouldn't be an issue.

Exceed 23 waypoint per request limit on Google Directions API (Business/Work level)

HTH

于 2012-05-12T04:19:16.780 回答