如何在MapBox iOS SDK v2中将自定义动画图像显示为注释标记

时间:2015-11-11 18:01:30

标签: ios objective-c mapbox

我想问一下是否有人知道如何使用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;
}

1 个答案:

答案 0 :(得分:0)

目前尚不支持;只有静态图像。观看此空间:https://github.com/mapbox/mapbox-gl-native/issues/1125