android - Animate map Marker in GoogleMaps API -
i trying create custom marker looks that:
i have drawable in xml looks that:
<solid android:color="#0093e8"/> <size android:width="120dp" android:height="120dp"/>
is possible add "wave effect" marker , waves fading out gradually (as in picture)? also, animation should playing (without need of user tap on map marker) have do? thanks!
i did pretty similar used groundoverlay instead of marker, first defined custom animation:
public class radiusanimation extends animation { private groundoverlay groundoverlay; public radiusanimation(groundoverlay groundoverlay) { this.groundoverlay = groundoverlay; } @override protected void applytransformation(float interpolatedtime, transformation t) { groundoverlay.setdimensions( (100 * interpolatedtime) ); groundoverlay.settransparency( interpolatedtime ); } @override public void initialize(int width, int height, int parentwidth,int parentheight) { super.initialize(width, height, parentwidth, parentheight); } }
then run animation on groundoverlay, after onmapready :
... groundoverlay = mgooglemap.addgroundoverlay(new groundoverlayoptions() .image(image) .position(new latlng(lat, lng), 100)); groundanimation = new radiusanimation(groundoverlay); groundanimation.setrepeatcount(animation.infinite); groundanimation.setrepeatmode(animation.restart); groundanimation.setduration(2000); mapview.startanimation(groundanimation); // mapview show map ...
i hope can you
Comments
Post a Comment