Package-level declarations

Types

Link copied to clipboard
class MapLibreMapViewProvider(customLayers: @Composable () -> List<CustomLayer> = { emptyList() }, customBasemaps: @Composable () -> List<Basemap.Raster> = { customRasterBasemaps() }, basemapMenuExtra: @Composable () -> Unit = { CustomTileSourcesMenuItem() }, offlineMapsSupported: Boolean = false, waypointEditor: @Composable (WaypointEditRequest) -> Unit = { request -> DefaultWaypointEditor(request) }, sitePlanner: @Composable (SitePlannerSession) -> Unit? = null, layersSheetExtra: @Composable () -> Unit = {}) : MapViewProvider

MapLibre implementation of MapViewProvider, shared by the F-Droid flavor and the desktop app.

Link copied to clipboard
class SitePlannerSession(val nodeNum: Int?, val mapCenter: () -> Position, val moveTo: (Position) -> Unit, val onDismiss: () -> Unit)

A Site Planner session the map is asking its host to run.

Link copied to clipboard
class WaypointEditRequest(val waypoint: Waypoint, val onSend: (Waypoint) -> Unit, val onDelete: (Waypoint) -> Unit, val onDismiss: () -> Unit, val onBeginBoxAuthoring: (Waypoint) -> Unit)

A waypoint the map is asking its host to present an editor for.

Functions

Link copied to clipboard
fun installMapLibreLogging(logger: Logger = Logger.withTag(MAP_LOG_TAG))

Routes maplibre-compose's log through Kermit. Its default logger prints to the platform console, which the packaged desktop app does not have, so a swallowed map failure never reached the Debug screen export.

Link copied to clipboard
fun MapLibreDiscoveryMap(userLatitude: Double, userLongitude: Double, nodes: List<DiscoveryMapNode>, modifier: Modifier = Modifier, customBasemaps: @Composable () -> List<Basemap.Raster> = { customRasterBasemaps() })

Discovery scan summary map: the scanner plus everything it heard.

Link copied to clipboard
fun MapLibreInlineMap(node: Node, modifier: Modifier = Modifier, customBasemaps: @Composable () -> List<Basemap.Raster> = { customRasterBasemaps() })

Single-node mini-map embedded in the node detail sheet.

Link copied to clipboard
fun MapLibreNodeTrackMap(destNum: Int, positions: List<Position>, modifier: Modifier = Modifier, selectedPositionTime: Int? = null, onPositionSelect: (Int) -> Unit? = null, showAttribution: Boolean = true, customBasemaps: @Composable () -> List<Basemap.Raster> = { customRasterBasemaps() }, viewModel: SharedMapViewModel = metroViewModel())

Historic position track for one node, with tap-to-select synchronised to the caller's list.

Link copied to clipboard
fun MapLibreTracerouteMap(forwardRoute: List<Int>, returnRoute: List<Int>, nodeLookup: Map<Int, Node>, modifier: Modifier = Modifier, customBasemaps: @Composable () -> List<Basemap.Raster> = { customRasterBasemaps() })

Traceroute result map: forward and return paths plus the hops they pass through.

Link copied to clipboard
fun MapLibreTracerouteMapSlot(tracerouteOverlay: TracerouteOverlay?, tracerouteNodePositions: Map<Int, Position>, onMappableCountChange: (shown: Int, total: Int) -> Unit, modifier: Modifier = Modifier, customBasemaps: @Composable () -> List<Basemap.Raster> = { customRasterBasemaps() }, viewModel: SharedMapViewModel = metroViewModel())

Host-facing traceroute map for the MapLibre hosts. The seam hands over an overlay plus snapshot positions, and the shared selection helper resolves those into placeable nodes so every host counts "mappable hops" the same way.

Link copied to clipboard
fun MeshMap(mapState: MapState, modifier: Modifier = Modifier, basemap: Basemap = Basemaps.default, extraCredits: List<String> = emptyList(), onMapLongClick: (Position) -> Unit = {}, onMapClick: (Position) -> Unit = {})

The mesh map, rendered by MapLibre.

Link copied to clipboard
fun nodesBoundingBox(nodes: List<Node>): BoundingBox?

MapBounds.aroundNodes as the box MapLibre wants.

Link copied to clipboard
fun nodesByIsolation(nodes: List<Node>, zoom: Int, radiusPx: Int): List<Node>

nodes ordered by how alone each one is: fewest neighbours within radiusPx first.

Link copied to clipboard
fun nodesInView(nodes: List<Node>, bounds: BoundingBox?): List<Node>

The nodes inside bounds, or all of them when there are none to compare against.

Link copied to clipboard
fun BoundingBox.padded(fraction: Double): BoundingBox

This box grown by fraction of its own span on every side.

Link copied to clipboard
fun positionsBoundingBox(positions: List<Position>): BoundingBox?

MapBounds.around as the box MapLibre wants.

Link copied to clipboard
fun rememberMeshMapState(viewModel: BaseMapViewModel, navigateToNodeDetails: (Int) -> Unit, basemap: Basemap = Basemaps.default, initialCameraPosition: CameraPosition = CameraPosition(), overlays: List<MapOverlay> = emptyList(), layerOpacity: Map<String, Float> = emptyMap(), customLayers: List<CustomLayer> = emptyList(), onClusterMembers: (List<ClusterMember>) -> Unit = {}, onWaypointClick: (Int) -> Unit = {}, boxCorner: Position? = null, locationState: LocationState? = null, followLocation: Boolean = false, bearingUpdate: BearingUpdate = BearingUpdate.Ignore, frameOnNodes: Boolean = true, surveyCells: List<SurveyCellUi> = emptyList(), surveyHeatPoints: List<SurveyCellUi> = emptyList(), surveyColors: Map<Quality, Color> = emptyMap(), surveyLinks: List<SurveyLink> = emptyList(), onSurveyCellClick: (String) -> Unit = {}): MapState

Everything the mesh map draws, as one MapState.