Code Monkey home page Code Monkey logo

hllocation's Introduction

HLLocation

iOS坐标转换和坐标导航工具类

Demonstration

image

支持使用CocoaPods引入, Podfile文件中添加:
pod 'HLLocation', '1.0.0'

如果只想导入坐标转换

pod 'HLLocation/Converter', '1.0.0'

坐标导航基本使用方法:

CLLocationCoordinate2D location = CLLocationCoordinate2DMake(29.563475, 106.583541);
[HLLocationNavigation navToLocation:location
                       locationType:HLLocationTypeBD09
                            address:@"解放碑"
                             fromVC:self];

坐标转换:

/**
 *    @brief    世界标准地理坐标(WGS-84) 转换成 **国测局地理坐标(GCJ-02)<火星坐标>
 *
 *  ####只在**大陆的范围的坐标有效,以外直接返回世界标准坐标
 *
 *    @param     location     世界标准地理坐标(WGS-84)
 *
 *    @return    **国测局地理坐标(GCJ-02)<火星坐标>
 */
+ (CLLocationCoordinate2D)wgs84ToGcj02:(CLLocationCoordinate2D)location;


/**
 *    @brief    **国测局地理坐标(GCJ-02) 转换成 世界标准地理坐标(WGS-84)
 *
 *  ####此接口有1-2米左右的误差,需要精确定位情景慎用
 *
 *    @param     location     **国测局地理坐标(GCJ-02)
 *
 *    @return    世界标准地理坐标(WGS-84)
 */
+ (CLLocationCoordinate2D)gcj02ToWgs84:(CLLocationCoordinate2D)location;


/**
 *    @brief    世界标准地理坐标(WGS-84) 转换成 百度地理坐标(BD-09)
 *
 *    @param     location     世界标准地理坐标(WGS-84)
 *
 *    @return    百度地理坐标(BD-09)
 */
+ (CLLocationCoordinate2D)wgs84ToBd09:(CLLocationCoordinate2D)location;


/**
 *    @brief    **国测局地理坐标(GCJ-02)<火星坐标> 转换成 百度地理坐标(BD-09)
 *
 *    @param     location     **国测局地理坐标(GCJ-02)<火星坐标>
 *
 *    @return    百度地理坐标(BD-09)
 */
+ (CLLocationCoordinate2D)gcj02ToBd09:(CLLocationCoordinate2D)location;


/**
 *    @brief    百度地理坐标(BD-09) 转换成 **国测局地理坐标(GCJ-02)<火星坐标>
 *
 *    @param     location     百度地理坐标(BD-09)
 *
 *    @return    **国测局地理坐标(GCJ-02)<火星坐标>
 */
+ (CLLocationCoordinate2D)bd09ToGcj02:(CLLocationCoordinate2D)location;


/**
 *    @brief    百度地理坐标(BD-09) 转换成 世界标准地理坐标(WGS-84)
 *
 *  ####此接口有1-2米左右的误差,需要精确定位情景慎用
 *
 *    @param     location     百度地理坐标(BD-09)
 *
 *    @return    世界标准地理坐标(WGS-84)
 */
+ (CLLocationCoordinate2D)bd09ToWgs84:(CLLocationCoordinate2D)location;

Requirements

iOS 10.0 +, Xcode 7.0 +

Version

  • 1.0.0 :

    完成HLLocation基础搭建

License

HLLocation is available under the MIT license. See the LICENSE file for more info.

hllocation's People

Contributors

huangchangweng avatar

Stargazers

Livan avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.