Rotate GMSMarker in direction at which user facing

前端 未结 8 1174
独厮守ぢ
独厮守ぢ 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:45

    //just do this only

    - (void)locationManager:(CLLocationManager *)manager  didUpdateHeading:(CLHeading *)newHeading
    {
       double heading = newHeading.trueHeading;
       marker.groundAnchor = CGPointMake(0.5, 0.5);
       marker.rotation = heading;
       marker.map = mapView;
    }
    

提交回复
热议问题