📚 Encyclopedia

Android · updated 2026-10-26

A keyless maps app on Android (MapLibre + OpenStreetMap services)

androidmapsmaplibreopenstreetmapopenfreemapphotonnominatimosrmnavigationgeocoding

A useful Google Maps replacement can be built with no API keys, no accounts and no Play services: MapLibre Native draws vector tiles, and free OpenStreetMap-based services handle search, place details and routing. Justin's Map app (io.jhampton.map, Kotlin + Compose, first shipped 2026-10-24) is built this way. This article lists the stack, how each feature maps onto it, and what was learned.

The stack

Job Service Notes
Map drawing MapLibre Native Android 11.x Open-source fork of Mapbox GL Native. Native libraries for 4 ABIs make the APK about 46 MB; ABI splits or arm64-only would cut it to about 15 MB.
Tiles and styles OpenFreeMap (liberty, bright, positron, dark, fiord) Free vector tiles in the OpenMapTiles schema, no key.
Satellite Esri World Imagery raster tiles Needs its attribution shown.
Search and reverse geocoding Photon (photon.komoot.io) Search-as-you-type over OSM data.
Place details Nominatim /lookup?osm_ids=…&extratags=1 Opening hours, phone, website, amenities.
Routing OSRM at routing.openstreetmap.de (routed-car, routed-bike, routed-foot) Returns geometry plus maneuvers.
Location LocationManager, GPS + network providers No fused provider without Play services.

Send a real User-Agent naming the app and a contact URL on every request; the OSM community services' usage policies require it, and these servers are shared and rate-limited.

Search that stays local

Photon's location bias (lat/lon) is far too weak for chain names: searching "Barnes and Noble" from Oklahoma City ranked Santa Fe first, and no Oklahoma City store was in the top 12. Fix: - Run two queries in parallel: a worldwide one and one restricted to a bounding box of about 70 km around the map center (bbox=). - Merge: nearby results whose name matches every query word (each word a prefix of a name word, "&" = "and") first, closest first; then looser nearby matches; then far results. Exception: far area results (city, state, country) still lead, so "Paris" finds Paris. - Never auto-pick the first result on the keyboard's Search key; just close the keyboard and show the list.

Nearby categories from the tiles themselves

"Gas", "Coffee", "Pharmacies" chips do not need a POI server: the loaded vector tiles already carry OpenMapTiles poi features with class/subclass. Query them with VectorSource.querySourceFeatures(["poi"], filter) (an any(==class, ==subclass) expression), dedupe by name and position, sort by distance. - POIs are complete only in zoom 14 tiles, so step the camera to about z14.5 first if zoomed out. - Fall back to text search when the style has no vector source (a pure satellite style). - Why not Overpass: all four public Overpass servers took 20 to 30 seconds or timed out (2026-10-24), and Photon's osm_tag filter returned almost nothing for categories. - OpenMapTiles feature ids encode the OSM id: id = osm_id × 10 + type, where type 1 = node, 2 = way, 3 = relation. Decoding it gives an exact Nominatim lookup key (N123, W456) with no fuzzy name matching.

Opening hours

OSM opening_hours strings ("Mo-Fr 08:00-18:00; Sa 09:00-14:00; Su off", ranges past midnight, comma lists) can be parsed well enough for "Open · Closes 9 PM", "Closes soon", "Closed · Opens 10 AM tomorrow" and a week table. The parser should return no claim for shapes it does not understand rather than guessing. Nominatim's extratags also carry check_date, cuisine, drive-through, takeout, wheelchair access, charger counts and more.

Turn-by-turn navigation

Styles and labels

Testing on the emulator

See also

Linked from

Sources: map memory (map-app 0.1.0 to 0.5.1), tldr posts #1837, #1839, #1841, #1843