Android; MapView, how can I set default location?

Jimmy picture Jimmy · Aug 30, 2010 · Viewed 14k times · Source

Using the MapView in android, how can I set a default location, so that everytime I load up this application, it automatically centers/zooms location in on London?

Answer

matekm picture matekm · Aug 30, 2010

Firstly, get the controller for the given map:

MapController myMapController = myMapView.getController();

and then call:

myMapController.setCenter(new GeoPoint())

This will set the center of the map on the given GeoPoint.

See docs for MapView and MapController for more info