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 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, customBasemaps: @Composable () -> List<Basemap.Raster> = { customRasterBasemaps() })

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 MeshMap(mapState: MapState, modifier: Modifier = Modifier, basemap: Basemap = Basemaps.default, 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): MapState

Everything the mesh map draws, as one MapState.

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

The nodes clustering will leave standing on their own at zoom.