// // Marker related listeners. // public bool OnMarkerClick(Marker marker) { // This causes the marker at Perth to bounce into position when it is clicked. if (marker.Equals(mPerth)) { Handler handler = new Handler (); long start = SystemClock.UptimeMillis (); Projection proj = mMap.Projection; Point startPoint = proj.ToScreenLocation(PERTH); startPoint.Offset(0, -100); LatLng startLatLng = proj.FromScreenLocation(startPoint); long duration = 1500; IInterpolator interpolator = new BounceInterpolator(); Runnable run = null; run = new Runnable (delegate { long elapsed = SystemClock.UptimeMillis () - start; float t = interpolator.GetInterpolation ((float) elapsed / duration); double lng = t * PERTH.Longitude + (1 - t) * startLatLng.Longitude; double lat = t * PERTH.Latitude + (1 - t) * startLatLng.Latitude; marker.Position = (new LatLng(lat, lng)); if (t < 1.0) { // Post again 16ms later. handler.PostDelayed(run, 16); } }); handler.Post(run); } // We return false to indicate that we have not consumed the event and that we wish // for the default behavior to occur (which is for the camera to move such that the // marker is centered and for the marker's info window to open, if it has one). return false; }