问题描述
我正在尝试创建类似于地图平移体验的Pokemon GO,其中用一根手指在屏幕上上下滑动将围绕播放器旋转。我在以下代码上取得了一些进展,但是似乎只有在我停止触摸屏幕时它才会旋转,知道我在做什么的任何帮助将不胜感激:
@IBAction func panMap (sender: UIPanGestureRecognizer) {
let afa = sender.translation(in: mapView)
let newDirection = mapView.camera.heading.advanced(by: Double(afa.y))
let newCamera: MKMapCamera = MKMapCamera(lookingAtCenter: self.mapView.camera.centerCoordinate,fromdistance: mapView.camera.altitude,pitch: mapView.camera.pitch,heading: newDirection)
mapView.setCamera(newCamera,animated: true)
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)