SpatialMapArea

Which circle the spatial map shows. The circle is rebuilt only when it has to be: a node outside it, or the mesh having shrunk well inside it, so the terrain is not rebuilt on every refresh.

Types

Link copied to clipboard
data class Fitted(val nodes: List<SpatialNodeSnapshot>, val outsideCount: Int)

The nodes the map shows and how many were left out.

Link copied to clipboard
data class Selection(val coordinates: List<LatLon>, val outsideCount: Int)

Properties

Link copied to clipboard

Nodes farther than this from the anchor are left out: a mesh with MQTT nodes on another continent cannot be a one-meter model.

Link copied to clipboard
const val SHRINK_RATIO: Double = 0.5

Functions

Link copied to clipboard

With no node positions, the circle around the newest offline map the user downloaded, so the table shows that place. The map the app keeps for the mesh itself is left out.

Link copied to clipboard
fun fit(nodes: List<SpatialNodeSnapshot>, pinned: Set<Long> = emptySet()): SpatialMapArea.Fitted

The nodes the map shows: when some are too far from the connected radio, those are left out, except pinned ones. With no connected radio every node stays.

Link copied to clipboard

The circle around the whole mesh, before any zoom: what terrain downloads cover.

Link copied to clipboard
fun next(current: SpatialCircle?, candidate: SpatialCircle, nodes: List<LatLon>, lastChangeMillis: Long?, nowMillis: Long): SpatialCircle?

The circle to use next: null to keep the current one.

Link copied to clipboard
fun select(coordinates: List<LatLon>, anchor: LatLon?): SpatialMapArea.Selection

The coordinates that fit around the anchor (the connected radio, else the centroid).