iOS Learning note 8-map development

Source: Internet
Author: User

Two main frameworks

Map Kit for maps

Core Foundation for Geo-positioning

LBS Location based service (targeting-based services)

SoLoMo Social Local Mobile

1.CLLocationManager

Common operations and properties of Cllocationmanager

Start user positioning-(void) startupdatinglocation;

Stop user positioning-(void) stopupdatinglocation;

Note: When the Startupdatinglocation method is called, the user's location is started constantly, and the agent's method is called frequently in the middle

-(void) Locationmanager: (Cllocationmanager *) Manager didupdatelocations: (Nsarray *) locations;

How many meters to locate each time

@property (Assign, nonatomic) cllocationdistance distancefilter;

2.CLLocation

Cllocation the geographic information used to represent a location, such as latitude and longitude, altitude, etc.

(1) Latitude

@property (readonly, nonatomic) Cllocationcoordinate2d coordinate;

(2) Altitude

@property (readonly, nonatomic) cllocationdistance altitude;

(3) Course, course (value range is 0.0°~ 359.9°,0.0° represents true north direction)

@property (readonly, nonatomic) Cllocationdirection course;

(4) Walking speed (unit m/s)

@property (readonly, nonatomic) cllocationspeed speed;

(5) Calculate the distance between 2 positions

-(Cllocationdistance) Distancefromlocation: (const cllocation *) Location method

Positioning accuracy (the more accurate it consumes)

@property (Assign, nonatomic) cllocationaccuracy desiredaccuracy;

3.cllocationcoordinate2d

Cllocationcoordinate2d is a structure used to represent latitude and longitude, defined as follows

typedef struct {

Cllocationdegrees latitude; Latitude

Cllocationdegrees longitude; Longitude

} cllocationcoordinate2d;

The Cllocationcoordinate2dmake function is generally used to create cllocationcoordinate2d

if ([Cllocationmanager locationservicesenabled]) {

[Self.locmgr startupdatinglocation];

Self.locMgr.distanceFilter = Kcldistancefilternone;

Self.locMgr.desiredAccuracy = kcllocationaccuracybestfornavigation;

}

Agent

-(void) Locationmanager: (Cllocationmanager *) Manager didupdatelocations: (nsarray<cllocation *> *) Locations

iOS Learning note 8-map development

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.