Package-level declarations

Functions

Link copied to clipboard
suspend fun preloadImage(bytes: ByteArray)

Gets a picture ready to be drawn from its bytes. Needed in the browser only: there a picture can only be decoded asynchronously, so a shape whose look is a picture given as ImageRef.Bytes shows its placeholder until this has finished for those bytes; call it (and wait for it) before adding such a shape. On every other platform it does nothing, because the decoding is done when the shape is drawn.

Link copied to clipboard
fun Position.toGeoPosition(): GeoPosition

Converts a WWK Position back to our platform-independent GeoPosition.

Link copied to clipboard
fun ColorRgba.toWwkColor(): Color

Converts to WWK's Color. Relies on Kotlin resolving ColorRgba's Int (0-255) fields to WWK's Color(Int, Int, Int, Int) overload, which normalizes each channel to 0f..1f internally — not the Color(Float, Float, Float, Float) overload, which would treat 0-255 values as already-normalized and produce out-of-range colors.

Link copied to clipboard
fun ShapeStyle.toWwkLineAttributes(width: Float): ShapeAttributes

Converts to ShapeAttributes with this style applied to the outline at the given width (screen pixels) — for entities with no interior of their own (currently just DrawnPolyline, whose visible "shape" IS its outline). Mirrors toWwkShapeAttributes but writes outlineColor/outlineImageSource/outlineWidth instead of the interior* properties.

Link copied to clipboard
fun DrawnMarker.toWwkPlacemark(): Placemark

Maps a DrawnMarker to the WWK renderable that actually draws it on the globe.

Link copied to clipboard
fun ShapeStyle.toWwkPlacemarkAttributes(size: Float): PlacemarkAttributes

Converts to PlacemarkAttributes with this style applied to the marker's icon at the given size (a square's side length in screen pixels; for an image, the length of its longest side when the image's size is known — see the comment on the image case below). Same interior-vs-outline reasoning as toWwkLineAttributes: a marker has no interior, so this writes imageColor/ imageSource/imageScale rather than interior*.

Link copied to clipboard
fun DrawnPolygon.toWwkPolygon(): Polygon

Maps a DrawnPolygon to the WWK renderable that actually draws it on the globe.

Link copied to clipboard

Maps a DrawnPolyline to the WWK renderable that actually draws it on the globe.

Link copied to clipboard
fun GeoPosition.toWwkPosition(): Position

Converts to the WWK position type every renderable/camera API in wwk-adapter expects.

Link copied to clipboard
fun ShapeStyle.toWwkShapeAttributes(): ShapeAttributes

Converts to ShapeAttributes with this style applied to the interior — for entities that have a fillable area (currently just DrawnPolygon). For a line's own color, use toWwkLineAttributes instead.