initialize

open suspend override fun initialize(context: Context, forceInitialization: Boolean)

Initializes Google Maps. This function must be called before using any other functions in this library.

If initialization fails with a recoverable error (e.g., a network issue), the state will be reset to InitializationState.UNINITIALIZED, allowing for a subsequent retry. In the case of an unrecoverable error (e.g., a missing manifest value), the state will be set to InitializationState.FAILURE and the original exception will be re-thrown.

Parameters

context

The context to use for initialization.

forceInitialization

When true, initialization will be attempted even if it has already succeeded or is in progress. This is useful for retrying a previously failed initialization.