DrawnMarker

data class DrawnMarker(val id: EntityId, val style: ShapeStyle, val position: GeoPosition, val size: Float = 16.0f, val label: MarkerLabel? = null, val description: String? = null, val zIndex: Int = 0, val properties: Map<String, String> = emptyMap(), val rotation: Float = 0.0f) : DrawableEntity

A single point on the globe (e.g. a pin), with no vertex list of its own.

Like DrawnPolyline, a marker has no interior — style is applied to the marker's icon/dot color (see com.tcsappdev.worldwinddraw.core.style.ShapeStyle's KDoc).

Constructors

Link copied to clipboard
constructor(id: EntityId, style: ShapeStyle, position: GeoPosition, size: Float = 16.0f, label: MarkerLabel? = null, description: String? = null, zIndex: Int = 0, properties: Map<String, String> = emptyMap(), rotation: Float = 0.0f)

Properties

Link copied to clipboard
open override val description: String?

Free text about the shape (what it is, a source, a note), for the host to show where it likes, for example in a popup when the shape is tapped. The library only keeps it: nothing is drawn from it. null is no description.

Link copied to clipboard
open override val id: EntityId

The id that names this shape, stable for as long as it exists.

Link copied to clipboard

text written next to the icon, or null for none (see MarkerLabel). For a marker that is only text, give it a style that is fully transparent and a label whose position is LabelPosition.Center.

Link copied to clipboard
Link copied to clipboard
open override val properties: Map<String, String>

Data attached to the shape, as named values: what a GeoJSON feature's properties or a KML placemark's ExtendedData hold (a population, a country code, a year, a source). The library only keeps it, it is not drawn, and it is carried through the file formats: nothing in it means anything to the engine, so a host may put what it needs there. Values are text; a number or a flag read from a file comes in as its text (5000000, true) and goes back out as a text. Empty when there is none.

Link copied to clipboard

how far the icon is turned, in degrees clockwise from north (0 as it is; an icon of a plane that points up, turned to 90, points east). It is turned on the globe, so it keeps its direction as the map is turned. Any number is accepted (450 is 90).

Link copied to clipboard
val size: Float

the icon's on-screen size in pixels, must be greater than 0. A renderer without a real icon (a plain com.tcsappdev.worldwinddraw.core.style.ShapeStyle.SolidColor) draws a sizexsize square in that color, so this can't default to something imperceptibly small.

Link copied to clipboard
open override val style: ShapeStyle

How the shape looks (see ShapeStyle for what it means for each kind of shape).

Link copied to clipboard
open override val zIndex: Int

Where the shape lies in the drawing order: a shape with a higher number is drawn over one with a lower number, whatever kind each of them is. Shapes with the same number keep the order of their kinds (polygons below lines below markers) and, within a kind, the order they were added in. A tap on a place where shapes overlap reaches the one that is drawn on top.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This shape with another zIndex (see DrawableEntity.zIndex).