문제

I am working on Google maps,and I am new to it.Actually I want to show navigation symbol on Google maps when I move to position A to position B following the path i have drawn.I want to animate or move the map and compass button direction as I am moving my device without touching it in same direction.Please help me how would i do this.

Thanks.

도움이 되었습니까?

해결책

When the compass changes, it will execute the function and you can change the direction.

You can use the function below.

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { 
if (newHeading.headingAccuracy > 0) {
CGFloat heading = (1.0f * M_PI * newHeading.trueHeading) / 180.f;
myLocationAnnotationView.transform = CGAffineTransformMakeRotation(heading);}}

this image illustrates the situation:

enter image description here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top