Rotate GMSMarker in direction at which user facing

前端 未结 8 1240
独厮守ぢ
独厮守ぢ 2020-12-28 17:58

I have requirement like on my current location one view will display. It will rotate if device was rotate or location will be change.I research lot but got all the code whic

8条回答
  •  清酒与你
    2020-12-28 18:48

    Swift 4+

    Thanks to priya.vr. When you updating location marker, try this:

     let locationManager = CLLocationManager()
     marker.position = position
     marker.appearAnimation = .none
     marker.rotation = locationManager.location?.course ?? 0
     marker.map = map
    

提交回复
热议问题