我想问一下是否有人知道如何使用MapBox iOS SDK v2实现自定义注释标记图像的动画?我尝试在Google Maps iOS SDK中使用[UIImage animatedImageNamed:]
使用一系列图片,它似乎可以正常工作,但在MapBox iOS SDK v2中使用它时似乎并非如此。
我也在MapBox iOS SDK v2中尝试了以下代码,但没有运气:
-(MGLAnnotationImage *)mapView:(MGLMapView *)mapView imageForAnnotation:(id<MGLAnnotation>)annotation {
MGLAnnotationImage *annotationImage = [mapView dequeueReusableAnnotationImageWithIdentifier:@"reuse_id"];
if (!annotationImage)
{
UIImage *image = [UIImage animatedImageNamed:@"marker" duration:0.5f];
annotationImage = [MGLAnnotationImage annotationImageWithImage:image reuseIdentifier:@"reuse_id"];
}
return annotationImage;
}