DrawnPolyline

data class DrawnPolyline(val id: EntityId, val style: ShapeStyle, val vertices: List<Vertex>, val lineWidth: Float = 1.0f, val description: String? = null, val zIndex: Int = 0, val properties: Map<String, String> = emptyMap()) : DrawableEntity

An open line defined by an ordered list of vertices. Requires at least 2 vertices — a single point cannot describe a line.

A polyline has no interior, so style is applied to the line itself (its stroke) rather than a fill — see ShapeStyle's KDoc for how a mapper resolves this per entity type.

Constructors

Link copied to clipboard
constructor(id: EntityId, style: ShapeStyle, vertices: List<Vertex>, lineWidth: Float = 1.0f, description: String? = null, zIndex: Int = 0, properties: Map<String, String> = emptyMap())

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

the stroke's thickness in screen pixels, must be greater than 0.

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
open override val style: ShapeStyle

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

Link copied to clipboard
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).