问题
I'm trying to create an MKPolygon that will cover the entire earth, but can't find the right coordinates.
my code looks like this:
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
But using those coordinated yields totaly different results in mapKit.
Can anyone help?
回答1:
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} };
(by SaltyNuts)
来源:https://stackoverflow.com/questions/28721497/mkpolygon-to-cover-entire-earth