+
+
+
+
+ Groups many items on a map based on zoom level.
all items to show
a lambda invoked when the user clicks a cluster of items
a lambda invoked when the user clicks a non-clustered item
a lambda invoked when the user clicks the info window of a non-clustered item
a lambda invoked when the user long-clicks the info window of a non-clustered item
an optional Composable that is rendered for each Cluster.
an optional Composable that is rendered for each non-clustered item.
Groups many items on a map based on zoom level.
all items to show
a lambda invoked when the user clicks a cluster of items
a lambda invoked when the user clicks a non-clustered item
a lambda invoked when the user clicks the info window of a non-clustered item
a lambda invoked when the user long-clicks the info window of a non-clustered item
an optional Composable that is rendered for each Cluster.
an optional Composable that is rendered for each non-clustered item.
an optional lambda invoked with the clusterManager as a param when both the clusterManager and renderer are set up, allowing callers a customization hook.
Groups many items on a map based on clusterManager.
all items to show
a ClusterManager that can be used to specify the algorithm used by the rendering.
If clusterRenderer is specified, clusterContent and clusterItemContent are not used; use a function that takes ClusterManager as an argument instead.
import com.google.maps.android.compose.clustering.Clustering
import androidx.compose.runtime.SideEffect
import com.google.maps.android.clustering.ClusterManager
+ val clusterManager = rememberClusterManager<T>()
+ LaunchedEffect(clusterManager, clusterRenderer) {
+ clusterManager?.renderer = clusterRenderer
+ }
+ SideEffect {
+ clusterManager ?: return@SideEffect
+ clusterManager.setOnClusterClickListener(onClusterClick)
+ clusterManager.setOnClusterItemClickListener(onClusterItemClick)
+ clusterManager.setOnClusterItemInfoWindowClickListener(onClusterItemInfoWindowClick)
+ clusterManager.setOnClusterItemInfoWindowLongClickListener(onClusterItemInfoWindowLongClick)
+ }
+ // Wait for renderer to apply before clustering
+ if (clusterManager != null && clusterManager.renderer == clusterRenderer) {
+ Clustering(
+ items = items,
+ clusterManager = clusterManager,
+ )
+ }
+ Groups many items on a map based on zoom level.
all items to show
a lambda invoked when the user clicks a cluster of items
a lambda invoked when the user clicks a non-clustered item
a lambda invoked when the user clicks the info window of a non-clustered item
a lambda invoked when the user long-clicks the info window of a non-clustered item
an optional Composable that is rendered for each Cluster.
an optional Composable that is rendered for each non-clustered item.
an optional ClusterRenderer that can be used to specify the algorithm used by the rendering.
Groups many items on a map based on clusterManager.
Groups many items on a map based on zoom level.
Default Renderer for drawing Composable.
Default Renderer for drawing Composable.
an optional Composable that is rendered for each Cluster.
an optional Composable that is rendered for each non-clustered item.
An animated scale bar that appears when the zoom level of the map changes, and then disappears after visibilityDurationMillis. This composable wraps ScaleBar with visibility animations.
Modifier to be applied to the composable.
The width of the composable.
The height of the composable.
The state of the camera position, used to calculate the scale.
The color of the text on the scale bar.
The color of the lines on the scale bar.
The color of the shadow behind the text and lines.
The duration in milliseconds that the scale bar will be visible.
The animation to use when the scale bar appears.
The animation to use when the scale bar disappears.
A scale bar composable that shows the current scale of the map in feet and meters when zoomed in to the map, changing to miles and kilometers, respectively, when zooming out.
Modifier to be applied to the composable.
The width of the composable.
The height of the composable.
The state of the camera position, used to calculate the scale.
The color of the text on the scale bar.
The color of the lines on the scale bar.
The color of the shadow behind the text and lines.
An animated scale bar that appears when the zoom level of the map changes, and then disappears after visibilityDurationMillis. This composable wraps ScaleBar with visibility animations.
A scale bar composable that shows the current scale of the map in feet and meters when zoomed in to the map, changing to miles and kilometers, respectively, when zooming out.
The dispatcher to use for IO operations.
The value of the attribution ID. Set this to the empty string to opt out of attribution.
This must be set before calling the initialize function.
The default implementation of GoogleMapsInitializer.
The dispatcher to use for IO operations.
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.
The context to use for initialization.
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.
Resets the initialization state.
This function cancels any ongoing initialization and resets the state to UNINITIALIZED. This is primarily useful in test environments where the SDK might need to be re-initialized multiple times.
The value of the attribution ID. Set this to the empty string to opt out of attribution.
This must be set before calling the initialize function.
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:
Calling MapsInitializer.initialize(context) to initialize the Google Maps SDK.
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.
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.
The context to use for initialization.
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.
Resets the initialization state.
This function cancels any ongoing initialization and resets the state to UNINITIALIZED. This is primarily useful in test environments where the SDK might need to be re-initialized multiple times.
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Enum representing the initialization state of the Google Maps SDK.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
if this enum type has no constant with the specified name
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
CompositionLocal that provides a GoogleMapsInitializer.
The default implementation of GoogleMapsInitializer.
A singleton object to manage the initialization of the Google Maps SDK.
Enum representing the initialization state of the Google Maps SDK.
CompositionLocal that provides a GoogleMapsInitializer.
Creates a new StreetViewCameraPositionState object
Creates a new StreetViewCameraPositionState object
Animates the camera to be at camera in durationMs milliseconds.
the camera to update to
the duration of the animation in milliseconds
Animates the camera to be at camera in durationMs milliseconds.
Sets the StreetViewPanorama to the given panorama ID.
Sets the position of the panorama.
The location of the panorama.
This is read-only - to update the camera's position use setPosition.
Note that this property is observable and if you use it in a composable function it will be recomposed on every change. Use snapshotFlow to observe it instead.
The camera of the panorama.
Note that this property is observable and if you use it in a composable function it will be recomposed on every change. Use snapshotFlow to observe it instead.
Sets the position of the panorama.
the LatLng of the panorama
the area in which to search for a panorama in meters
the source of the panoramas
Sets the StreetViewPanorama to the given panorama ID.
the ID of the panorama to set to
A composable for displaying a Street View for a given location. A location might not be available for a given set of coordinates. We recommend you to check our sample on StreetViewActivity using our utility function in StreetViewUtils to manage non-existing locations.
Modifier to be applied to the StreetView
the StreetViewCameraPositionState to be used to control or observe the Street View's camera
a factory lambda for providing a StreetViewPanoramaOptions object which is used when the underlying StreetViewPanoramaView is constructed
whether panning gestures are enabled or not
whether street names are enabled or not
whether user navigation is enabled or not
whether zoom gestures are enabled or not
lambda to receive events when the Street View is clicked
lambda to receive events when the Street View is long clicked
A composable for displaying a Street View for a given location. A location might not be available for a given set of coordinates. We recommend you to check our sample on StreetViewActivity using our utility function in StreetViewUtils to manage non-existing locations.
A composable for an advanced marker on the map.
the MarkerState to be used to control or observe the marker state such as its position and info window
the content description for accessibility purposes
the alpha (opacity) of the marker
the anchor for the marker image
sets the draggability for the marker
sets if the marker should be flat against the map
the anchor point of the info window on the marker image
the rotation of the marker in degrees clockwise about the marker's anchor point
the snippet for the marker
optional tag to associate with the marker
the title for the marker
the visibility of the marker
the z-index of the marker
a lambda invoked when the marker is clicked
a lambda invoked when the marker's info window is clicked
a lambda invoked when the marker's info window is closed
a lambda invoked when the marker's info window is long clicked
sets the icon for the marker
the PinConfig object that will be used for the advanced marker
the custom view to be used on the advanced marker
the expected collision behavior
Converts from the Maps SDK com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener constants to CameraMoveStartedReason, or returns UNKNOWN if there is no such CameraMoveStartedReason for the given value.
See https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#constants.
Converts from the Maps SDK com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener constants to CameraMoveStartedReason, or returns UNKNOWN if there is no such CameraMoveStartedReason for the given value.
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Enumerates the different reasons why the map camera started to move.
Based on enum values from https://developers.google.com/android/reference/com/google/android/gms/maps/GoogleMap.OnCameraMoveStartedListener#constants.
NO_MOVEMENT_YET is used as the initial state before any map movement has been observed.
UNKNOWN is used to represent when an unsupported integer value is provided to fromInt - this may be a new constant value from the Maps SDK that isn't supported by maps-compose yet, in which case this library should be updated to include a new enum value for that constant.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
if this enum type has no constant with the specified name
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
The default saver implementation for CameraPositionState
The default saver implementation for CameraPositionState
Creates a new CameraPositionState object
Creates a new CameraPositionState object
the initial camera position
Animate the camera position as specified by update, returning once the animation has completed. position will reflect the position of the camera as the animation proceeds.
animate will throw CancellationException if the animation does not fully complete. This can happen if:
The user manipulates the map directly
position is set explicitly, e.g. state.position = CameraPosition(...)
animate is called again before an earlier call to animate returns
move is called
The calling job is cancelled externally
If this CameraPositionState is not currently bound to a GoogleMap this call will suspend until a map is bound and animation will begin.
This method should only be called from a dispatcher bound to the map's UI thread.
the change that should be applied to the camera
The duration of the animation in milliseconds. If Int.MAX_VALUE is provided, the default animation duration will be used. Otherwise, the value provided must be strictly positive, otherwise an IllegalArgumentException will be thrown.
The reason for the start of the most recent camera moment, or CameraMoveStartedReason.NO_MOVEMENT_YET if the camera hasn't moved yet or CameraMoveStartedReason.UNKNOWN if an unknown constant is received from the Maps SDK.
A state object that can be hoisted to control and observe the map's camera state. A CameraPositionState may only be used by a single GoogleMap composable at a time as it reflects instance state for a single view of a map.
the initial camera position
The reason for the start of the most recent camera moment, or CameraMoveStartedReason.NO_MOVEMENT_YET if the camera hasn't moved yet or CameraMoveStartedReason.UNKNOWN if an unknown constant is received from the Maps SDK.
Returns the current Projection to be used for converting between screen coordinates and lat/lng.
Move the camera instantaneously as specified by update. Any calls to animate in progress will be cancelled. position will be updated when the bound map's position has been updated, or if the map is currently unbound, update will be applied when a map is next bound. Other calls to move, animate, or setting position will override an earlier pending call to move.
Move the camera instantaneously as specified by update. Any calls to animate in progress will be cancelled. position will be updated when the bound map's position has been updated, or if the map is currently unbound, update will be applied when a map is next bound. Other calls to move, animate, or setting position will override an earlier pending call to move.
This method must be called from the map's UI thread.
Current position of the camera on the map.
Returns the current Projection to be used for converting between screen coordinates and lat/lng.
A composable for a circle on the map.
the LatLng to use for the center of this circle
boolean indicating if the circle is clickable or not
the fill color of the circle
the radius of the circle in meters.
the stroke color of the circle
a sequence of PatternItem to be repeated along the circle's outline (null represents a solid line)
optional tag to be associated with the circle
the width of the circle's outline in screen pixels
the visibility of the circle
the z-index of the circle
a lambda invoked when the circle is clicked
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Enum representing a 1-1 mapping to com.google.android.gms.maps.model.MapColorScheme.
This enum provides equivalent values to facilitate usage with com.google.maps.android.compose.GoogleMap.
The integer value corresponding to each map color scheme.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Returns an array containing the constants of this enum type, in the order they're declared.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
if this enum type has no constant with the specified name
Returns an array containing the constants of this enum type, in the order they're declared.
This method may be used to iterate over the constants.
Prepares view for a single render by temporarily attaching it as a child of the MapView. Its composition will start. onAddedToWindow is called in place, and then view is removed from the window before returning.
Prepares view for a single render by temporarily attaching it as a child of the MapView. Its composition will start. onAddedToWindow is called in place, and then view is removed from the window before returning.
Default implementation of IndoorStateChangeListener with no-op implementations.
Default map content padding does not pad.
Equivalent to MapProperties with default values.
Default settings are all enabled.
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
if this enum type has no constant with the specified name
An annotation that can be used to mark a composable function as being expected to be use in a composable function that is also marked or inferred to be marked as a GoogleMapComposable.
This will produce build warnings when GoogleMapComposable composable functions are used outside of a GoogleMapComposable content lambda, and vice versa.
A compose container for a MapView.
Modifier to be applied to the GoogleMap
deactivates the map for accessibility purposes
the CameraPositionState to be used to control or observe the map's camera state
the content description for the map used by accessibility services to describe the map. If none is specified, the default is "Google Map".
the block for creating the GoogleMapOptions provided when the map is created
the properties for the map
the LocationSource to be used to provide location data
the MapUiSettings to be used for UI-specific settings on the map
listener for indoor building state changes
lambda invoked when the map is clicked
lambda invoked when the map is finished loading
lambda invoked when the my location button is clicked
lambda invoked when the my location dot is clicked
lambda invoked when a POI is clicked
the padding values used to signal that portions of the map around the edges may be obscured. The map will move the Google logo, etc. to avoid overlapping the padding.
Defines the color scheme for the Map.
the content of the map
The position of a GroundOverlay.
Use one of the create methods to construct an instance of this class.
A composable for a ground overlay on the map.
the position of the ground overlay
the image of the ground overlay
the anchor of the ground overlay
the bearing of the ground overlay in degrees clockwise from north
boolean indicating if the ground overlay is clickable or not
optional tag to associate with the ground overlay
the transparency of the ground overlay
the visibility of the ground overlay
the z-index of the ground overlay
a lambda invoked when the ground overlay is clicked
Interface definition for building indoor level state changes.
Callback invoked when an indoor building comes to focus.
Callback invoked when a level for a building is activated.
the activated building
A generic handler for map input. Non-null lambdas will be invoked if no other node was able to handle that input. For example, if OnMarkerClickListener.onMarkerClick was invoked and no matching MarkerNode was found, this onMarkerClick will be invoked.
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1 is provided.
Note: This effect should be used with caution as the GoogleMap's properties is managed by the _root_ide_package_.com.google.maps.android.compose.GoogleMap() composable function. However, there are use cases when obtaining a raw reference to the map is desirable for extensibility (e.g. using the utility library for clustering).
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched with any different keys.
Note: This effect should be used with caution as the GoogleMap's properties is managed by the _root_ide_package_.com.google.maps.android.compose.GoogleMap() composable function. However, there are use cases when obtaining a raw reference to the map is desirable for extensibility (e.g. using the utility library for clustering).
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1 or key2 is provided.
Note: This effect should be used with caution as the GoogleMap's properties is managed by the _root_ide_package_.com.google.maps.android.compose.GoogleMap() composable function. However, there are use cases when obtaining a raw reference to the map is desirable for extensibility (e.g. using the utility library for clustering).
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1, key2, or key3 is provided.
Note: This effect should be used with caution as the GoogleMap's properties is managed by the _root_ide_package_.com.google.maps.android.compose.GoogleMap() composable function. However, there are use cases when obtaining a raw reference to the map is desirable for extensibility (e.g. using the utility library for clustering).
Data class for properties that can be modified on the map.
Note: This is intentionally a class and not a data class for binary compatibility on future changes. See: https://jakewharton.com/public-api-challenges-in-kotlin/
Returns a representation of an immutable list of all enum entries, in the order they're declared.
This method may be used to iterate over the enum entries.
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
if this enum type has no constant with the specified name
Data class for UI-related settings on the map.
Note: This is intentionally a class and not a data class for binary compatibility on future changes. See: https://jakewharton.com/public-api-challenges-in-kotlin/
Marks declarations that are still experimental.
Composable rendering the content passed as a marker.
This composable must have a non-zero size in both dimensions
unique keys representing the state of this Marker. Any changes to one of the key will trigger a rendering of the content composable and thus the rendering of an updated marker.
the MarkerState to be used to control or observe the marker state such as its position and info window
the content description for accessibility purposes
the alpha (opacity) of the marker
the anchor for the marker image
sets the draggability for the marker
sets if the marker should be flat against the map
the anchor point of the info window on the marker image
the rotation of the marker in degrees clockwise about the marker's anchor point
the snippet for the marker
optional tag to associate with the marker
the title for the marker
the visibility of the marker
the z-index of the marker
a lambda invoked when the marker is clicked
a lambda invoked when the marker's info window is clicked
a lambda invoked when the marker's info window is closed
a lambda invoked when the marker's info window is long clicked
composable lambda expression used to customize the marker's content
if the composable is measured to have a size of zero in either dimension
A composable for a marker on the map wherein its entire info window and the marker itself can be customized. If this customization is not required, use com.google.maps.android.compose.Marker.
unique keys representing the state of this Marker. Any changes to one of the key will trigger a rendering of the content composable and thus the rendering of an updated marker.
the MarkerState to be used to control or observe the marker state such as its position and info window
the alpha (opacity) of the marker
the anchor for the marker image
sets the draggability for the marker
sets if the marker should be flat against the map
the anchor point of the info window on the marker image
the rotation of the marker in degrees clockwise about the marker's anchor point
the snippet for the marker
optional tag to associate with the marker
the title for the marker
the visibility of the marker
the z-index of the marker
a lambda invoked when the marker is clicked
a lambda invoked when the marker's info window is clicked
a lambda invoked when the marker's info window is closed
a lambda invoked when the marker's info window is long clicked
optional composable lambda expression for customizing the info window's content
composable lambda expression used to customize the marker's content
A composable for a marker on the map wherein its info window contents can be customized. If this customization is not required, use com.google.maps.android.compose.Marker.
the MarkerState to be used to control or observe the marker state such as its position and info window
the alpha (opacity) of the marker
the anchor for the marker image
sets the draggability for the marker
sets if the marker should be flat against the map
sets the icon for the marker
the anchor point of the info window on the marker image
the rotation of the marker in degrees clockwise about the marker's anchor point
the snippet for the marker
optional tag to associate with the marker
the title for the marker
the visibility of the marker
the z-index of the marker
a lambda invoked when the marker is clicked
a lambda invoked when the marker's info window is clicked
a lambda invoked when the marker's info window is closed
a lambda invoked when the marker's info window is long clicked
optional composable lambda expression for customizing the info window's content
A composable for a marker on the map wherein its entire info window can be customized. If this customization is not required, use com.google.maps.android.compose.Marker.
the MarkerState to be used to control or observe the marker state such as its position and info window
the alpha (opacity) of the marker
the anchor for the marker image
sets the draggability for the marker
the content description for accessibility purposes
sets if the marker should be flat against the map
sets the icon for the marker
the anchor point of the info window on the marker image
the rotation of the marker in degrees clockwise about the marker's anchor point
the snippet for the marker
optional tag to associate with the marker
the title for the marker
the visibility of the marker
the z-index of the marker
a lambda invoked when the marker is clicked
a lambda invoked when the marker's info window is clicked
a lambda invoked when the marker's info window is closed
a lambda invoked when the marker's info window is long clicked
optional composable lambda expression for customizing the info window's content
The default saver implementation for MarkerState
This cannot be used to preserve marker info window visibility across configuration changes.
The default saver implementation for MarkerState
Creates a new MarkerState object
Hides the info window for the underlying marker.
Not backed by observable Compose state to accommodate com.google.android.gms.maps.GoogleMap special semantics: only a single info window can be visible for the entire GoogleMap.
Only use from Compose Effect APIs, never directly from composition, to avoid unexpected behavior from cancelled compositions.
A state object that can be hoisted to control and observe the marker state.
This cannot be used to preserve marker info window visibility across configuration changes.
the initial marker position
Reflects whether the end user is currently dragging the marker. Dragging can happen only if a Marker is draggable.
This property is backed by Compose state.
Current position of the marker.
This property is backed by Compose state. It can be updated by the API user and by the API itself: it has two potentially competing sources of truth.
The API will not update the property unless isDragging == true, which will happen if and only if a Marker is draggable and the end user is currently dragging it.
Shows the info window for the underlying marker.
Not backed by Compose state to accommodate com.google.android.gms.maps.GoogleMap special semantics: only a single info window can be visible for the entire GoogleMap.
Only use from Compose Effect APIs, never directly from composition, to avoid exceptions and unexpected behavior from cancelled compositions.
A composable for a marker on the map.
the MarkerState to be used to control or observe the marker state such as its position and info window
the content description for accessibility purposes
the alpha (opacity) of the marker
the anchor for the marker image
sets the draggability for the marker
sets if the marker should be flat against the map
sets the icon for the marker
the anchor point of the info window on the marker image
the rotation of the marker in degrees clockwise about the marker's anchor point
the snippet for the marker
optional tag to associate with the marker
the title for the marker
the visibility of the marker
the z-index of the marker
a lambda invoked when the marker is clicked
a lambda invoked when the marker's info window is clicked
a lambda invoked when the marker's info window is closed
a lambda invoked when the marker's info window is long clicked
A composable for a polygon on the map.
the points comprising the vertices of the polygon
boolean indicating if the polygon is clickable or not
the fill color of the polygon
specifies whether to draw each segment as a geodesic
the holes for the polygon
the stroke color of the polygon
the joint type for all vertices of the polygon's outline
the stroke pattern for the polygon's outline
specifies the polygon's stroke width, in display pixels
optional tag to associate wiht the polygon
the visibility of the polygon
the z-index of the polygon
a lambda invoked when the polygon is clicked
A composable for a polyline on the map.
the points comprising the polyline
boolean indicating if the polyline is clickable or not
the color of the polyline
a cap at the end vertex of the polyline
specifies whether to draw the polyline as a geodesic
the joint type for all vertices of the polyline except the start and end vertices
the pattern for the polyline
the cap at the start vertex of the polyline
the visibility of the polyline
the width of the polyline in screen pixels
the z-index of the polyline
a lambda invoked when the polyline is clicked
A composable for a polyline on the map that supports a StyleSpan.
the points comprising the polyline
style spans for the polyline
boolean indicating if the polyline is clickable or not
a cap at the end vertex of the polyline
specifies whether to draw the polyline as a geodesic
the joint type for all vertices of the polyline except the start and end vertices
the pattern for the polyline
the cap at the start vertex of the polyline
the visibility of the polyline
the width of the polyline in screen pixels
the z-index of the polyline
a lambda invoked when the polyline is clicked
Creates a new TileOverlayState object
Creates a new TileOverlayState object
Call to force a refresh if the tiles provided by the tile overlay become 'stale'. This will cause all the tiles on this overlay to be reloaded. For example, if the tiles provided by the TileProvider change, you must call this afterwards to ensure that the previous tiles are no longer rendered.
See Maps SDK docs
A state object that can be hoisted to control the state of a TileOverlay. A TileOverlayState may only be used by a single TileOverlay composable at a time.
clearTileCache can be called to request that the map refresh these tiles.
Call to force a refresh if the tiles provided by the tile overlay become 'stale'. This will cause all the tiles on this overlay to be reloaded. For example, if the tiles provided by the TileProvider change, you must call this afterwards to ensure that the previous tiles are no longer rendered.
A composable for a tile overlay on the map.
the tile provider to use for this tile overlay
the TileOverlayState to be used to control the tile overlay, such as clearing stale tiles
boolean indicating whether the tiles should fade in
the transparency of the tile overlay
the visibility of the tile overlay
the z-index of the tile overlay
a lambda invoked when the tile overlay is clicked
The current CameraPositionState used by the map.
This method provides a factory pattern for GoogleMap. It can typically be used in tests to provide a default Composable of type GoogleMapFactory.
Any modifier to be applied.
The position for the map.
Listener for the map loaded.
Any content to be added.
Enumerates the different reasons why the map camera started to move.
A state object that can be hoisted to control and observe the map's camera state. A CameraPositionState may only be used by a single GoogleMap composable at a time as it reflects instance state for a single view of a map.
Enum representing a 1-1 mapping to com.google.android.gms.maps.model.MapColorScheme.
Default implementation of IndoorStateChangeListener with no-op implementations.
An annotation that can be used to mark a composable function as being expected to be use in a composable function that is also marked or inferred to be marked as a GoogleMapComposable.
The position of a GroundOverlay.
Interface definition for building indoor level state changes.
Data class for properties that can be modified on the map.
Marks declarations that are still experimental.
Data class for UI-related settings on the map.
A state object that can be hoisted to control and observe the marker state.
A state object that can be hoisted to control the state of a TileOverlay. A TileOverlayState may only be used by a single TileOverlay composable at a time.
The current CameraPositionState used by the map.
Default map content padding does not pad.
Equivalent to MapProperties with default values.
Default settings are all enabled.
A composable for an advanced marker on the map.
A composable for a circle on the map.
A compose container for a MapView.
This method provides a factory pattern for GoogleMap. It can typically be used in tests to provide a default Composable of type GoogleMapFactory.
A composable for a ground overlay on the map.
A generic handler for map input. Non-null lambdas will be invoked if no other node was able to handle that input. For example, if OnMarkerClickListener.onMarkerClick was invoked and no matching MarkerNode was found, this onMarkerClick will be invoked.
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1 is provided.
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched with any different keys.
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1 or key2 is provided.
A side-effect backed by a LaunchedEffect which will launch block and provide the underlying managed GoogleMap object into the composition's CoroutineContext. This effect will be re-launched when a different key1, key2, or key3 is provided.
A composable for a marker on the map.
Composable rendering the content passed as a marker.
A composable for a marker on the map wherein its entire info window can be customized. If this customization is not required, use com.google.maps.android.compose.Marker.
A composable for a marker on the map wherein its entire info window and the marker itself can be customized. If this customization is not required, use com.google.maps.android.compose.Marker.
A composable for a marker on the map wherein its info window contents can be customized. If this customization is not required, use com.google.maps.android.compose.Marker.
A composable for a polygon on the map.
A composable for a polyline on the map.
A composable for a polyline on the map that supports a StyleSpan.
Creates and remembers a CameraPositionState using rememberSaveable.
Create and rememberSaveable a CameraPositionState using CameraPositionState.Saver. init will be called when the CameraPositionState is first created to configure its initial state. Remember that the camera state can be applied when the map has been loaded.
Uses rememberSaveable to retain MarkerState.position across configuration changes, for simple use cases.
Returns a lambda that, when invoked, will reattach click listeners set by the MapApplier on the GoogleMap. Used for working around other functionality that modifies those click listeners, such as clustering.
This function updates the state value according to the update of the input parameter, like 'rememberUpdatedState'.
A composable for a tile overlay on the map.
Creates and remembers a CameraPositionState using rememberSaveable.
The camera position state is saved across configuration changes and process death, ensuring the map retains its last position.
A lambda that is called when the CameraPositionState is first created to configure its initial state, such as its position or zoom level.
The 'key' parameter is deprecated. Please use the new `rememberCameraPositionState` function without a key.
import com.google.maps.android.compose.rememberCameraPositionState
rememberCameraPositionState(init)Create and rememberSaveable a CameraPositionState using CameraPositionState.Saver. init will be called when the CameraPositionState is first created to configure its initial state. Remember that the camera state can be applied when the map has been loaded.
Use 'rememberUpdatedMarkerState' instead - It may be confusing to think that the state is automatically updated as the position changes, so it will be changed or removed.
+ val markerState = rememberSaveable(key = key, saver = MarkerState.Saver) {
+ MarkerState(position)
+ }
+ Uses rememberSaveable to retain MarkerState.position across configuration changes, for simple use cases.
Other use cases may be better served syncing MarkerState.position with a data model.
This cannot be used to preserve info window visibility across configuration changes.
This function does not automatically update the MarkerState when the input parameters change. If you need this implementation, use 'rememberUpdatedMarkerState'.
Returns a lambda that, when invoked, will reattach click listeners set by the MapApplier on the GoogleMap. Used for working around other functionality that modifies those click listeners, such as clustering.
This function updates the state value according to the update of the input parameter, like 'rememberUpdatedState'.
This cannot be used to preserve state across configuration changes.