zoukankan      html  css  js  c++  java
  • iOS 使用腾讯地图显示用户位置注意事项

    1. 向 target中info 加入  NSLocationWhenInUseUsageDescription,string 类型。值是描写叙述为什么须要用户位置,这句话会出如今 提示用户是否同意app訪问用户位置提示框中。

    2. 在appdelegate.m 的 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    中加入

        //地图定位

        CLLocationManager* locationManager = [[CLLocationManageralloc] init];

        if ([[UIDevicecurrentDevice].systemVersionfloatValue] >= 8.0) {

            [locationManager requestWhenInUseAuthorization];

        }

    3. 加入腾讯地图

        self.mapView = [[QMapView alloc] initWithFrame:self.view.frame];

       self.mapView.delegate = self;

       self.mapView.showsUserLocation = YES;

        //缩放级别

        _mapView.zoomLevel =13;

        [self.view addSubview:_mapView];



  • 相关阅读:
    Fragment_3_Androidx中返回键的处理
    2.2.3.Architecture components_View Binding
    2.2.2.Architecture components_data binding2_源码分析
    经典排序
    动态规划求解最长公共子序列
    全排列问题
    钢条切割
    KMP
    Queue
    Stack
  • 原文地址:https://www.cnblogs.com/mfmdaoyou/p/7294304.html
Copyright © 2011-2022 走看看