在Google地图上显示来自Google Directions API的数据 [英] Show data from Google Directions API on Google Maps
问题描述
我从Google Directions API获取了JSON数据。如何使用Google Maps API在地图上显示此路线? 使用使用 Google Maps Javascript API v3 DirectionsService 和 DirectionsRenderer ,您可以避免从Google Directions API获取JSON数据(Google Maps Javascript API v3 DirectionsService会返回DirectionRenderer可以直接显示的JSON结果)。
请参阅此示例从文档
I've got the JSON data from Google Directions API. How can I show this route on map using Google Maps API?
Using the Google Maps Javascript API v3 DirectionsService and DirectionsRenderer, you can avoid getting the JSON data from the Google Directions API (the Google Maps Javascript API v3 DirectionsService returns a JSON result that the DirectionRenderer can display directly).
See this example from the documentation
这篇关于在Google地图上显示来自Google Directions API的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!