Logo Icon Logo
A Crowd-sourced Cookbook on Writing Great Android® Apps
GitHub logo Twitter logo OReilly Book Cover Art

Changing Views of a MapView.

Author: Rachee Singh -- Published? false -- FormatLanguage: W

Problem:

Showing an appropriate view of a MapView based on the context in the application.

Solution:

Changing the View of a map from the default map mode to satellite or street mode.

Discussion:

Warning The Google Maps V1 API is deprecated; new code should use the V2 API discussed in Recipes 4285 and 4297.

If the application needs to display distance information between 2 locations on the map, then keeping the map in Street mode is more suitable. Similarly, some applications might need to use the Satellite view of Google maps. This can be done programmatically by:

//For street view
mapView.setStreetView(true);

//For satellite view
mapView.setSatellite(true);
No records found.