-1

Map Orientation works as this code. But compass image is not rotate as per map rotate. Please help how to make compass as here map

 - (void)mapView:(NMAMapView *)mapView didReceiveRotation:(float)rotation atLocation:(CGPoint)location
{
[self.mapView setOrientation:180 withAnimation:NMAMapAnimationLinear];
 _comPassImg.transform =CGAffineTransformMakeRotation(rotation);//not working smoothly
}

enter image description here

Dishant Rajput
  • 1,329
  • 1
  • 10
  • 20

1 Answers1

1

You can listen to NMAMapView::NMAMapEvent::NMAMapEventOrientationChanged instead, e.g.:

[mapView respondToEvents:NMAMapEventOrientationChanged withBlock:^BOOL (NMAMapEvent event, NMAMapView *mapView, id eventData) {
    _comPassImg.transform = CGAffineTransformMakeRotation(mapView.orientation);
    return YES;
}];

You can also try NMAOrientableMapMarker to see if that works for you.

AndrewJC
  • 1,318
  • 12
  • 11