Files
MapLibreParticleLab/platform/android/docs/camera/max-min-zoom.md

1.0 KiB

Max/Min Zoom

{{ activity_source_note("MaxMinZoomActivity.kt") }}

This example shows how to configure a maximum and a minimum zoom level.

--8<-- "MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/MaxMinZoomActivity.kt:zoomPreference"

Bonus: Add Click Listener

As a bonus, this example also shows how you can define a click listener to the map.

--8<-- "MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/camera/MaxMinZoomActivity.kt:addOnMapClickListener"

You can remove a click listener again with MapLibreMap.removeOnMapClickListener. To use this API you need to assign the click listener to a variable, since you need to pass the listener to that method.

{{ openmaptiles_caption }}