在Google地图上显示Google Directions API的数据

时间:2014-02-01 20:29:51

标签: google-maps

我从Google Directions API获得了JSON数据。如何使用Google Maps API在地图上显示此路线?

2 个答案:

答案 0 :(得分:0)

查看我在这个主题上写的这篇博文,它将准确解释如何实现您的目标:

Google Maps: Draw Driving Direction on Map:

您可以使用代码和示例项目。

答案 1 :(得分:0)

使用Google Maps Javascript API v3 DirectionsServiceDirectionsRenderer,您可以避免从Google Directions API获取JSON数据(Google Maps Javascript API v3 DirectionsService会返回DirectionRenderer可以直接显示的JSON结果)。< / p>

请参阅此example from the documentation