# How Mesh+ added a Meshtastic node map in 185 KiB without Google Play Services

> Mesh+ 0.6.0 added an interactive OpenStreetMap node map to Android for 185.4 KiB (106 lines of Kotlin, zero Google Play Services, zero location permissions) and Apple Maps on iPhone in 36 lines of SwiftUI.

Published November 23, 2026 on Mesh+ Notes: https://blog.meshplus.app/meshtastic-node-map-in-185-kib-without-google-play-services/

[Mesh+](https://meshplus.app/) added a live node map in version 0.6.0 on 14 November 2026, and the Android APK grew by 189,890 bytes (185.4 KiB), from 4,148,449 bytes in v0.5.2 to 4,338,339 bytes in v0.6.0. Even after v0.6.1 added a theme switcher three days later, the whole release APK sits at 4,342,535 bytes (4.14 MiB), compared with 61.8 MiB for the official Meshtastic Android F-Droid universal APK (v2.8.4) and 78.0 MiB for its Google Play build. The map runs on OpenStreetMap tiles on Android via 106 lines of Kotlin and on native Apple Maps on iPhone via 36 lines of SwiftUI, with no Google Play Services, no API keys, no storage permissions, and no location permissions.

Everything below was checked on 23 November 2026 against `backmeupplz/meshtastic-plus` at commit `b6d095c6118b` (v0.6.1), the published release APKs unpacked locally with Python's `zipfile`, and the exact `ColorMatrix` and protobuf math run in Python. I did not run Gradle, Xcode, or a live radio while writing this, so the behavior comes from reading the source and inspecting the shipped binaries rather than filming a phone screen.

## Where the 185.4 KiB actually went

Most mobile map stacks pull in a native C++ vector renderer, custom font glyphs, or Google Play Services, which turns a small utility app into a 40 MB download overnight. For Mesh+, I wanted the exact same map on both Google Play and F-Droid builds without keeping a secret API key in CI or breaking reproducible F-Droid builds.

On Android, `app/build.gradle.kts` adds one dependency: `org.osmdroid:osmdroid-android:6.1.20`, with R8 minification (`isMinifyEnabled = true`) and resource shrinking (`isShrinkResources = true`) turned on for release builds. Unpacking the shipped v0.5.2, v0.6.0, and v0.6.1 APKs from [GitHub Releases](https://github.com/backmeupplz/meshtastic-plus/releases) shows every byte the Map tab added:

| Release | Date | APK bytes | Zip entries | `classes.dex` | `resources.arsc` |
|---|---|---:|---:|---:|---:|
| v0.5.2 | 2026-11-11 | 4,148,449 | 90 | 2,930,996 | 1,075,644 |
| v0.6.0 (Map tab) | 2026-11-14 | 4,338,339 | 110 | 3,049,200 | 1,100,300 |
| v0.6.1 (Theme setting) | 2026-11-17 | 4,342,535 | 110 | — | — |

The jump from v0.5.2 to v0.6.0 breaks down cleanly into three buckets:

- `classes.dex` grew by **118,204 bytes** (115.4 KiB) after R8 stripped everything in `osmdroid` that `Map.kt` never calls.
- `resources.arsc` grew by **24,656 bytes** (24.1 KiB), which covers the new map UI strings across all 24 localized resource directories.
- 20 new resource files (drawables and XMLs bundled by `osmdroid` plus the Material Map tab icon) added roughly **46 KiB**.

For reference, the latest official `Meshtastic-Android` release checked today (v2.8.4, published 4 November 2026) ships `androidApp-fdroid-universal-release.apk` at 64,833,919 bytes (61.8 MiB), `androidApp-fdroid-arm64-v8a-release.apk` at 48,417,736 bytes (46.2 MiB), and `androidApp-google-release.apk` at 81,798,339 bytes (78.0 MiB). Keeping Mesh+ around 4.1 MiB means you can download or sideload it over a weak mountain signal in seconds without waiting for a map engine to unpack.

## Android: 106 lines of Kotlin and zero extra permissions

The entire Android map lives in `Map.kt`, wrapped inside a Jetpack Compose `AndroidView`. Because `osmdroid` is an older View-based library, three small setup lines in the `factory` block prevent the classic headaches people hit when embedding OpenStreetMap on Android:

```kotlin
Configuration.getInstance().apply {
    userAgentValue = ctx.packageName // OSM's tile policy blocks osmdroid's default user agent
    osmdroidBasePath = File(ctx.cacheDir, "osmdroid") // app cache, so no storage permission
    osmdroidTileCache = File(osmdroidBasePath, "tiles")
}
```

Each of those lines solves a real failure mode. OpenStreetMap's tile usage policy rejects `osmdroid`'s default generic user agent, so setting `userAgentValue` to `com.borodutch.meshplus` keeps tiles loading reliably. Pointing `osmdroidBasePath` and `osmdroidTileCache` at `ctx.cacheDir` keeps cached tiles inside the app's private cache directory, so Android never has to ask for external storage access. Adding `CopyrightOverlay(ctx)` satisfies OpenStreetMap's attribution requirement on screen, and its text color switches between light gray and black when the theme changes.

More importantly, `app/src/main/AndroidManifest.xml` asks for **no location permissions at all**. Neither `ACCESS_FINE_LOCATION` nor `ACCESS_COARSE_LOCATION` appears in the manifest, and `BLUETOOTH_SCAN` keeps `android:usesPermissionFlags="neverForLocation"`. The map plots coordinates broadcast by nodes over the LoRa mesh, never your phone's own GPS.

Every node pin is drawn on an off-screen `Canvas` as a 40 dp circle in `nodeColor(n.num)` with a 2.5 dp white border and the node's short name centered inside. Nodes heard within the last two hours (and your own connected node) render at full opacity (`1f`), while older nodes dim to `0.5f`, matching the two-hour online rule used elsewhere in the app. Blocked nodes are filtered out before anything hits the map. On first layout, the camera fits the bounding box of all placed nodes with 96 px padding and caps the zoom at `15.0` so a single node on the map does not zoom all the way into a street corner.

## Dark OpenStreetMap tiles with a 3-step ColorMatrix

Standard OpenStreetMap raster tiles are light-only. Switching to a hosted dark tile style would mean an API key, usage quotas, and a third-party vendor dependency, and shipping a vector tile renderer would blow up the APK size. When v0.6.1 added a Theme picker (`System`, `Light`, `Dark`) in Settings, the map needed dark tiles without adding a single byte of tile assets.

`Map.kt` solves that in eleven lines by attaching a `ColorMatrixColorFilter` (`NIGHT`) to `map.overlayManager.tilesOverlay` whenever `darkTheme()` is true. The matrix chains three operations in order:

1. **Invert RGB channels** (`-1` scale, `+255` offset) so off-white land becomes dark charcoal and dark street labels become light gray.
2. **Rotate hue by 180 degrees** (using Rec.709 luminance weights `0.213 / 0.715 / 0.072`) so inverting brightness does not invert hue, keeping water blue and forests green instead of brown and purple.
3. **Cut saturation to 0.6** (`setSaturation(0.6f)`) so roads and parks sit quietly behind the bright node badges.

Running those exact three matrices in Python against standard OpenStreetMap tile colors shows why step two matters:

| Map feature | OSM light tile | Plain invert only | Mesh+ `NIGHT` matrix |
|---|---|---|---|
| Land | `#f2efe9` | `#0d1016` | `#11100c` |
| Water | `#aad3df` | `#552c20` (rusty brown) | `#203940` (slate blue) |
| Park / forest | `#c8facc` | `#370533` (dark magenta) | `#001b00` (dark green) |
| Primary road | `#fcd6a4` | `#03295b` (navy) | `#392204` (muted amber) |
| Dark label | `#333333` | `#cccccc` | `#cccccc` |

The Compose `update` callback re-runs whenever you flip Settings → Theme, applying or clearing the `NIGHT` filter and flipping the copyright overlay color without recreating the `MapView`.

## iPhone: 36 lines of SwiftUI and zero extra dependencies

On iOS, `ios/MeshPlus/Map.swift` skips third-party map libraries completely and uses SwiftUI's native `MapKit` (`Map(initialPosition: .automatic)`). That gives the iPhone app native dark mode, smooth vector tiles, and automatic bounding-box framing for zero added bundle size.

One small touch in `Map.swift` is wrapping the whole view in `TimelineView(.periodic(from: .now, by: 30))`. Every 30 seconds, SwiftUI re-evaluates `now` so a node that crosses the two-hour `online(now)` threshold fades from opacity `1` to `0.5` on its own even if no new radio packets arrive. Tapping any circular `Annotation` badge opens that node's profile sheet, identical to Android.

## Decoding Meshtastic coordinates without a protobuf runtime

Mesh+ does not bundle `protobuf-java` or SwiftProtobuf; both apps parse Meshtastic's `mesh.proto` wire format in about 100 lines (`Proto.kt` and `Proto.swift`). Coordinates arrive in two places: inside the initial `NodeInfo` sync (`fromRadio` field 4, submessage 3) and in live `POSITION_APP` packets (`portnum = 3`).

Meshtastic encodes `latitude_i` and `longitude_i` as `sfixed32` integers scaled by `1e-7` degrees. Because Mesh+'s lightweight wire parser stores all integer and fixed-width fields in a 64-bit `Long` (Kotlin) or `Int64` (Swift), reading a western-hemisphere longitude without sign-extending the 32-bit value breaks every map pin west of Greenwich or south of the equator.

Take the coordinates in `ProtoTest.kt` and `ProtoTests.swift` (`latitude_i = 499357000`, `longitude_i = -1230345000`, near Garibaldi Lake in British Columbia, which is also where the built-in Demo mode places its five trail nodes):

- On the wire, `-1230345000` is the four little-endian bytes `d8 6c aa b6`.
- Read as an unsigned 32-bit value inside a 64-bit integer, those bytes equal `3,064,622,296`, which multiplies out to `306.4622296` degrees, completely off the globe.
- Narrowing through signed 32-bit first (`p.long(2).toInt() * 1e-7` in Kotlin, `Double(Int32(truncatingIfNeeded: p.long(2))) * 1e-7` in Swift) recovers `-123.0345` cleanly.

Nodes without a GPS fix either omit the `Position` message or send `(0, 0)`, so `latLon()` returns `null` / `nil` whenever both values are zero rather than dropping half your mesh on Null Island in the Gulf of Guinea.

## Handing off directions to the maps app you already have

The Map tab in Mesh+ is built for one job: seeing where the nodes around you are and tapping one to open its profile. It does not bundle offline tile pack downloads, geofencing, or turn-by-turn routing, because your phone already has a dedicated maps app that does those well.

Instead, tapping a node's coordinates on its profile page hands the pin straight to the system maps app: Android fires an `ACTION_VIEW` intent for `geo:<lat>,<lon>?q=<lat>,<lon>(<name>)` (so whatever offline or online maps app you use, such as Organic Maps, OsmAnd, or Google Maps, picks it up), and iOS opens `https://maps.apple.com/?ll=<lat>,<lon>&q=<name>`. That keeps Mesh+ focused on fast radio chat, plain-English node settings, USB/Bluetooth firmware updates, and a quick mesh overview without duplicating a 60 MB navigation suite.

If you want to try the map before pairing a radio, open [Mesh+](https://meshplus.app/) on Android (Google Play, F-Droid, or direct APK) or iPhone and launch Demo mode. It simulates five Meshtastic nodes spread around Garibaldi Lake so you can tap pins and test dark mode immediately. You can also [compare Mesh+ with the official Meshtastic app](https://meshplus.app/compare.html), estimate link margins with our [Meshtastic range and link budget calculator](https://meshplus.app/tools/range/), or read the full map code in [backmeupplz/meshtastic-plus](https://github.com/backmeupplz/meshtastic-plus).

