tags:

views:

81

answers:

1

Hi guys,

Do you know about how to set coordinates (X, Y position), height and width for MapView ?

Is there any method for this issue ?

Thanks in advance.

A: 

You can control what the MapView is displaying by using the MapController. You get the MapController from the MapView using getController():

MapView map = (MapView) findViewById(R.id.MyMapId);
MapController controller = map.getController();

From there, you can check the documentation on how to control the center point or span. I've found zoomToSpan() to be particularly useful.

I'm not exactly sure what you mean by "height and width" of the MapView, but if you want to change the size of the MapView itself on the screen, you can just do it like you would do for any View (by setting the layoutHeight and layoutWidth, either in xml or dynamically in code).

Daniel Lew