【问题标题】:How to show custom animated images as annotation marker in MapBox iOS SDK v2如何在 MapBox iOS SDK v2 中将自定义动画图像显示为注释标记
【发布时间】: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


    【解决方案1】:

    目前还不支持;只有静态图像。关注这个空间:https://github.com/mapbox/mapbox-gl-native/issues/1125

    【讨论】:

    • 有什么方法可以在不使用图像的情况下实现上述动画标记? (例如形状)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多