我遇到一个蓝点问题,该问题显示了用户的位置,该问题是 当按下“转到我的位置”按钮时,蓝点不在地图中居中,而是在下方。
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()
}