首页 > 解决方案 > 将相机更改为我的位置时,我的位置蓝点不在屏幕中央

问题描述

在此处输入图像描述

我遇到了一个显示用户位置的蓝点问题,问题是当按下转到我的位置按钮时,蓝点不在地图的中心,但它在一点点下方。

    func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
       location = locations.last!
       let camera = GMSCameraPosition.camera(withLatitude: (location.coordinate.latitude), longitude: (location.coordinate.longitude), zoom: 17.0)
       if isBeggining {
          self.mapView.camera = camera
       } else {
          self.mapView.animate(to: camera)
       }
       isBeggining = false
       self.locationManager.stopUpdatingLocation()
    }

标签: swiftgoogle-maps

解决方案


推荐阅读