地图地理坐标的相互转换
With CocoaPods, add this line to your Podfile.
pod 'LJMapCoordinateCorrection', '~> 1.0.0'
Manually:
Drag all files under LJMapCoordinateCorrection/Classes
folder into your project.
// 判断是否在中国:
+ (BOOL)isLocationOutOfChina:(CLLocationCoordinate2D)location
// 将WGS-84转为GCJ-02(火星坐标):
+ (CLLocationCoordinate2D)transformFromWGSToGCJ:(CLLocationCoordinate2D)wgsLoc;
// 将GCJ-02(火星坐标)转为百度坐标:
+ (CLLocationCoordinate2D)transformFromGCJToBaidu:(CLLocationCoordinate2D)gcjLoc;
// 将百度坐标转为GCJ-02(火星坐标):
+ (CLLocationCoordinate2D)transformFromBaiduToGCJ:(CLLocationCoordinate2D)bdLoc;
// 将GCJ-02(火星坐标)转为WGS-84:
+ (CLLocationCoordinate2D)transformFromGCJToWGS:(CLLocationCoordinate2D)gcjLoc;
LJMapCoordinateCorrection 使用 MIT 许可证,详情见 LICENSE 文件。