Google会映射iOS SDK级别的细节折线 [英] Google maps iOS SDK level of detail polylines

查看:108
本文介绍了Google会映射iOS SDK级别的细节折线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google Maps iOS SDK绘制多段线列表。多段线来自服务器,对于每个下一条多段线,起点对应于前一多段线的终点。



我注意到Google地图改变了多段线的细节在不同的缩放级别,可能是一个优化的事情。这导致了较低缩放级别的几条多段线之间的小间隙。



将折线分成几条较小线条的原因不取决于我,这是系统为我定义。我知道我可以将几条多段线组合成一条大折线,但我想知道:SDK是否允许设置这个级别的细节?或者有可能是另一个修复?



缩小,注意差距: b
$ b


几乎完全放大,差距几乎消失:



解决方案

到目前为止我还没有找到答案,所以我所做的是按顺序遍历所有地理坐标(幸运的是,我的数据结构允许这个),将它们收集到一个数组中,按照 https: //gist.github.com/mmdumi/3999640 ,然后使用[GMSPolyLine polylineWithPath:]将其显示在地图上。据我所知,除了使用GEP之外,没有办法实例化GMSPolyLine。


I am using the Google Maps iOS SDK to draw a list of polylines. The polylines come from a server, and for each next polyline, the starting point corresponds with the end point of the previous polyline.

I notice that Google Maps changes the level of detail of the polylines at different zoom levels, probably an optimisation thing. This results in small gaps between the several polylines at lower zoom levels.

The reasons behind splitting a polyline up in several smaller lines are not up to me, this is what the system defines for me. I know I may be able to combine the several polylines into one single large polyline, but I was wondering: does the SDK allow the setting for this level of detail? Or is there maybe another fix?

Zoomed out, notice the gaps:

Almost fully-zoomed in, the gaps are nearly gone:

解决方案

I have found no answer so far, so what I did, was traversing all geo-coordinates in-order (luckily my data-structure allows this), collect them in an array, encode this array to a Google Encoded Polyline (GEP) as per https://gist.github.com/mmdumi/3999640, and then display this on the map using [GMSPolyLine polylineWithPath:]. As far as I can tell, there is no way to instantiate a GMSPolyLine other than using a GEP.

这篇关于Google会映射iOS SDK级别的细节折线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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