Android: how to add an animated marker

Please can someone help me add an animated marker like this one for google v2 android maps

thanks.

+4
source share
2 answers

Maybe you can get an idea about this ...

TranslateAnimation animation = new TranslateAnimation (0.0f, 400.0f, 0.0f, 0.0f);
// new 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
source

please use the code below to set the marker with

       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);
-4
source

All Articles