罗盘图像旋转为此处地图

时间:2017-05-25 13:54:21

标签: ios here-api

地图方向作为此代码使用。但指南针图像不按地图旋转旋转。请帮助如何在这里制作指南针地图

 - (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

1 个答案:

答案 0 :(得分:0)

您可以听取NMAMapView::NMAMapEvent::NMAMapEventOrientationChanged,例如:

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

您也可以尝试NMAOrientableMapMarker,看看它是否适合您。