用MKOverLay绘制一条从东到西的路线问题

发布于 2024-11-19 05:56:40 字数 223 浏览 4 评论 0原文

我想在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

删除会话 2024-11-26 05:56:40

我需要查看屏幕截图才能确定,但​​我认为这是底层地图的限制。

I would need to see a screenshot to be sure but I think that is a limitation of the underlying maps.

暖心男生 2024-11-26 05:56:40

我还没有在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文