Attribution Control
Adds a headless AttributionControl to the map for programmatic attribution management.
This control provides no visual UI itself, instead exposing UserConsentState and AttributionState data to enable custom attribution interfaces elsewhere in your application. Use this when implementing custom attribution UI while maintaining ToS compliance.
Legal Requirements
Mapbox attribution is mandatory per Mapbox Terms of Service. This control helps you create custom UI while meeting these requirements.
Telemetry and Privacy
Your users should be in charge of their own location data and when it is shared. By default, whenever your application causes the user's location to be gathered, it sends de-identified location and usage data to Mapbox. If you're developing a native app with one of the Mapbox mobile SDKs, our terms of service require that you provide a telemetry opt-out option within your app for all end users. The default attribution control includes an opt out button. If you hide the attribution control, you must provide an alternative opt out method your users can use. You are responsible for allowing your users to opt out of Mapbox Telemetry.
See guide for more info.
Usage Example
val attributionState = remember { AttributionState() }
var userConsent: UserConsentState? by remember { mutableStateOf(null) }
MapboxMap(
attribution = {
// Headless attribution control for custom UI
AttributionControl(
userConsentState = userConsent,
attributionState = attributionState
)
}
)
// Use attributionState.attributions and attributionState.userConsentState
// in your custom UI componentsUsage Notes
Attribution data may not be immediately available during map initialization, and it might be updated whenever style source is loaded.
Parameters
User consent configuration for telemetry and geofencing. When null, existing consent state remains unchanged. Use to programmatically update user preferences from your custom UI.
Current attribution data containing available attributions and user consent information for building custom UI.