ios-Baidu Map _ the latitude and longitude in the range displayed in the screen

Source: Internet
Author: User

Latitude and longitude of the center point of the current screen

CGFloat centerlongitude = self.mapView.region.center.longitude;

CGFloat centerlatitude = self.mapView.region.center.latitude;

Latitude and longitude of the current screen display range

Cllocationdegrees Pointsslongitudedelta = Self.mapView.region.span.longitudeDelta;

Cllocationdegrees Pointsslatitudedelta = Self.mapView.region.span.latitudeDelta;

Upper left corner

CGFloat leftuplong = centerlongitude-pointsslongitudedelta/2.0;

CGFloat Leftuplati = centerlatitude-pointsslatitudedelta/2.0;

upper right corner

CGFloat Rightuplong = centerlongitude + pointsslongitudedelta/2.0;

CGFloat Rightuplati = centerlatitude-pointsslatitudedelta/2.0;

Lower left corner

CGFloat leftdownlong = centerlongitude-pointsslongitudedelta/2.0;

CGFloat Leftdownlati = centerlatitude + pointsslatitudedelta/2.0;

Lower right corner

CGFloat Rightdownlong = centerlongitude + pointsslongitudedelta/2.0;

CGFloat Rightdownlati = centerlatitude + pointsslatitudedelta/2.0;

NSLog (@ "\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \%f,%f-----\ r%f,%f", Leftuplong,leftuplati,rightuplong,rightu%f,%f--------- Plati,leftdownlong,leftdownlati,rightdownlong,rightdownlati);

ios-Baidu Map _ the latitude and longitude in the range displayed in the screen

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.