我目前正在使用 Google 地图,并且想在我的应用程序中使用动画 Gif 作为叠加层。
这真的很令人沮丧,因为它在 iOS 版本的应用程序上看起来很容易,所以我真的很想实现一些很酷的东西。
我希望看到的结果是该视频的 23 秒:https://www.youtube.com/watch?v=JI323jA67x0#t=23s https://www.youtube.com/watch?v=JI323jA67x0#t=23s
地面覆盖似乎是最佳实践,但不接受动画 gif:
LatLng NEWARK = new LatLng(40.714086, -74.228697);
GroundOverlayOptions newarkMap = new GroundOverlayOptions()
.image(BitmapDescriptorFactory.fromResource(R.drawable.newark_nj_1922))
.position(NEWARK, 8600f, 6500f);
// Add an overlay to the map, retaining a handle to the GroundOverlay object.
GroundOverlay imageOverlay = map.addGroundOverlay(newarkMap);
https://developers.google.com/maps/documentation/android-api/groundoverlay#add_an_overlay https://developers.google.com/maps/documentation/android-api/groundoverlay#add_an_overlay
作为解决方案,我们将 GIF 分解为多个图像,并且循环所有图像列表。
我们使用与上面相同的代码,一切都很好。
按照下面的建议使用 ImageView + Glide 根本没有帮助,因为图像不会随地图移动。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)