User Interaction
The Mapbox Maps SDK for Android provides a variety of ways for users to interact with the map. With the Mapbox Gestures for Android library you can allow users to move the map using default gestures (such as panning, zooming, and rotating), enable and disable specific default gestures, or configure behavior for one or more gestures. The gestures guide below explains how to enable, disable, and customize default gestures, and listen for gesture events.
The Interactions API allows you to add interactions to specific elements of the map organized into featuresets. These featuresets are defined sets of layers in a style that can be interacted with such as Buildings or Place Labels. The Android Maps SDK allows you add interactions such as click
and longClick
to these featuresets and provide a callback that triggers when the interaction occurs. You can also add interactions to the map itself, allowing you to listen for clicks on the map, clear feature states, and reset the visual appearance of the map.