MapsInitializer

public final class MapsInitializer extends Object

Use this class to initialize the Google Maps SDK for Android if features need to be used before obtaining a map. It must be called because some classes such as BitmapDescriptorFactory and CameraUpdateFactory need to be initialized.

This class does not apply to the Navigation SDK. It exists for compile time compatibility with com.google.android.gms:play-services-maps only.

Do not use this class if you obtain a valid GoogleMap reference using the onMapReady(GoogleMap map) callback. Instead provide the callback to either MapFragment#getMapAsync() or MapView#getMapAsync(). See the sample application for some examples.

Nested Class Summary

enum MapsInitializer.Renderer This enum informs the map MapsInitializer.Renderer to use for the application, which is always LATEST

Public Method Summary

synchronized static int
initialize(Context context, MapsInitializer.Renderer preferredRenderer, OnMapsSdkInitializedCallback callback)
This method exists for compatibility with com.google.android.gms:play-services-maps only.
synchronized static int
initialize(Context context)
Initializes the Google Maps SDK for Android so that its classes are ready for use.

Inherited Method Summary

Public Methods

public static synchronized int initialize (Context context, MapsInitializer.Renderer preferredRenderer, OnMapsSdkInitializedCallback callback)

This method exists for compatibility with com.google.android.gms:play-services-maps only. Use initialize(Context) instead of this method.

This method does not apply to the Navigation SDK. It exists for compile time compatibility with com.google.android.gms:play-services-maps only.

Render.LATEST is always the render that is returned to the callback.

Parameters
context Required context. Must not be null.
preferredRenderer Ignored renderer preference.
callback Renderer initialized callback.

public static synchronized int initialize (Context context)

Initializes the Google Maps SDK for Android so that its classes are ready for use.

This method does not apply to the Navigation SDK. It exists for compile time compatibility with com.google.android.gms:play-services-maps only.

Do not use this method if you obtain a valid GoogleMap reference using the onMapReady(GoogleMap map) callback. Instead provide the callback to either MapFragment#getMapAsync() or MapView#getMapAsync(). See the sample application for some examples.

Parameters
context Required to fetch the necessary SDK resources and code. Must not be null.
Returns
  • A ConnectionResult error code.