Files
MapLibreParticleLab/platform/android/docs/observability/observe-map-events.md
Adrian Cojocaru 08eb760acd Add action journal (#3409)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart@emeel.net>
2025-05-27 16:15:56 +03:00

823 B

Observe Map Events

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

You can observe-low level map events that are happening by registering listeners to a MapView. Below you can see the the map events that are currently available.

--8<-- "MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/events/ObserverActivity.kt:mapEvents"

You need to register them with these APIs:

--8<-- "MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/events/ObserverActivity.kt:addListeners"

In this case we implement them by implementing the interfaces below in the activity class, but you could also use lambdas.

--8<-- "MapLibreAndroidTestApp/src/main/java/org/maplibre/android/testapp/activity/events/ObserverActivity.kt:ObserverActivity"