用MKOverLay绘制一条从东到西的路线问题
我想在我的 iOS 应用程序中绘制一条从东到西的路线:例如从亚洲到美洲。 问题是我想要在太平洋上画的路线,而不是从亚洲到欧洲到美洲...
问题是从最东点到最西点,有一条水平线...真的很难看:(
你知道如何解决这个问题吗?
我把代码这里
谢谢
I want to draw a route from east to west in my iOS app: for example from Asia to America.
The problem is I want the route drawed on the pacific ocean, and not from asia to europa to america...
the problem is that from the most east point to the most west point, there is an horizontal line... really really ugly :(
Do you know how to solve it?
I took the code here
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我需要查看屏幕截图才能确定,但我认为这是底层地图的限制。
I would need to see a screenshot to be sure but I think that is a limitation of the underlying maps.
我还没有在 iOS 中使用过绘制路线,但我通过绘制两条路线在 OpenLayers 中解决了同样的问题。一种是世界从 0 度到 360 度,另一种是世界从 0 度到 -360 度。因此,如果日本约为 (134,34),旧金山约为 (-122,37),您将在这些点
(134,34) 到 (238, 37) 之间画线
(-226,34) 到 (-122,37)
就像我说的,未经 iOS 测试,但你很快就会知道我是否正确。
I haven't played with drawing routes in iOS but I solved the same problem in OpenLayers by drawing two routes. One as if the world went from 0 to 360 and one as it it went from 0 to -360. So if Japan is about (134,34) and SanFran is about (-122,37) you'd draw lines between these points
(134,34) to (238, 37)
(-226,34) to (-122,37)
Like I said, untested in iOS but it won't take you very long to see if I'm right.