【发布时间】:2015-11-11 18:01:30
【问题描述】:
我想问一下是否有人知道如何使用 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;
}
【问题讨论】:
标签: ios objective-c mapbox