Files
MapLibreParticleLab/platform/android/docs/camera/max-min-zoom.md
Bart Louwers c79b6dcf52 Add end-of-file-fixer pre-commit hook (#3176)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-24 20:43:50 +01:00

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 }}