Aiden Fry
Aiden Fry

Reputation: 1682

Google Map v2 getWidth in pixels

Im just upgrading my app to Google Maps v2 and i want to get the measured width of the MapFragment or GoogleMap. Here is what I want to do.

int mapWidth = ((View)sMapFrag_v2.getMap()).getMeasuredWidth();

How to do something like this using the new API?

Upvotes: 2

Views: 3722

Answers (1)

Aiden Fry
Aiden Fry

Reputation: 1682

Woah there instantly stumbled across my answer!

int mapWidth =  sMapFrag_v2.getView().getMeasuredWidth()

Upvotes: 6

Related Questions