How to set height and width for MapView?
Do you know about how to set coordinates (X, Y posit开发者_StackOverflow社区ion), height and width for MapView ?
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).
精彩评论