Erfan Eghterafi
Erfan Eghterafi

Reputation: 5635

How to set static zoom limit google map v2 android

I want to set static zoom limit for google map v2.I don't want the user to be able to zoom out/in map.

Upvotes: 0

Views: 609

Answers (2)

NotThatDroid
NotThatDroid

Reputation: 53

map.getUiSettings.setZoomGesturesEnabled(false);
map.getUiSettings().setZoomControlsEnabled(false);

The zoom controls (setZoomControlsEnabled) affects the on-map "+" and "-" while setZoomGesturesEnabled affects gestures like pinch to zoom or double-tap

Upvotes: -1

Narendra Singh
Narendra Singh

Reputation: 4001

You can use like this -

1) To give static zoom level -

map.moveCamera( CameraUpdateFactory.newLatLngZoom(new LatLng(xxxx,xxxx) , 14.0f) );

2) For disabling zoom control -

map.getUiSettings().setZoomControlsEnabled(false);

Upvotes: 3

Related Questions