maps-ktx / com.google.maps.android.ktx / com.google.android.gms.maps.GoogleMap

Extensions for com.google.android.gms.maps.GoogleMap

addCircle

Adds a Circle to this GoogleMap using the function literal with receiver optionsActions.

fun GoogleMap.addCircle(optionsActions: CircleOptions.() -> Unit): Circle

addGroundOverlay

Adds a GroundOverlay to this GoogleMap using the function literal with receiver optionsActions.

fun GoogleMap.addGroundOverlay(optionsActions: GroundOverlayOptions.() -> Unit): GroundOverlay?

addMarker

Adds a Marker to this GoogleMap using the function literal with receiver optionsActions.

fun GoogleMap.addMarker(optionsActions: MarkerOptions.() -> Unit): Marker?

addPolygon

Adds a Polygon to this GoogleMap using the function literal with receiver optionsActions.

fun GoogleMap.addPolygon(optionsActions: PolygonOptions.() -> Unit): Polygon

addPolyline

Adds a Polyline to this GoogleMap using the function literal with receiver optionsActions.

fun GoogleMap.addPolyline(optionsActions: PolylineOptions.() -> Unit): Polyline

addTileOverlay

Adds a TileOverlay to this GoogleMap using the function literal with receiver optionsActions.

fun GoogleMap.addTileOverlay(optionsActions: TileOverlayOptions.() -> Unit): TileOverlay?

awaitAnimateCamera

A suspending function that awaits the completion of the cameraUpdate animation.

suspend fun GoogleMap.awaitAnimateCamera(cameraUpdate: CameraUpdate, durationMs: Int = 3000): Unit

awaitMapLoad

A suspending function that awaits for the map to be loaded. Uses GoogleMap.setOnMapLoadedCallback.

suspend fun GoogleMap.awaitMapLoad(): Unit

awaitSnapshot

A suspending function that returns a bitmap snapshot of the current view of the map. Uses GoogleMap.snapshot.

suspend fun GoogleMap.awaitSnapshot(bitmap: Bitmap? = null): Bitmap?

cameraIdleEvents

Returns a flow that emits when the camera is idle. Using this to observe camera idle events will override an existing listener (if any) to GoogleMap.setOnCameraIdleListener.

fun GoogleMap.cameraIdleEvents(): Flow<Unit>

cameraMoveCanceledEvents

Returns a flow that emits when a camera move is canceled. Using this to observe camera move cancel events will override an existing listener (if any) to GoogleMap.setOnCameraMoveCanceledListener.

fun GoogleMap.cameraMoveCanceledEvents(): Flow<Unit>

cameraMoveEvents

Returns a flow that emits when the camera moves. Using this to observe camera move events will override an existing listener (if any) to GoogleMap.setOnCameraMoveListener.

fun GoogleMap.cameraMoveEvents(): Flow<Unit>

cameraMoveStartedEvents

Returns a flow that emits when a camera move started. Using this to observe camera move start events will override an existing listener (if any) to GoogleMap.setOnCameraMoveStartedListener.

fun GoogleMap.cameraMoveStartedEvents(): Flow<Int>

circleClickEvents

Returns a flow that emits when a circle is clicked. Using this to observe circle clicks events will override an existing listener (if any) to GoogleMap.setOnCircleClickListener.

fun GoogleMap.circleClickEvents(): Flow<Circle>

groundOverlayClicks

Returns a flow that emits when a ground overlay is clicked. Using this to observe ground overlay clicks events will override an existing listener (if any) to GoogleMap.setOnGroundOverlayClickListener.

fun GoogleMap.groundOverlayClicks(): Flow<GroundOverlay>

indoorStateChangeEvents

Returns a flow that emits when the indoor state changes. Using this to observe indoor state change events will override an existing listener (if any) to GoogleMap.setOnIndoorStateChangeListener

fun GoogleMap.indoorStateChangeEvents(): Flow<IndoorChangeEvent>

infoWindowClickEvents

Returns a flow that emits when a marker's info window is clicked. Using this to observe info info window clicks will override an existing listener (if any) to GoogleMap.setOnInfoWindowClickListener

fun GoogleMap.infoWindowClickEvents(): Flow<Marker>

infoWindowCloseEvents

Returns a flow that emits when a marker's info window is closed. Using this to observe info window closes will override an existing listener (if any) to GoogleMap.setOnInfoWindowCloseListener

fun GoogleMap.infoWindowCloseEvents(): Flow<Marker>

infoWindowLongClickEvents

Returns a flow that emits when a marker's info window is long pressed. Using this to observe info window long presses will override an existing listener (if any) to GoogleMap.setOnInfoWindowLongClickListener

fun GoogleMap.infoWindowLongClickEvents(): Flow<Marker>

mapClickEvents

Returns a flow that emits when the map is clicked. Using this to observe map click events will override an existing listener (if any) to GoogleMap.setOnMapClickListener

fun GoogleMap.mapClickEvents(): Flow<LatLng>

mapLongClickEvents

Returns a flow that emits when the map is long clicked. Using this to observe map click events will override an existing listener (if any) to GoogleMap.setOnMapLongClickListener

fun GoogleMap.mapLongClickEvents(): Flow<LatLng>

markerClickEvents

Returns a flow that emits when a marker on the map is clicked. Using this to observe marker click events will override an existing listener (if any) to GoogleMap.setOnMarkerClickListener

fun GoogleMap.markerClickEvents(): Flow<Marker>

markerDragEvents

Returns a flow that emits when a marker is dragged. Using this to observer marker drag events will override existing listeners (if any) to GoogleMap.setOnMarkerDragListener

fun GoogleMap.markerDragEvents(): Flow<OnMarkerDragEvent>

myLocationButtonClickEvents

Returns a flow that emits when the my location button is clicked. Using this to observe my location button click events will override an existing listener (if any) to GoogleMap.setOnMyLocationButtonClickListener

fun GoogleMap.myLocationButtonClickEvents(): Flow<Unit>

myLocationClickEvents

Returns a flow that emits when the my location blue dot is clicked. Using this to observe my location blue dot click events will override an existing listener (if any) to GoogleMap.setOnMyLocationClickListener

fun GoogleMap.myLocationClickEvents(): Flow<Location>

poiClickEvents

Returns a flow that emits when a PointOfInterest is clicked. Using this to observe PointOfInterest click events will override an existing listener (if any) to GoogleMap.setOnPoiClickListener

fun GoogleMap.poiClickEvents(): Flow<PointOfInterest>

polygonClickEvents

Returns a flow that emits when a Polygon is clicked. Using this to observe Polygon click events will override an existing listener (if any) to GoogleMap.setOnPolygonClickListener

fun GoogleMap.polygonClickEvents(): Flow<Polygon>

polylineClickEvents

Returns a flow that emits when a Polyline is clicked. Using this to observe Polyline click events will override an existing listener (if any) to GoogleMap.setOnPolylineClickListener

fun GoogleMap.polylineClickEvents(): Flow<Polyline>