Need help with TQLocationConverter?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

TinyQ
207 Stars 39 Forks MIT License 21 Commits 0 Opened issues

Description

iOS Converter location WGS-84 GCJ-02 baidu

Services available

!
?

Need anything else?

Contributors list

No Data

TQLocationConverter

English

Location converter

用来相互转换不同标准坐标系

(GCJ-02火星坐标)

(WGS-84 正常GPS坐标)

(百度坐标)

How to use

    //我是个经纬度
    CLLocationCoordinate2D location = (CLLocationCoordinate2D){
        .latitude  = 0.0,
        .longitude = 0.0
    };

//判断是否在中国
if (![TQLocationConverter isLocationOutOfChina:location])
{
    //将WGS-84转为GCJ-02(火星坐标)
    location = [TQLocationConverter transformFromWGSToGCJ:location];

    //将GCJ-02(火星坐标)转为百度坐标
    location = [TQLocationConverter transformFromGCJToBaidu:location];

    //将百度坐标转为GCJ-02(火星坐标)
    location = [TQLocationConverter transformFromBaiduToGCJ:location];

    //将GCJ-02(火星坐标)转为WGS-84
    location = [TQLocationConverter transformFromGCJToWGS:location];
}

NSLog(@"%f,%f",location.latitude,location.longitude);

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.