How IOS locates locations based on latitude and longitude

Source: Internet
Author: User

/**

* Initialize a latitude and longitude structure body

*/

Cllocationcoordinate2d Center = {[Latitudetf.text floatvalue],[longitudetf.text floatvalue]};

/**

* Region represents an area of the map with two fields one is center, which is the latitude and longitude of the central point of the region; Span represents the range of Regoin. It has two fields one is Latitudedelta, the latitude range, south latitude and north latitude plus should have 180 degrees, so its range should be greater than 0 degrees, less than or 180 degrees, and the other is Longitudedelta, representing the longitude range, east and West Plus should have 360 degrees , so its range should be greater than 0 degrees, less than 360 degrees.

*/

Mkcoordinatespan span;

/**

* Set Accuracy

*/

Span.latitudedelta = 0.05;

Span.longitudedelta = 0.05;

Mkcoordinateregion region = {Center,span};

/**

* Jump to Current location

*/

[Mapview setregion:region Animated:yes];

How IOS locates locations based on latitude and longitude

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.