Android Question how to resize height and width MapFragment programmatically

Multiverse app

Active Member
Licensed User
Longtime User
Add the mapfragment to a panel (make sure that the horizontal and vertical anchors of the mapfragment are set to both), and then resize the panel as you want.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Hi,
I did it, but still the Zooming option does not appear.
Can I do it by source code ?

Kinds

Exactly what are you trying to do? First you said you wanted to resize the MapFragment, now you want to zoom. Generally if you have 2 different questions, you should start a new thread for each one...

If you're setting up your MapFragment in the designer, there is an option to enable the zoom controls. If you want to enable them in code, you need to use MapFragment.GetMap.GetUiSettings. If you want to actually zoom in code, you need to create a CameraPosition object, then call GoogleMap.AnimateCamera(CameraPosition).

- Colin.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
UPDATE: Just resizing the panel hosting the mapfragment view will NOT auto-resize the child mapfragment view even if the mapfragment has full-screen anchors because those anchors are only used when the layout is first loaded.

So, after you resize the panel, you then need to manually resize the child mapfragment as done here:

 
Upvote 0
Top