Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bart Louwers <bart@emeel.net>
823 B
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"