ConsolidatedAttributionPlugin

Plugin interface for the consolidated attribution control.

The control combines the Mapbox logo, the data attribution text and a disclosure chevron into a single pill. It expands once on first launch, then collapses on a timer and on any map interaction. While it is enabled it hides the separate logo and attribution ornaments.

The plugin is not part of com.mapbox.maps.MapInitOptions.defaultPluginList; add it explicitly:

MapInitOptions(
context = context,
plugins = MapInitOptions.defaultPluginList +
Plugin.Mapbox(Plugin.MAPBOX_CONSOLIDATED_ATTRIBUTION_PLUGIN_ID),
)

then opt in:

mapView.consolidatedAttribution.updateSettings { enabled = true }

Functions

Link copied to clipboard
abstract fun bind(mapView: FrameLayout, attrs: AttributeSet?, pixelRatio: Float): View

Bind a view instance

Link copied to clipboard
open fun cleanup()

Called when the map is destroyed. Should be used to cleanup plugin resources for that map.

Link copied to clipboard

Get the instance of MapAttributionDelegate backing the control's attribution text.

Link copied to clipboard

Get current consolidatedattribution configuration.

Link copied to clipboard
open fun initialize()

Called when the plugin is first added to the map.

Link copied to clipboard
open fun onDelegateProvider(delegateProvider: MapDelegateProvider)

Provides all map delegate instances.

Link copied to clipboard
open fun onPluginView(view: View)

Provides a view instances returned in inflate after it's been added to the MapView.

Link copied to clipboard
open fun onStart()

Called whenever activity's/fragment's lifecycle is entering a "started" state.

Link copied to clipboard
open fun onStop()

Called whenever activity's/fragment's lifecycle is entering a "stopped" state.

Link copied to clipboard

Set a custom AttributionDialogManager invoked when the pill is tapped.

Link copied to clipboard

Update consolidatedattribution configuration, the update will be applied to the plugin automatically.

Properties

Link copied to clipboard

Defines how much of the consolidated attribution control remains visible once it collapses. Default value: "icon-and-wordmark".

Link copied to clipboard
abstract var enabled: Boolean

Whether the consolidated attribution control is visible on the map. When enabled, it replaces the separate Mapbox logo and attribution icon. Default value: false.

Link copied to clipboard

Defines how often the consolidated attribution control plays its intro expansion. Default value: "once".

Link copied to clipboard
abstract var marginBottom: Float

Defines the margin to the bottom that the consolidated attribution control honors. Default value: 8.

Link copied to clipboard
abstract var marginLeft: Float

Defines the margin to the left that the consolidated attribution control honors. Default value: 8.

Link copied to clipboard
abstract var marginRight: Float

Defines the margin to the right that the consolidated attribution control honors. Default value: 8.

Link copied to clipboard
abstract var marginTop: Float

Defines the margin to the top that the consolidated attribution control honors. Default value: 8.

Link copied to clipboard

Defines the material filling the background of the consolidated attribution control. Light and dark rendering follows the night mode of the host configuration rather than this property. Default value: "solid".

Link copied to clipboard
abstract var position: Int

Defines where the consolidated attribution control is positioned on the map. Default value: "bottom-left".

Link copied to clipboard
abstract var tintColor: Int

Nudges the background of the consolidated attribution control toward the hue of this color, bringing the control closer to the host application palette. Defaults to fully transparent, which applies no tint. Only the hue is taken, so the background keeps the brightness and the translucency selected by the material. The tint applies to the light appearance only, and the Mapbox logo, the attribution text and the chevron are never tinted. Default value: "#00000000".