Package-level declarations

Types

Link copied to clipboard

Enumerates the different reasons why the map camera started to move.

Link copied to clipboard

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.

Link copied to clipboard

Enum representing a 1-1 mapping to com.google.android.gms.maps.model.MapColorScheme.

Link copied to clipboard

Default implementation of IndoorStateChangeListener with no-op implementations.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard
typealias GoogleMapFactory = @Composable () -> Unit
Link copied to clipboard

The position of a GroundOverlay.

Link copied to clipboard

Interface definition for building indoor level state changes.

Link copied to clipboard
class MapProperties(val isBuildingEnabled: Boolean = false, val isIndoorEnabled: Boolean = false, val isMyLocationEnabled: Boolean = false, val isTrafficEnabled: Boolean = false, val latLngBoundsForCameraTarget: LatLngBounds? = null, val mapStyleOptions: MapStyleOptions? = null, val mapType: MapType = MapType.NORMAL, val maxZoomPreference: Float = 21.0f, val minZoomPreference: Float = 3.0f)

Data class for properties that can be modified on the map.

Link copied to clipboard

Marks declarations that are still experimental.

Link copied to clipboard

Enumerates the different types of map tiles.

Link copied to clipboard
class MapUiSettings(val compassEnabled: Boolean = true, val indoorLevelPickerEnabled: Boolean = true, val mapToolbarEnabled: Boolean = true, val myLocationButtonEnabled: Boolean = true, val rotationGesturesEnabled: Boolean = true, val scrollGesturesEnabled: Boolean = true, val scrollGesturesEnabledDuringRotateOrZoom: Boolean = true, val tiltGesturesEnabled: Boolean = true, val zoomControlsEnabled: Boolean = true, val zoomGesturesEnabled: Boolean = true)

Data class for UI-related settings on the map.

Link copied to clipboard

A state object that can be hoisted to control and observe the marker state.

Link copied to clipboard

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.

Properties

Link copied to clipboard

Default map content padding does not pad.

Link copied to clipboard

Equivalent to MapProperties with default values.

Link copied to clipboard

Default settings are all enabled.

Functions

Link copied to clipboard
fun AdvancedMarker(state: MarkerState = rememberMarkerState(), contentDescription: String? = "", alpha: Float = 1.0f, anchor: Offset = Offset(0.5f, 1.0f), draggable: Boolean = false, flat: Boolean = false, infoWindowAnchor: Offset = Offset(0.5f, 0.0f), rotation: Float = 0.0f, snippet: String? = null, tag: Any? = null, title: String? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Marker) -> Boolean = { false }, onInfoWindowClick: (Marker) -> Unit = {}, onInfoWindowClose: (Marker) -> Unit = {}, onInfoWindowLongClick: (Marker) -> Unit = {}, pinConfig: PinConfig? = null, iconView: View? = null, collisionBehavior: Int = AdvancedMarkerOptions.CollisionBehavior.REQUIRED)

A composable for an advanced marker on the map.

Link copied to clipboard
fun Circle(center: LatLng, clickable: Boolean = false, fillColor: Color = Color.Black, radius: Double = 10.0, strokeColor: Color = Color.Black, strokePattern: List<PatternItem>? = null, strokeWidth: Float = 10.0f, tag: Any? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Circle) -> Unit = {})

A composable for a circle on the map.

Link copied to clipboard
fun GoogleMap(modifier: Modifier = Modifier, mergeDescendants: Boolean = false, cameraPositionState: CameraPositionState = rememberCameraPositionState(), contentDescription: String? = null, googleMapOptionsFactory: () -> GoogleMapOptions = { GoogleMapOptions() }, properties: MapProperties = DefaultMapProperties, locationSource: LocationSource? = null, uiSettings: MapUiSettings = DefaultMapUiSettings, indoorStateChangeListener: IndoorStateChangeListener = DefaultIndoorStateChangeListener, onMapClick: (LatLng) -> Unit? = null, onMapLongClick: (LatLng) -> Unit? = null, onMapLoaded: () -> Unit? = null, onMyLocationButtonClick: () -> Boolean? = null, onMyLocationClick: (Location) -> Unit? = null, onPOIClick: (PointOfInterest) -> Unit? = null, contentPadding: PaddingValues = DefaultMapContentPadding, mapColorScheme: ComposeMapColorScheme? = null, content: @Composable () -> Unit = {})

A compose container for a MapView.

Link copied to clipboard
fun googleMapFactory(modifier: Modifier = Modifier, cameraPositionState: CameraPositionState = rememberCameraPositionState(), onMapLoaded: () -> Unit = {}, content: @Composable () -> Unit = {}): GoogleMapFactory

This method provides a factory pattern for GoogleMap. It can typically be used in tests to provide a default Composable of type GoogleMapFactory.

Link copied to clipboard
fun GroundOverlay(position: GroundOverlayPosition, image: BitmapDescriptor, anchor: Offset = Offset(0.5f, 0.5f), bearing: Float = 0.0f, clickable: Boolean = false, tag: Any? = null, transparency: Float = 0.0f, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (GroundOverlay) -> Unit = {})

A composable for a ground overlay on the map.

Link copied to clipboard
fun InputHandler(onCircleClick: (Circle) -> Unit? = null, onGroundOverlayClick: (GroundOverlay) -> Unit? = null, onPolygonClick: (Polygon) -> Unit? = null, onPolylineClick: (Polyline) -> Unit? = null, onMarkerClick: (Marker) -> Boolean? = null, onInfoWindowClick: (Marker) -> Unit? = null, onInfoWindowClose: (Marker) -> Unit? = null, onInfoWindowLongClick: (Marker) -> Unit? = null, onMarkerDrag: (Marker) -> Unit? = null, onMarkerDragEnd: (Marker) -> Unit? = null, onMarkerDragStart: (Marker) -> Unit? = null)

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.

Link copied to clipboard
fun MapEffect(key1: Any?, block: suspend CoroutineScope.(GoogleMap) -> Unit)

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.

fun MapEffect(vararg keys: Any?, block: suspend CoroutineScope.(GoogleMap) -> Unit)

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.

fun MapEffect(key1: Any?, key2: Any?, block: suspend CoroutineScope.(GoogleMap) -> Unit)

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.

fun MapEffect(key1: Any?, key2: Any?, key3: Any?, block: suspend CoroutineScope.(GoogleMap) -> Unit)

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.

Link copied to clipboard
fun Marker(state: MarkerState = rememberMarkerState(), contentDescription: String? = "", alpha: Float = 1.0f, anchor: Offset = Offset(0.5f, 1.0f), draggable: Boolean = false, flat: Boolean = false, icon: BitmapDescriptor? = null, infoWindowAnchor: Offset = Offset(0.5f, 0.0f), rotation: Float = 0.0f, snippet: String? = null, tag: Any? = null, title: String? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Marker) -> Boolean = { false }, onInfoWindowClick: (Marker) -> Unit = {}, onInfoWindowClose: (Marker) -> Unit = {}, onInfoWindowLongClick: (Marker) -> Unit = {})

A composable for a marker on the map.

Link copied to clipboard
fun MarkerComposable(vararg keys: Any, state: MarkerState = rememberMarkerState(), contentDescription: String? = "", alpha: Float = 1.0f, anchor: Offset = Offset(0.5f, 1.0f), draggable: Boolean = false, flat: Boolean = false, infoWindowAnchor: Offset = Offset(0.5f, 0.0f), rotation: Float = 0.0f, snippet: String? = null, tag: Any? = null, title: String? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Marker) -> Boolean = { false }, onInfoWindowClick: (Marker) -> Unit = {}, onInfoWindowClose: (Marker) -> Unit = {}, onInfoWindowLongClick: (Marker) -> Unit = {}, content: @Composable () -> Unit)

Composable rendering the content passed as a marker.

Link copied to clipboard
fun MarkerInfoWindow(state: MarkerState = rememberMarkerState(), alpha: Float = 1.0f, anchor: Offset = Offset(0.5f, 1.0f), draggable: Boolean = false, flat: Boolean = false, icon: BitmapDescriptor? = null, infoWindowAnchor: Offset = Offset(0.5f, 0.0f), rotation: Float = 0.0f, snippet: String? = null, tag: Any? = null, title: String? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Marker) -> Boolean = { false }, onInfoWindowClick: (Marker) -> Unit = {}, onInfoWindowClose: (Marker) -> Unit = {}, onInfoWindowLongClick: (Marker) -> Unit = {}, content: @Composable (Marker) -> Unit? = null)

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.

Link copied to clipboard
fun MarkerInfoWindowComposable(vararg keys: Any, state: MarkerState = rememberMarkerState(), alpha: Float = 1.0f, anchor: Offset = Offset(0.5f, 1.0f), draggable: Boolean = false, flat: Boolean = false, infoWindowAnchor: Offset = Offset(0.5f, 0.0f), rotation: Float = 0.0f, snippet: String? = null, tag: Any? = null, title: String? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Marker) -> Boolean = { false }, onInfoWindowClick: (Marker) -> Unit = {}, onInfoWindowClose: (Marker) -> Unit = {}, onInfoWindowLongClick: (Marker) -> Unit = {}, infoContent: @Composable (Marker) -> Unit? = null, content: @Composable () -> Unit)

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.

Link copied to clipboard
fun MarkerInfoWindowContent(state: MarkerState = rememberMarkerState(), alpha: Float = 1.0f, anchor: Offset = Offset(0.5f, 1.0f), draggable: Boolean = false, flat: Boolean = false, icon: BitmapDescriptor? = null, infoWindowAnchor: Offset = Offset(0.5f, 0.0f), rotation: Float = 0.0f, snippet: String? = null, tag: Any? = null, title: String? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Marker) -> Boolean = { false }, onInfoWindowClick: (Marker) -> Unit = {}, onInfoWindowClose: (Marker) -> Unit = {}, onInfoWindowLongClick: (Marker) -> Unit = {}, content: @Composable (Marker) -> Unit? = null)

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.

Link copied to clipboard
fun Polygon(points: List<LatLng>, clickable: Boolean = false, fillColor: Color = Color.Black, geodesic: Boolean = false, holes: List<List<LatLng>> = emptyList(), strokeColor: Color = Color.Black, strokeJointType: Int = JointType.DEFAULT, strokePattern: List<PatternItem>? = null, strokeWidth: Float = 10.0f, tag: Any? = null, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (Polygon) -> Unit = {})

A composable for a polygon on the map.

Link copied to clipboard
fun Polyline(points: List<LatLng>, clickable: Boolean = false, color: Color = Color.Black, endCap: Cap = ButtCap(), geodesic: Boolean = false, jointType: Int = JointType.DEFAULT, pattern: List<PatternItem>? = null, startCap: Cap = ButtCap(), tag: Any? = null, visible: Boolean = true, width: Float = 10.0f, zIndex: Float = 0.0f, onClick: (Polyline) -> Unit = {})

A composable for a polyline on the map.

fun Polyline(points: List<LatLng>, spans: List<StyleSpan>, clickable: Boolean = false, endCap: Cap = ButtCap(), geodesic: Boolean = false, jointType: Int = JointType.DEFAULT, pattern: List<PatternItem>? = null, startCap: Cap = ButtCap(), tag: Any? = null, visible: Boolean = true, width: Float = 10.0f, zIndex: Float = 0.0f, onClick: (Polyline) -> Unit = {})

A composable for a polyline on the map that supports a StyleSpan.

Link copied to clipboard
inline fun rememberCameraPositionState(key: String? = null, crossinline init: CameraPositionState.() -> Unit = {}): CameraPositionState

Create and rememberSaveable a CameraPositionState using CameraPositionState.Saver. init will be called when the CameraPositionState is first created to configure its initial state.

Link copied to clipboard
fun rememberMarkerState(key: String? = null, position: LatLng = LatLng(0.0, 0.0)): MarkerState

Uses rememberSaveable to retain MarkerState.position across configuration changes, for simple use cases.

Link copied to clipboard

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.

Link copied to clipboard
fun TileOverlay(tileProvider: TileProvider, state: TileOverlayState = rememberTileOverlayState(), fadeIn: Boolean = true, transparency: Float = 0.0f, visible: Boolean = true, zIndex: Float = 0.0f, onClick: (TileOverlay) -> Unit = {})

A composable for a tile overlay on the map.