Skip to content

Add offline basemaps for the gallery map - #35

Merged
abrignoni merged 1 commit into
mainfrom
feat/offline-basemaps
Sep 4, 2026
Merged

abrignoni merged 1 commit into
mainfrom
feat/offline-basemaps

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Replaces the disabled openstreetmap.org link with an offline map. GLEAPP ships no map data and requests none: the examiner imports a basemap file after installation, GLEAPP copies it under the data folder with its SHA-256, serves it from the local server, and MapLibre GL JS draws it. The report names the file and hash the maps were drawn on, so a reader can obtain the same file and see the same map.

  • A .pmtiles vector tileset (recommended) is served by byte range, so pmtiles.js reads only the tiles on screen and the server never decodes a tile. Cut a region from the Protomaps build with pmtiles extract <build> out.pmtiles --bbox=W,S,E,N; measured against the 137.7 GB planet build, the Washington DC metro box was 28 MB in 8 s and Puerto Rico 70 MB in 11 s, zoom 0 to 15.
  • A raster .mbtiles is the fallback for a map an examiner already has: one query per tile, TMS row flipped to XYZ. Vector MBTiles are refused.
  • Maps dialog to import, remove and choose a basemap; a map in the details pane for a geolocated file; a Map view that plots the current filter with clickable thumbnails; the GPS row gets a Copy button.
  • gleapp maps list|import|remove|use|extract, README and manual Maps sections.

Everything is vendored under gleapp/web/static/maps (MapLibre GL JS 5.x, pmtiles.js, the Protomaps style layers, Noto Sans glyphs, v4 sprites), each with its licence; the page loads nothing remote and shows the OpenStreetMap credit as text. Verified against a real DC extract: the details map drew 297 vector features at the photo's coordinate, and the case recorded the basemap name and hash into the report.

🤖 Generated with Claude Code

…no network

Replaces the disabled openstreetmap.org link. GLEAPP ships no map data and requests
none; the examiner imports a basemap file after installation, GLEAPP copies it under
the data folder with its SHA-256, serves it locally, and MapLibre GL JS draws it.

- gleapp/basemaps.py: import/list/remove/activate, PMTiles v3 header read from the
  bytes, raster MBTiles served tile by tile with the TMS-to-XYZ row flip, a local-only
  MapLibre style, and the case recording which basemap its maps were drawn on
- A .pmtiles vector tileset is served by byte range (send_file, conditional); a raster
  .mbtiles is the fallback; vector MBTiles are refused
- Maps dialog, a map in the details pane for a geolocated file, and a Map view that
  plots the current filter; the GPS row gets a Copy button instead of the outbound link
- Report names the basemap and hash so a reader can reproduce the view; gleapp maps
  list|import|remove|use|extract; README and manual Maps sections
- Vendored under gleapp/web/static/maps: MapLibre GL JS 5.x, pmtiles.js, the Protomaps
  style layers, Noto Sans glyphs and v4 sprites, each with its licence; the page loads
  nothing remote and attribution is shown as text

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@abrignoni
abrignoni merged commit e464c77 into main Sep 4, 2026
8 checks passed
@abrignoni
abrignoni deleted the feat/offline-basemaps branch September 4, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant