-
public final class MarkerStateA 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMarkerState.Companion
-
Field Summary
Fields Modifier and Type Field Description private LatLngpositionprivate BooleanisDraggingprivate DragStatedragState
-
Method Summary
Modifier and Type Method Description final LatLnggetPosition()Current position of the marker. final UnitsetPosition(LatLng position)Current position of the marker. final BooleangetIsDragging()Reflects whether the end user is currently dragging the marker. final UnitsetIsDragging(Boolean isDragging)final DragStategetDragState()Current DragState of the marker. final UnitsetDragState(@Deprecated(message = Use isDragging instead - dragState is not appropriate for representing "state"; it is a lossy representation of drag "events", promoting invalid usage., level = DeprecationLevel.WARNING) DragState dragState)final UnitshowInfoWindow()Shows the info window for the underlying marker. final UnithideInfoWindow()Hides the info window for the underlying marker. -
-
Method Detail
-
getPosition
final LatLng getPosition()
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.
-
setPosition
final Unit setPosition(LatLng position)
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.
-
getIsDragging
final Boolean getIsDragging()
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.
-
setIsDragging
final Unit setIsDragging(Boolean isDragging)
-
getDragState
final DragState getDragState()
Current DragState of the marker.
-
setDragState
final Unit setDragState(@Deprecated(message = Use isDragging instead - dragState is not appropriate for representing "state"; it is a lossy representation of drag "events", promoting invalid usage., level = DeprecationLevel.WARNING) DragState dragState)
-
showInfoWindow
final Unit showInfoWindow()
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.
-
hideInfoWindow
final Unit hideInfoWindow()
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.
-
-
-
-