User Interaction
The Mapbox Maps SDK for iOS provides a variety of ways for users to interact with the map. 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 Maps SDK for iOS allows you add interactions such as tap
and longPress
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 taps on the map, remove feature states, or reset the visual appearance of the map.