两个方法:
- 1.markerOptions.icons(iconList);设置多张图模拟gif动画
- 2.markerOptions.period(1);值越小刷新的越快
注意事项:
- 如果显示了gif效果的marker,之后调用aMap.clear(),再添加带有gif的marker,可能出现带有gif的marker不显示;
解决方法:
- 避免使用aMap.clear(),而是通过marker.remove()和aMap.invalidate()配合来移除marker,再刷新地图;
- 删除对应marker的方法可以参考高德地图Marker的管理(添加,删除)
ArrayList<BitmapDescriptor> iconList = new ArrayList<>();
laiYouLaiIconList.add(BitmapDescriptorFactory.fromResource(R.drawable.gif1));