问题描述
我当前正在使用Google Maps,并且想在我的应用中使用动画Gif作为叠加层.这确实令人沮丧,因为在iOS版本的应用程序上看起来非常容易,所以我真的想实现一些很棒的功能.
I am currently using Google Maps and would like to use an animated Gif as Overlay in my app.This is really frustrating as it seems very easy on iOS version of the app, SO I really want to achieve something cool.
我想看到的结果是在此视频的23秒内: https://www.youtube.com/watch?v=JI323jA67x0#t=23s
The result I would like to see is on 23s of this video: https://www.youtube.com/watch?v=JI323jA67x0#t=23s
地面覆盖物似乎是一种野兽做法,但不接受动画gif:
The Ground Overlays seems the bast practice, but doesn't accept animated 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
推荐答案
作为解决方案,我们将GIF分解为多个图像,并循环了所有图像列表.
As a solution, we have decomposed the GIF in multiple images and we are looping all the image list.
我们使用与上面相同的代码,一切都很好.
We are using the same code as above and everything is fine.
按照以下建议使用ImageView + Glide完全没有帮助,因为图像不会随地图一起移动.
Using an ImageView + Glide as suggested below doesn't help at all as the Image will not move with the Map.
这篇关于在G.Maps v2中将动画Gif用作地面叠加层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!