0
votes

I would just like to ask if anyone has any idea how to implement animation of custom annotation marker image using MapBox iOS SDK v2? I have tried using series of images using [UIImage animatedImageNamed:] in Google Maps iOS SDK and it seems to work but it doesn't seem so when used in MapBox iOS SDK v2.

I have also tried the following code in MapBox iOS SDK v2 but with no luck:

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

1 Answers

0
votes

This isn't yet supported; only static images are. Watch this space: https://github.com/mapbox/mapbox-gl-native/issues/1125