CLLocationCoordinate2D计算距离当前坐标n米远的新坐标
static const CGFloat Ea = 6378137;
static const CGFloat Eb = 6356725;
/// 计算距离 coordinate distances angle 的 coordinate
/// @param coordinate 源coordinate
/// @param distance 距离
/// @param angle 角度
+ (CLLocationCoordinate2D)newCoordinateWith:(CLLocationCoordinate2D) coordinate offDistances:(CLLocationDistance) distance angle:(CGFloat)angle{
CGFloat dx = distance * sin(angle * M_PI / 180.0);
CGFloat dy = distance * cos(angle * M_PI / 180.0);
CGFloat ec = Eb + (Ea - Eb) * (90.0 - coordinate.latitude)/90.0;
CGFloat ed = ec * cos(coordinate.latitude * M_PI/180);
CGFloat newLon = (dx/ ed + coordinate.longitude * M_PI / 180.0) * 180.0 / M_PI;
CGFloat newLat = (dy/ ec + coordinate.latitude * M_PI / 180.0) * 180.0 / M_PI;
return CLLocationCoordinate2DMake(newLat, newLon);
}
参考https://www.cnblogs.com/softfair/p/lat_lon_distance_bearing_new_lat_lon.html