Package-level declarations

Types

Link copied to clipboard
sealed interface DrawableEntity

The common contract every shape a user can draw must satisfy: it has a stable id and a visual style, and may carry a description and a zIndex. Code that manages entities generically (repository, undo/redo history, rendering) depends only on this contract, never on a specific shape type.

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

Link copied to clipboard
data class DrawnPolygon(val id: EntityId, val style: ShapeStyle, val vertices: List<Vertex>, val outlineStyle: ShapeStyle? = null, val outlineWidth: Float = 1.0f, val extraRings: List<List<Vertex>> = emptyList(), val description: String? = null, val zIndex: Int = 0, val properties: Map<String, String> = emptyMap()) : DrawableEntity

A closed, filled shape: a ring of vertices, and optionally extraRings — more rings of the same shape, each of them either another separate part (the Aegean islands, Thrace beside Anatolia) or a hole in a part (a lake, an enclave). Every ring needs at least 3 vertices, as fewer points cannot describe an enclosed area.

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

Link copied to clipboard
value class EntityId(val id: String)

A stable identifier for a single DrawableEntity (a whole shape, not one of its vertices).

Link copied to clipboard
data class GeoPosition(val latitude: Double, val longitude: Double, val altitude: Double = 0.0)

An immutable location on the globe, expressed in degrees of latitude/longitude and meters of altitude above the reference ellipsoid.

Link copied to clipboard

Great-circle (shortest path on a sphere) math. WWK draws a shape's edges as great-circle arcs, which are NOT straight lines in latitude/longitude — over a long edge the two visibly differ — so anything that has to line up with a drawn edge must follow the arc, not the straight line.

Link copied to clipboard

Where a MarkerLabel is written, as seen from the marker's icon.

Link copied to clipboard
class LocalFrame(val origin: GeoPosition)

A flat map of a small piece of the globe (a plot of land) in metres, around origin: a metre to the east is N cos(latitude) and a metre to the north is M on the WGS84 ellipsoid at the origin (N and M the radii of curvature across and along a meridian), so distances on it are right at the origin and out by about tan(latitude) times the distance over the radius of the Earth away from it (a fifth of a percent at 10 km at the latitude of Turkey).

Link copied to clipboard
data class MarkerLabel(val text: String, val color: ColorRgba = ColorRgba(255, 255, 255), val size: Int = 14, val outlineColor: ColorRgba? = ColorRgba(0, 0, 0), val position: LabelPosition = LabelPosition.Above)

The text written next to a DrawnMarker.

Link copied to clipboard
class OutlineWalk(ring: List<GeoPosition>, startIndex: Int = 0, reversed: Boolean = false, closed: Boolean = true)

Walking once round the outline of a shape, from a starting corner, the way a pen draws it: pathTo is what the pen has drawn when it is a given part of the way round, and pointAt is where the pen is.

Link copied to clipboard

Drops the points of a path or a ring that don't change its shape by more than a tolerance (Douglas-Peucker), so a shape with thousands of points can be drawn with far fewer when it is seen from far away. It works on the sphere: the distance of a point to the line a shape would be drawn with is its distance to the great-circle arc between the neighbours that are kept, because that is how WWK draws an edge, and plain latitude/longitude distances are wrong at high latitudes and over long edges.

Link copied to clipboard
class Plane(val x: Double, val y: Double)

A point on the local plane, in metres: x to the east and y to the north of the origin of its LocalFrame.

Link copied to clipboard

The visual centre of a polygon: the point inside it that is farthest from its edges, which is where a label or a picture looks centred ("pole of inaccessibility"). Unlike the area centroid or the middle of the bounding box it is always inside the shape, and it sits in the fattest part of it: for a horseshoe or a country with a long arm the centroid can lie outside or in a thin stretch, while this lands in the body. It also gives the radius of the biggest circle that fits inside the shape around that point.

Link copied to clipboard

Tells the separate parts of a shape of several rings (see DrawnPolygon) from each other: which rings are a part's outline and which are holes in it. There is nothing in the rings that says so, it follows from where they lie under the even-odd rule: a ring inside an odd number of other rings is a hole, inside an even number (none, or a hole) an outline, and a hole belongs to the innermost ring around it.

Link copied to clipboard
object SpanMover

Moves one vertex of a shape together with the vertices hidden between it and its neighbouring "anchors", so a stretch of a border can be reshaped by dragging one of a few handles instead of every one of its points.

Link copied to clipboard
data class Vertex(val id: VertexId, val position: GeoPosition, val metadata: Map<String, String> = emptyMap())

A single, editable corner point of a DrawnPolygon or DrawnPolyline.

Link copied to clipboard
value class VertexId(val id: String)

A stable identifier for a single Vertex, independent of that vertex's current GeoPosition. Two VertexIds are only equal if they wrap the same underlying string.

Link copied to clipboard
object Wgs84

The WGS84 ellipsoid, the shape of the Earth that GPS and WorldWind use. A plot of land is measured on it, and not on a ball: a ball of the mean radius is out by a tenth of a percent of an area at the latitude of Turkey (a metre of every dönüm) and by nearly half a percent at the equator, which is more than a surveyor's figure leaves room for.

Functions

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

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