Giter Club home page Giter Club logo

getpositionpods's Introduction

GetPositionPods

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

image

Requirements

  • info.plist must add some keys : "Privacy - Location When In Use Usage Description" and "Privacy - Location Always and When In Use Usage Description"

Installation

GetPositionPods is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'GetPositionPods'

Usage

Import header and follow deleagate

#import <LQGetLocationInfoVC.h>
@interface ViewController ()<LQGetLocationInfoVCDelegate>

Implement the proxy method

/**
present选择地址的控制器
*/
- (void)presentVC{
    ///这里的ApiKey 是高德开放平台申请的,需要绑定对应的bundle id;具体申请流程请参考'高德开放平台'
    LQGetLocationInfoVC *locationVC = [[LQGetLocationInfoVC alloc]initWithApiKey:@"491fb90b01e62xxx9cf80ec44a14bd03d"];
    locationVC.delegate = self;
    [self presentViewController:[[UINavigationController alloc]initWithRootViewController:locationVC] animated:YES completion:nil];
}

/**
获取地理位置信息
@param latitude 经度
@param longitude 纬度
@param province 省
@param city 市
@param district 行政区
@param position 详细位置信息
*/
- (void)getLocationLatitude:(double)latitude
                  longitude:(double)longitude
                   province:(NSString *)province
                       city:(NSString *)city
                   district:(NSString *)district
                   position:(NSString *)position{
    //这里只是将结果alert出来,方便验证
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"位置信息" message:[NSString stringWithFormat:@"经度:%f;\n纬度:%f;\n%@-%@-%@-%@",latitude,longitude,province,city,district,position] preferredStyle:UIAlertControllerStyleAlert];
    [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    [alert dismissViewControllerAnimated:YES completion:nil];
    }]];
    [self presentViewController:alert animated:YES completion:nil];
}

Author

liuqing, [email protected]

License

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

getpositionpods's People

Contributors

liuqing520it avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.