I needed the map pin drop animation for my android application. Doing a lot of research, i found nothing useful . So i created a small hack. Just posting the code so that other can use it and modify it accordingly.

As Translate animation in android only works on Views and overlays are not views, I created a small hack which drops the views at the same geo location via translate animation and then remove the view to show overlays. This way user thinks the map overlays are dropping from the top even though they are not.

Here is the code:

private void translateAnimation(MapView mapView,ArrayList<GeoPoint> geoPointsList,Context context) {
    Point dropPoint = new Point();
    Projection projection = mapView.getProjection(); /*
                                                      * Getting the map projections to calculate
                                                      * screen points and geopoints
                                                      */
    GeoPoint mGeoPoint = projection.fromPixels(0, 0);

    /* Map View screen parameters */
    MapView.LayoutParams screenParameters = new MapView.LayoutParams(
            MapView.LayoutParams.WRAP_CONTENT, MapView.LayoutParams.WRAP_CONTENT, mGeoPoint, 0,
            0, MapView.LayoutParams.LEFT | MapView.LayoutParams.BOTTOM);

    for (GeoPoint geoPoint : geoPointsList) {
        projection.toPixels(geoPoint, dropPoint); /*
                                                   * As Overlays are not a subclass of views so
                                                   * view animation cannot work
                                                   */
        ImageView imageView = new ImageView(context); /*
                                                        * Therefore creating an imageview for
                                                        * every overlay point apply the
                                                        * transition animation and then
Edit
Report