Zoom in on a location - Google Maps

Google provides a pretty easy way to zoom in on a location in google maps.

All you have to do is obtain the map controller from your map view and call animateTo(point) set zoom as shown below.

You can set the zoom to whatever you feel is necessary.

 // Get our Map Controller.
mapController = mapView.getController();

/**
    * Zoom on the location passed in.
    * 
    * @param point
    *           The location to zoom in on.
    */
   private void zoomOnLocation(GeoPoint point) {
      mapController.animateTo(point);
      mapController.setZoom(16);
      mapView.invalidate();
   }
Comments