swift - 将相机更改为我的位置时,我的位置蓝点不在屏幕中央
问题描述
我遇到了一个显示用户位置的蓝点问题,问题是当按下转到我的位置按钮时,蓝点不在地图的中心,但它在一点点下方。
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()
}
解决方案
推荐阅读
- javascript - 如何在本机反应的杀死应用程序中检测应用程序?
- image - 图像细化过程的未知问题
- asynchronous - F#:调用 Task.WhenAny 时避免竞争条件?
- amazon-web-services - EC2 实例承担 IAM 角色,这样我就不必每次都输入令牌来使用 AWS 上的服务
- python - 如何在函数后停止 tkinter
- python - AttributeError:PageOne 实例没有属性“删除”
- html - 如何在 Vuetify 组件上应用自定义/覆盖 CSS?
- sql - 我的简单代码(附加)出现错误“将 varchar 转换为数字数据类型的算术溢出错误”。
- javascript - 如何在 JavaScript 公式中获得准确的百分比
- django - 从 Django 视图调用 Google Cloud 函数