在Google地图上显示来自Google Directions API的数据 [英] Show data from Google Directions API on Google Maps

查看:127
本文介绍了在Google地图上显示来自Google Directions API的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆