Region

data class Region(val id: Long = 0, val polygon: Polygon, val holes: List<Polygon>, val active: Boolean = true, val boundingBox: BoundingBox, val zIndex: Float)

Represents a region on a map.

Constructors

Link copied to clipboard
constructor(id: Long = 0, polygon: Polygon, holes: List<Polygon>, active: Boolean = true, boundingBox: BoundingBox, zIndex: Float)

Properties

Link copied to clipboard
val active: Boolean = true

True if the region is currently displayed on the map, false otherwise (defaults to true).

Link copied to clipboard

The BoundingBox object encompassing the entire region (including holes).

Link copied to clipboard

A list of Polygon objects representing interior holes that define areas excluded from the region.

Link copied to clipboard
val id: Long = 0

The database ID of the region (defaults to 0).

Link copied to clipboard

The outermost Polygon object defining the boundary of the region.

Link copied to clipboard

The layer order on the map where the region should be drawn (higher zIndex means drawn on top of others).

Functions

Link copied to clipboard
fun switch(): Region
Link copied to clipboard
fun Region.toRegionEntity(regionsID: Long, polygonID: Long): RegionEntity

Converts the Region object to a RegionEntity, specifying the foreign key relationships.

fun Region.toRegionEntity(id: Long, regionsID: Long, polygonID: Long): RegionEntity

Converts the Region object to a RegionEntity using a specified id for update purposes, and specifying the foreign key relationships.

Link copied to clipboard

Converts the Region model into the view object RegionViewData used to represent polygons in the UI.