【发布时间】:2014-02-13 12:32:27
【问题描述】:
我正在尝试在 mapbox 中自定义注释图层的外观。 我想旋转每个注释层。
- (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation
{
if (annotation.isUserLocationAnnotation)
return nil;
RMMarker *marker;
CGPoint xy = CGPointFromString(annotation.userInfo);
marker = [[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"arrow.png"]];
marker.transform = CATransform3DMakeRotation(atan2f(xy.x, xy.y) * 180 / M_PI,0,0,1);
marker.canShowCallout = YES;
return marker;
}
它在他们第一次加载到地图上时起作用。但是当我移动或缩放地图时,它们会重置为初始变换单位矩阵。
有什么想法可以解决这个问题吗?还是mapbox的bug?
【问题讨论】:
标签: ios annotations transform mapbox