在谷歌地图android中使用gif作为标记

时间:2017-06-20 09:34:52

标签: android google-maps google-maps-android-api-2 animated-gif

我正在使用Google Maps Android API Utility Library来聚类我的标记。通过使用它我通过使用以下代码

自定义我的标记
@Override
protected void onBeforeClusterItemRendered(MyMarker item, MarkerOptions markerOptions) {
    super.onBeforeClusterItemRendered(item, markerOptions);
    BitmapDescriptor markerDescriptorMan = BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_man);
    BitmapDescriptor markerDescriptorWoman = BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_woman);
    BitmapDescriptor markerDescriptorBoy = BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_boy);
    BitmapDescriptor markerDescriptorGirl = BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_girl);

    if(item.getResultset().getGender()==null) {
        markerOptions.icon(markerDescriptorMan);
    } else {
        if (item.getResultset().getGender().equalsIgnoreCase("female"))
            markerOptions.icon(markerDescriptorWoman);
        else
            markerOptions.icon(markerDescriptorMan);
    }

    markerOptions.title(item.getTitle());
}

我想要做的是使用gif图像作为标记,以便我可以使我的标记闪烁。我该怎么办?

我已经看过几个SO的例子,但在android上聚类标记时没有找到任何解决方案。

0 个答案:

没有答案