2

We created an app that shows maps using Google Maps api. However, I don't know how to get the current zoom level when the camera is moved.

@Override public void onMapReady(GoogleMap googleMap) { googleMap.moveCamera(CameraUpdateFactory.newLatLng( new LatLng(0, 0) )); googleMap.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() { @Override public void onCameraIdle() { int zoomLevel = Math.round(mMap.getCameraPosition().zoom); Toast.makeText(getApplicationContext(),zoomlevel,Toast.LENGTH_SHORT).show(); } }); } 

2 Answers 2

5

You can get the current zoom this way:

float zoom=googleMap.getCameraPosition().zoom; 
Sign up to request clarification or add additional context in comments.

Comments

3

get the zoom level

 final GoogleMapController googleMapController = await widget.completer.future; var zoom = await googleMapController.getZoomLevel(); print(zoom); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.