Package com.google.maps.android.compose

Types

CameraMoveStartedReason
Link copied to clipboard
@Immutable()
enum CameraMoveStartedReason : Enum<CameraMoveStartedReason>
Enumerates the different reasons why the map camera started to move.
CameraPositionState
Link copied to clipboard
class CameraPositionState(position: CameraPosition)
A state object that can be hoisted to control and observe the map's camera state.
ComposeUiViewRenderer
Link copied to clipboard
interface ComposeUiViewRenderer
DefaultIndoorStateChangeListener
Link copied to clipboard
Default implementation of IndoorStateChangeListener with no-op implementations.
DragState
Link copied to clipboard
@Immutable()
enum DragState : Enum<DragState>
GoogleMapComposable
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.
GoogleMapFactory
Link copied to clipboard
typealias GoogleMapFactory = @Composable() () -> Unit
GroundOverlayPosition
Link copied to clipboard
class GroundOverlayPosition
The position of a GroundOverlay.
IndoorStateChangeListener
Link copied to clipboard
interface IndoorStateChangeListener
Interface definition for building indoor level state changes.
MapProperties
Link copied to clipboard
class MapProperties(isBuildingEnabled: Boolean, isIndoorEnabled: Boolean, isMyLocationEnabled: Boolean, isTrafficEnabled: Boolean, latLngBoundsForCameraTarget: LatLngBounds?, mapStyleOptions: MapStyleOptions?, mapType: MapType, maxZoomPreference: Float, minZoomPreference: Float)
Data class for properties that can be modified on the map.
MapsComposeExperimentalApi
Link copied to clipboard
annotation class MapsComposeExperimentalApi
Marks declarations that are still experimental.
MapType
Link copied to clipboard
@Immutable()
enum MapType : Enum<MapType>
Enumerates the different types of map tiles.
MapUiSettings
Link copied to clipboard
class MapUiSettings(compassEnabled: Boolean, indoorLevelPickerEnabled: Boolean, mapToolbarEnabled: Boolean, myLocationButtonEnabled: Boolean, rotationGesturesEnabled: Boolean, scrollGesturesEnabled: Boolean, scrollGesturesEnabledDuringRotateOrZoom: Boolean, tiltGesturesEnabled: Boolean, zoomControlsEnabled: Boolean, zoomGesturesEnabled: Boolean)
Data class for UI-related settings on the map.
MarkerState
Link copied to clipboard
class MarkerState(position: LatLng)
A state object that can be hoisted to control and observe the marker state.
TileOverlayState
Link copied to clipboard
class TileOverlayState
A state object that can be hoisted to control the state of a TileOverlay.

Functions

Circle
Link copied to clipboard
@Composable()
fun Circle(center: LatLng, clickable: Boolean = false, fillColor: Color = Color.Transparent, radius: Double = 0.0, strokeColor: Color = Color.Black, strokePattern: List<PatternItem>? = null, strokeWidth: Float = 10f, tag: Any? = null, visible: Boolean = true, zIndex: Float = 0f, onClick: (Circle) -> Unit = {})
A composable for a circle on the map.
GoogleMap
Link copied to clipboard
@Composable()
fun GoogleMap(modifier: Modifier = Modifier, 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 = NoPadding, content: @Composable() () -> Unit? = null)
A compose container for a MapView.
googleMapFactory
Link copied to clipboard
@Composable()
fun googleMapFactory(modifier: Modifier = Modifier, cameraPositionState: CameraPositionState = rememberCameraPositionState(), onMapLoaded: () -> Unit = {}, content: @Composable() () -> Unit = {}): GoogleMapFactory
This method provides a factory pattern for GoogleMap.
GroundOverlay
Link copied to clipboard
@Composable()
fun GroundOverlay(position: GroundOverlayPosition, image: BitmapDescriptor, anchor: Offset = Offset(0.5f, 0.5f), bearing: Float = 0f, clickable: Boolean = false, tag: Any? = null, transparency: Float = 0f, visible: Boolean = true, zIndex: Float = 0f, onClick: (GroundOverlay) -> Unit = {})
A composable for a ground overlay on the map.
InputHandler
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.
MapEffect
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.
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.
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.
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.
Marker
Link copied to clipboard
@Composable()
fun Marker(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 = {})
A composable for a marker on the map.
MarkerComposable
Link copied to clipboard
@Composable()
fun MarkerComposable(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 = {}, content: @Composable() () -> Unit)
Composable rendering the content passed as a marker.
MarkerInfoWindow
Link copied to clipboard
@Composable()
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.
MarkerInfoWindowContent
Link copied to clipboard
@Composable()
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.
Polygon
Link copied to clipboard
@Composable()
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 = 10f, tag: Any? = null, visible: Boolean = true, zIndex: Float = 0f, onClick: (Polygon) -> Unit = {})
A composable for a polygon on the map.
Polyline
Link copied to clipboard
@Composable()
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 = 10f, zIndex: Float = 0f, onClick: (Polyline) -> Unit = {})
A composable for a polyline on the map.
rememberCameraPositionState
Link copied to clipboard
@Composable()
inline fun rememberCameraPositionState(key: String? = null, crossinline init: CameraPositionState.() -> Unit = {}): CameraPositionState
Create and rememberSaveable a CameraPositionState using CameraPositionState.Saver.
rememberComposeUiViewRenderer
Link copied to clipboard
fun rememberComposeUiViewRenderer(): ComposeUiViewRenderer
rememberMarkerState
Link copied to clipboard
@Composable()
fun rememberMarkerState(key: String? = null, position: LatLng = LatLng(0.0, 0.0)): MarkerState
rememberReattachClickListenersHandle
Link copied to clipboard
fun rememberReattachClickListenersHandle(): () -> Unit
Returns a lambda that, when invoked, will reattach click listeners set by the MapApplier on the GoogleMap.
rememberTileOverlayState
Link copied to clipboard
@Composable()
fun rememberTileOverlayState(): TileOverlayState
TileOverlay
Link copied to clipboard
@Composable()
fun TileOverlay(tileProvider: TileProvider, fadeIn: Boolean = true, transparency: Float = 0f, visible: Boolean = true, zIndex: Float = 0f, onClick: (TileOverlay) -> Unit = {})
@Composable()
fun TileOverlay(tileProvider: TileProvider, state: TileOverlayState = rememberTileOverlayState(), fadeIn: Boolean = true, transparency: Float = 0f, visible: Boolean = true, zIndex: Float = 0f, onClick: (TileOverlay) -> Unit = {})
A composable for a tile overlay on the map.

Properties

currentCameraPositionState
Link copied to clipboard
val currentCameraPositionState: CameraPositionState
The current CameraPositionState used by the map.