Android:如何添加动画标记

时间:2013-11-22 16:17:28

标签: android google-maps-markers google-maps-api-2

请有人帮我添加动态标记,例如one for android google maps V2

谢谢。

2 个答案:

答案 0 :(得分:-1)

也许你可能有想法研究它......

TranslateAnimation animation = new TranslateAnimation(0.0f,400.0f,0.0f,0.0f);
//新的TranslateAnimation(xFrom,xTo,yFrom,yTo)

animation.setDuration(2000);  // animation duration 
animation.setRepeatCount(100);  // animation repeat count (total repetition)
animation.setRepeatMode(2);   // repeat animation (left to right, right to left )
//animation.setFillAfter(true);      

img_animation.startAnimation(animation);

答案 1 :(得分:-4)

请使用以下代码从drawable

设置标记
       BitmapDescriptor icon = BitmapDescriptorFactory.fromResource(R.drawable.current_position_tennis_ball)


        MarkerOptions markerOptions = new MarkerOptions().position(latLng)
                 .title("Current Location")
                 .snippet("Thinking of finding some thing...")
                 .icon(icon);

        mMarker = googleMap.addMarker(markerOptions);