你想要来自 MapKit 的MKMapPointForCoordinate。这会将经纬度对转换为由 x 和 y 定义的平面。查看描述投影的MKMapPoint的文档。然后,您可以根据需要将这些 x,y 对缩放和旋转为 CGPoints 以供显示。(您必须进行试验以了解哪些缩放因子适用于您的游戏。)
要以用户为中心,只需从所有其他对象的点中减去它们的 x 和 y 位置(在 MKMapPoints 中)的值。就像是:
MKMapPoint userPoint = MKMapPointForCoordinate(userCoordinate);
MKMapPoint otherObjectPoint = MKMapPointForCoordinate(otherCoordinate);
otherObjectPoint.x -= userPoint.x; // center around your user
otherObjectPoint.y -= userPoint.y;
CGPoint otherObjectCenter = CGPointMake(otherObjectPoint.x * 0.001, otherObjectPoint.y * 0.001);
// Using (50, 50) as an example for where your user view is placed.
userView.center = CGPointMake(50, 50);
otherView.center = CGPointMake(50 + otherObjectCenter.x, 50 + otherObjectCenter.y);