The question is as follows:

In Google Maps, you need to know the current zoom level. Through the listener map.setOnCameraChangeListener(new OnCameraChangeListener(){...}); does not work, deprecated error occurs, i.e. all is crossed out and returns as a result null . And the implementation of OnCameraMoveListener() cannot be implemented because I am still a kettle and I need specific examples. Or tell me how to make the camera follow the location, but the zoom did not change, but always remained at the level set by the user. Below is the part of the code that is responsible for keeping the camera at the current location.

 CameraPosition cameraPosition = new CameraPosition.Builder() .target(new LatLng(location.getLatitude(), location.getLongitude())) // камера следует за текущим местоположением .bearing(myBear) .zoom(15) //сюда я собирался подставлять переменную с текущим уровнем зума .build(); CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition); mMap.animateCamera(cameraUpdate); 

    1 answer 1

    Here they write that it is necessary so:

     map.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() { @Override public void onCameraIdle() { int zoomLevel = map.getCameraPosition().zoom; //use zoomLevel value.. } });