GoogleMapsInitializer

A singleton object to manage the initialization of the Google Maps SDK.

This object provides a state machine to track the initialization process and ensures that the initialization is performed only once. It also provides a mechanism to reset the initialization state, which can be useful in test environments.

The initialization process consists of two main steps:

  1. Calling MapsInitializer.initialize(context) to initialize the Google Maps SDK.

  2. Calling MapsApiSettings.addInternalUsageAttributionId(context, attributionId) to add the library's attribution ID to the Maps API settings.

The state of the initialization is exposed via the state property, which is a State object that can be observed for changes.

Properties

Link copied to clipboard

The value of the attribution ID. Set this to the empty string to opt out of attribution.

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun initialize(context: Context)

Initializes the Google Maps SDK.

Link copied to clipboard
suspend fun reset()

Resets the initialization state.