MKPolygon覆盖整个地球 [英] MKPolygon to cover entire earth

查看:116
本文介绍了MKPolygon覆盖整个地球的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个MKPolygon,它将覆盖整个地球,但是找不到正确的坐标.

I'm trying to create an MKPolygon that will cover the entire earth, but can't find the right coordinates.

我的代码如下:

CLLocationCoordinate2D pathCoords[5]={
    CLLocationCoordinate2DMake(0,-90),
    CLLocationCoordinate2DMake(0,90),
    CLLocationCoordinate2DMake(-180,90),
    CLLocationCoordinate2DMake(180,-90),
    CLLocationCoordinate2DMake(0,-90),
};

MKPolygon *result = [MKPolygon polygonWithCoordinates:pathCoords count:5];

我发现这篇文章可以提供帮助:

I've found this article that can help: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.db2.luw.spatial.topics.doc/doc/geodnew1039296.html

但是使用这些协调产生的结果在mapKit中完全不同.

But using those coordinated yields totaly different results in mapKit.

任何人都可以帮忙吗?

推荐答案

对于任何有兴趣的人, Anna 是正确的,可以解决问题的代码:

For anyone interested, Anna was right, the code that solves the problem:

CLLocationCoordinate2D worldCoords[6] = { {90, 0}, {90, 180}, {-90,180}, {-90,0}, {-90,-180}, {90,-180} };

(通过 SaltyNuts )

这篇关于MKPolygon覆盖整个地球的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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