将相机更改为我的位置时,我的位置蓝点不在屏幕中央

问题描述 投票:0回答:1

enter image description here

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

    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()
    }
swift google-maps
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.