关于在iOS中的Google地图SDK上跟踪路线 [英] About tracing routes on Google Maps SDK in iOS

查看:99
本文介绍了关于在iOS中的Google地图SDK上跟踪路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Google Maps SDK for iOS在用户的当前位置和所选目的地之间绘制路线?我读过很多网页,谷歌不允许这样做,这是真的吗?如果是这样的话,Google地图应用程序可以实现这一功能吗?

请分享您的想法。

解决方案

Maps SDK允许您在地图上绘制多段线。请参阅 https://developers.google.com/maps/documentation/ios/shapes



当您从地点A到B查询路线时,Google路线API为您提供多义线。请参阅 https://developers.google.com/maps/documentation/directions/#JSON



我不认为地图SDK可以直接使用方向API给出的格式,但您必须自己处理。看到这个线程的解决方案:



希望这有助于您!

p>

Is it possible to draw routes between the user's current location and the destination chosen, using Google Maps SDK for iOS ? I've read in many webpages that google does not allow this, is that true ? If so, how it comes that this is possible with the Google Maps app for iPhone ?

Please share your thoughts.

解决方案

The Maps SDK allows you to draw Polylines on your map. See https://developers.google.com/maps/documentation/ios/shapes

The Google Directions API gives you Polylines when you query directions from location A to B. See https://developers.google.com/maps/documentation/directions/#JSON

I don't think the Maps SDK can directly use the format given by the Direction API though, you will have to handle this yourself. See this thread for a solution to this : How to decode the Google Directions API polylines field into lat long points in objective-C for iPhone?

Hope this helps!

这篇关于关于在iOS中的Google地图SDK上跟踪路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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