关于在iOS中的Google地图SDK上跟踪路线 [英] About tracing routes on Google Maps SDK in iOS
问题描述
是否可以使用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屋!