zoukankan      html  css  js  c++  java
  • iOS-百度地图_屏幕所显示范围内的经纬度

      //当前屏幕中心点的经纬度

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

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

        //当前屏幕显示范围的经纬度

        CLLocationDegrees pointssLongitudeDelta = self.mapView.region.span.longitudeDelta;

        CLLocationDegrees pointssLatitudeDelta = self.mapView.region.span.latitudeDelta;

       

        //左上角

        CGFloat leftUpLong = centerLongitude - pointssLongitudeDelta/2.0;

        CGFloat leftUpLati = centerLatitude - pointssLatitudeDelta/2.0;

        //右上角

        CGFloat rightUpLong = centerLongitude + pointssLongitudeDelta/2.0;

        CGFloat rightUpLati = centerLatitude - pointssLatitudeDelta/2.0;

        //左下角

        CGFloat leftDownLong = centerLongitude - pointssLongitudeDelta/2.0;

        CGFloat leftDownlati = centerLatitude + pointssLatitudeDelta/2.0;

        //右下角

        CGFloat rightDownLong = centerLongitude + pointssLongitudeDelta/2.0;

        CGFloat rightDownLati = centerLatitude + pointssLatitudeDelta/2.0;

       

        NSLog(@" 左上   %f,%f--------- 右上   %f,%f------- 左下  %f,%f----- 右下  %f,%f",leftUpLong,leftUpLati,rightUpLong,rightUpLati,leftDownLong,leftDownlati,rightDownLong,rightDownLati);

  • 相关阅读:
    eclipse 中配置查看jdk基础源代码
    网页授权获取用户基本信息
    语系/地区码
    windows 下 PHP DOITPHP框架 memcache缓存开启。
    xheditor富文本框 存值与展示问题
    逻辑处理
    ajax图片单个上传(ajaxfileupload.js)
    18 南京 D
    poj 2069
    poj 2420
  • 原文地址:https://www.cnblogs.com/dondre/p/4630677.html
Copyright © 2011-2022 走看看