How do i implement falling pins animation for markers in android map view

﹥>﹥吖頭↗ 提交于 2019-12-12 04:46:43

问题


Is there any way to implement falling pins/markers animation for google maps in android like that in iPhone ???


回答1:


Android has overlay markers (see ItemizedOverlay) that make it easy to add images to maps, BUT note that, in my experience at least, animated images do not work when added to overlays.

I found it necessary to add a View on top of the MapView, and add imagery to that, and I've successfully added animated drawable images to the map using that approach. For more details see here: Can I use AnimationDrawable in an overlay on a MapView?

But to be honest, you should remember that it's Android, and copying every little feature from iOS is unnecessary. Google Maps on Android doesn't use a pin marker, it uses a static blue spot - I'd say it's best to replicate that and remember your users are Android users, not iOS users - they want consistency across Android apps.




回答2:


You could have a look in this docmentation: https://developers.google.com/maps/documentation/javascript/overlays Here is an example map.

Just add this in your code:

marker.setAnimation(google.maps.Animation.DROP);


来源:https://stackoverflow.com/questions/8327960/how-do-i-implement-falling-pins-animation-for-markers-in-android-map-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!