FeatureStore

Constructors

Link copied to clipboard
constructor(space: CoordinateSpace<T>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val defaultViewPoint: ViewPoint<T>

A view point used by default

Link copied to clipboard
val featureFlow: StateFlow<Map<String, Feature<T>>>
Link copied to clipboard
open override val features: Map<String, Feature<T>>
Link copied to clipboard
open override val space: CoordinateSpace<T>

Functions

Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.arc(oval: Rectangle<T>, startAngle: Angle, arcLength: Angle, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, ArcFeature<T>>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.circle(center: T, size: Dp = 5.dp, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, CircleFeature<T>>
Link copied to clipboard
open override fun T.distanceTo(b: T, zoom: Float): Dp
Link copied to clipboard
open override fun T.distanceToLine(a: T, b: T, zoom: Float): Dp
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "draggableMultiLineFromPoints")
fun <T : Any> FeatureBuilder<T>.draggableMultiLine(points: List<T>, id: String? = null): FeatureRef<T, MultiLineFeature<T>>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.draw(position: T, attributes: Attributes = Attributes.EMPTY, id: String? = null, draw: DrawScope.() -> Unit): FeatureRef<T, DrawFeature<T>>
Link copied to clipboard
open override fun <F : Feature<T>> feature(id: String?, feature: F): FeatureRef<T, F>

Add or replace feature. If id is null, then a unique id is generated

Link copied to clipboard
fun <T : Any> FeatureSet<T>.forEachUntil(block: FeatureSet<T>.(ref: FeatureRef<T, *>, feature: Feature<T>) -> Boolean)

Recursively search for feature until function returns true

Link copied to clipboard
inline fun <T : Any, A> FeatureSet<T>.forEachWithAttribute(key: Attribute<A>, block: FeatureSet<T>.(ref: FeatureRef<T, *>, feature: Feature<T>, attribute: A) -> Unit)

Process all features with a given attribute from the one with highest z to lowest

Link copied to clipboard
inline fun <T : Any, A> FeatureSet<T>.forEachWithAttributeUntil(key: Attribute<A>, block: FeatureSet<T>.(ref: FeatureRef<T, *>, feature: Feature<T>, attribute: A) -> Boolean)
Link copied to clipboard
inline fun <T : Any, F : Feature<T>> FeatureSet<T>.forEachWithType(crossinline block: FeatureSet<T>.(ref: FeatureRef<T, F>, feature: F) -> Unit)
Link copied to clipboard
fun <T : Any> FeatureSet<T>.generateBitmap(canvasState: CanvasState<T>, painterCache: Map<PainterFeature<T>, Painter>, textMeasurer: TextMeasurer, size: Size): ImageBitmap
Link copied to clipboard
fun <T : Any> FeatureSet<T>.generateSvg(canvasState: CanvasState<T>, painterCache: Map<PainterFeature<T>, Painter>, id: String? = null): String
Link copied to clipboard
fun getBoundingBox(zoom: Float = Float.MAX_VALUE): Rectangle<T>?
Link copied to clipboard
open override fun group(id: String?, attributes: Attributes, builder: FeatureGroup<T>.() -> Unit): FeatureRef<T, FeatureGroup<T>>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.icon(position: T, image: ImageVector, size: DpSize = DpSize(image.defaultWidth, image.defaultHeight), attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, VectorIconFeature<T>>
Link copied to clipboard
open override fun T.isInsidePolygon(points: List<T>): Boolean
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.line(aCoordinates: T, bCoordinates: T, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, LineFeature<T>>
Link copied to clipboard
open override fun ViewPoint<T>.moveBy(delta: T): ViewPoint<T>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.multiLine(points: List<T>, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, MultiLineFeature<T>>
Link copied to clipboard
open override fun T.offsetTo(b: T, zoom: Float): DpOffset
Link copied to clipboard
fun <T : Any> FeatureStore<T>.pixelMap(rectangle: Rectangle<T>, pixelMap: Structure2D<Color?>, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, PixelMapFeature<T>>
Link copied to clipboard
@Composable
fun <T : Any> FeatureSet<T>.pointerCache(): Map<PainterFeature<T>, Painter>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.points(points: List<T>, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, PointsFeature<T>>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.polygon(points: List<T>, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, PolygonFeature<T>>
Link copied to clipboard
open override fun putFeatures(features: Map<String, Feature<T>?>)
Link copied to clipboard
open override fun Rectangle(first: T, second: T): Rectangle<T>

Build a rectangle by two opposing corners

open override fun Rectangle(center: T, zoom: Float, size: DpSize): Rectangle<T>

Build a rectangle of visual size size

Link copied to clipboard
fun <T : Any> CoordinateSpace<T>.Rectangle(viewPoint: ViewPoint<T>, size: DpSize): Rectangle<T>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.rectangle(centerCoordinates: T, size: DpSize = DpSize(5.dp, 5.dp), attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, RectangleFeature<T>>
Link copied to clipboard
open override fun <F : Feature<T>> ref(id: String): FeatureRef<T, F>

Create a reference

Link copied to clipboard
open override fun removeFeature(id: String)
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.scalableImage(box: Rectangle<T>, attributes: Attributes = Attributes.EMPTY, id: String? = null, painter: @Composable () -> Painter): FeatureRef<T, ScalableImageFeature<T>>
Link copied to clipboard
fun <T : Any> FeatureBuilder<T>.text(position: T, text: String, font: Font.() -> Unit = { size = 16f }, attributes: Attributes = Attributes.EMPTY, id: String? = null): FeatureRef<T, TextFeature<T>>
Link copied to clipboard
open override fun <F : Feature<T>> updateFeature(id: String, block: (F?) -> F): FeatureRef<T, F>

Update existing feature if it is present and is of type F

Link copied to clipboard
open override fun ViewPoint(center: T, zoom: Float): ViewPoint<T>

Create a ViewPoint associated with this coordinate space.

Link copied to clipboard
open override fun Rectangle<T>.withCenter(center: T): Rectangle<T>

Move given rectangle to be centered at center

Link copied to clipboard
open override fun Collection<T>.wrapPoints(): Rectangle<T>?
Link copied to clipboard
open override fun Collection<Rectangle<T>>.wrapRectangles(): Rectangle<T>?
Link copied to clipboard
open override fun ViewPoint<T>.zoomBy(zoomDelta: Float, invariant: T): ViewPoint<T>