iOS Location Service corelocation

Source: Internet
Author: User


Welcome to my new blog: Developers say


The application development based on LBS is one of the most popular in mobile development, which mainly involves two aspects of map and location.

In iOS development, location services depend on the Corelocation framework, Cllocationmanager is the core class in Corelocation.

Initialization

if ([cllocationmanagerlocationservicesenabled]) {

self. Locationmanager = [[cllocationmanageralloc]init];

Self. Locationmanager. delegate =self;

self. Locationmanager . Desiredaccuracy =kcllocationaccuracybest;

self. Locationmanager. Distancefilter =Kdistancefilter;

self. Locationmanager. Headingfilter =Kheadingfilter;

self. Locationmanager . pauseslocationupdatesautomatically =YES;

self. Locationmanager . Activitytype =clactivitytypefitness;

}


Desiredaccuracy: To achieve the positioning accuracy, as far as possible to meet the accuracy of the set, but can not be guaranteed in the actual process to achieve.

Distancefilter: Below the horizontal distance is filtered out without generating an update event.


Start Location Services:

[self. Locationmanager startupdatinglocation];

[self. Locationmanager startupdatingheading];


Notifies the agent when it gets to the location information or the location has changed

Get to the new location:

Locationmanager:didupdatelocations

When a change in direction occurs:

Locationmanager:didupdateheading:


For more information, please visit: devsay.com

iOS Location Service corelocation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.