【问题标题】:Is it possible add animation icon marker on Google map android api?是否可以在 Google map android api 上添加动画图标标记?
【发布时间】:2017-09-20 05:58:38
【问题描述】:

我想添加带有动画图标的标记, 但它不起作用。 ios中的google map api,很简单。只需使用具有动画的 imageview 设置图标属性。

GMSMarker *newMarker = [GMSMarker markerWithPosition...];
newMarker.icon = animateImageView;

但在 android 中,使用 BitMapDescriptor 设置图标。 无论如何,我尝试这样,但它不起作用。 只显示了第一张图片。

ImageView animImgView = new ImagView(context);
//walking_person_anim.xml - <animation-list>...</animation-list> 
animImgView.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.walking_person_anim));

animImgView.measure(...,...);
Bitmap markerBitmap = Bitmap.createBitmap(..., .., Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(markerBitmap);

AnimationDrawable ad = (AnimationDrawable) anim.getDrawable();
ad.setBound(0,0,...,...);
ad.draw(markerBitmap);
ad.start();

googleMap.addMarker(new MarkerOptions().position(...)
.icon(BitmapDescriptorFactory.fromBitmap(markerBitmap));

有什么问题? android 谷歌地图中的动画图标不可能?

【问题讨论】:

  • 你要放哪种类型的动画图标?

标签: android google-maps animation google-maps-api-3


【解决方案1】:

希望你能从here.得到更好的解决方案

在该链接上,有一个关于如何在 Google Maps V2 上设置动画标记的问题

【讨论】:

    猜你喜欢
    • 2016-06-22
    • 2017-05-18
    • 1970-01-01
    • 2017-10-11
    • 2018-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多