Class PolygonManagerFlowsKt
-
- All Implemented Interfaces:
public final class PolygonManagerFlowsKt
-
-
Method Summary
Modifier and Type Method Description final static Flow<Polygon>clickEvents(PolygonManager.Collection $self)Returns a flow that emits when a polygon in this collection is clicked. final static PolygonaddPolygon(PolygonManager.Collection $self, Function1<PolygonOptions, Unit> optionsActions)Adds a new Polygon to the underlying map and to this PolygonManager.Collection with the provided optionsActions. -
-
Method Detail
-
clickEvents
final static Flow<Polygon> clickEvents(PolygonManager.Collection $self)
Returns a flow that emits when a polygon in this collection is clicked. Using this to observe polygon clicks will override an existing listener (if any) to PolygonManager.Collection.setOnPolygonClickListener.
Warning: This is a cold flow wrapping a single-listener SDK callback. Concurrently subscribing multiple collectors will result in listener hijacking, and cancelling any observer will unregister the active listener completely. Always share this flow (e.g. using kotlinx.coroutines.flow.shareIn) for multi-observer configurations.
Note on event consumption: The underlying SDK listener returns the result of
trySend().isSuccess. When an emission is accepted by the flow buffer, the click event is considered consumed (true), suppressing default SDK behavior. Under backpressure if the buffer is full,trySendreturnsfalse, allowing default SDK click handling to proceed.
-
addPolygon
final static Polygon addPolygon(PolygonManager.Collection $self, Function1<PolygonOptions, Unit> optionsActions)
Adds a new Polygon to the underlying map and to this PolygonManager.Collection with the provided optionsActions.
-
-
-
-