地图方向作为此代码使用。但指南针图像不按地图旋转旋转。请帮助如何在这里制作指南针地图
- (void)mapView:(NMAMapView *)mapView didReceiveRotation:(float)rotation atLocation:(CGPoint)location
{
[self.mapView setOrientation:180 withAnimation:NMAMapAnimationLinear];
_comPassImg.transform =CGAffineTransformMakeRotation(rotation);//not working smoothly
}
答案 0 :(得分:0)
您可以听取NMAMapView::NMAMapEvent::NMAMapEventOrientationChanged
,例如:
[mapView respondToEvents:NMAMapEventOrientationChanged withBlock:^BOOL (NMAMapEvent event, NMAMapView *mapView, id eventData) {
_comPassImg.transform = CGAffineTransformMakeRotation(mapView.orientation);
return YES;
}];
您也可以尝试NMAOrientableMapMarker
,看看它是否适合您。