InkHUD: add offline map tile backgrounds and zoom controls#10785
Conversation
- Map background tiles are now rendered on the display when available, compressed with LZ4 to keep flash usage low - If no map tiles are loaded, the map applets behave exactly as before - Zoom in, zoom out, and reset zoom (back to auto-fit) are accessible from the menu, and only appear when the menu is opened from a map screen - The map updates automatically whenever GPS gets a new position or your phone shares a location - The Positions and Favorites map applets now also refresh when mesh position packets arrive for your own node - The Favorites map now shows your position on the map even if you have no favorites yet
⚡ Try this PR in the Web FlasherWarning This is an automated, unreviewed CI test build. Back up your device configuration Supported boards built by this PR (25)
Build artifacts expire on 2026-07-26. Updated for |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24ce05157c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR extends InkHUD’s map applet infrastructure by adding optional offline background map tile rendering (via a generated MapTile.h) and exposing map-specific zoom controls through the InkHUD menu when a map applet is active.
Changes:
- Add
MapAppletsupport for rendering background tiles and maintaining a shared zoom lock, plus GPS-status-driven refresh behavior. - Add map zoom actions to the InkHUD menu and gate their visibility to map contexts.
- Adjust Positions/Favorites map applets to refresh on loopback/local position updates and to show the user position even with no favorites.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/graphics/niche/InkHUD/docs/README.md | Documents the MapApplet base, tile format, and zoom controls. |
| src/graphics/niche/InkHUD/Applets/User/Positions/PositionsApplet.h | Enables loopback handling only while the applet is active. |
| src/graphics/niche/InkHUD/Applets/User/FavoritesMap/FavoritesMapApplet.h | Enables loopback while active; adds enoughMarkers() override. |
| src/graphics/niche/InkHUD/Applets/User/FavoritesMap/FavoritesMapApplet.cpp | Allows map display when only the local node has a position (no favorites yet). |
| src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp | Adds map zoom menu items/actions when the borrowed tile owner is a MapApplet. |
| src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h | Introduces menu actions for map zoom in/out/reset. |
| src/graphics/niche/InkHUD/Applets/Bases/Map/MapTile.h | Adds the default “no tiles bundled” tile header stub. |
| src/graphics/niche/InkHUD/Applets/Bases/Map/MapApplet.h | Adds zoom APIs and GPS status observation hooks. |
| src/graphics/niche/InkHUD/Applets/Bases/Map/MapApplet.cpp | Implements tile rendering, zoom selection, and redraw triggers. |
| src/graphics/niche/InkHUD/Applet.h | Adds asMapApplet() for RTTI-free detection of map applets. |
Firmware Size Report22 targets | vs
Show 17 more target(s)
Updated for 62e2d97 |
Summary
How to add a map to your device
MapTile.hintosrc/graphics/niche/InkHUD/Applets/Bases/Map/replacing the empty defaultDetails
This adds optional map tile rendering to the InkHUD map base applet. Tiles are drawn behind the existing node markers, labels, scale bar, and own-node marker. The committed default tile header contains no tile data, so builds without generated tiles keep the existing marker-only map display.
The menu now detects when it was opened from a map applet and shows map-specific zoom controls only in that context. Reset zoom returns the map to the existing auto-fit behavior.
Testing
20260625_004933.mp4