feat: Add Map Generator tab for offline map tile downloading#2599
feat: Add Map Generator tab for offline map tile downloading#2599MartinovEm wants to merge 37 commits into
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
0f18283 to
e6e75da
Compare
2861132 to
bf1f572
Compare
|
Fix: OSM tiles returning 403 in packaged builds (commit 97e9739) While working on the Map Generator tab, I noticed that the packaged/release builds of the configurator get 403 errors from OSM tile servers (affects GPS tab, Mission Control — any tab that loads OSM tiles). Dev mode works fine. Root cause: The packaged build loads the app using the local file protocol (
In dev mode, Vite serves via Fix: Added This brings the configurator into compliance with OSM's tile usage requirements. |
Add a new Map Generator tab that allows downloading offline map tiles for OSD map widgets on radios. Works without a flight controller connection. Supported output targets: b14ckyy ETHOS Mapping Widget, Yaapu Telemetry (ETHOS and EdgeTX sub-targets). Map providers: OpenStreetMap, ESRI, Google (Street/Satellite/Hybrid/Terrain). Features: draw rectangle to select download area with live measurements, configurable zoom level range (0-19), sync tiles directly to mounted SD card, export tiles as ZIP archive, eject SD card from the app (Windows/macOS/Linux), local tile cache for faster repeated downloads, save/restore settings persistence, geocoder search, measure tool, right-click context menu.
- New target: INAV Terrain generates .DAT files from NASA SRTM1 30m data - SRTM conversion engine: HGT download, gzip decompression, bilinear interpolation, CRC16-XMODEM checksums, INAV-compatible DAT format - IndexedDB HGT cache for resume/reuse of downloaded SRTM tiles - 1 degree x 1 degree terrain grid overlay with .DAT filename labels - Live altitude readout from cached SRTM data on mouse hover - Terrain status: selected area, grid coverage, estimated size, file list - SRTM coverage warning for selections beyond 60N/56S - SD card sync with FREESPAC.E auto-deletion and write progress - ZIP export alternative when no SD card linked - Completion screen with CLI enable command (set terrain_enabled = ON) - Ocean bathymetry clamped to 0m (matches INAV firmware behavior)
SonarCloud flags 'syncAborted is not modified in this loop' when the variable is checked in the for-condition. Moving the check to an explicit if/break inside the loop body resolves the false positive (syncAborted is set by the async cancel button handler between await iterations).
- Fix EPERM when writing .DAT files to drive root (mkdir on G:\ fails) - Auto-detect SD card removal on tab load and window focus (pathExists IPC) - Separate tile cache and HGT cache UI per target mode - Style HGT cache clear button to match tile cache button - Rename Clear Cache to Clear Tile Cache (only clears map tiles now)
ead53a0 to
18be333
Compare
- package.json: replace file-saver with fflate (upstream), keep jszip/leaflet/leaflet-control-geocoder/leaflet-draw (Map Generator) - locale/en/messages.json: keep mapgen* keys, add layer* keys from upstream geo layers feature (mission control)
…n.lock - package.json: fix fflate indentation conflict (keep all deps from both sides) - yarn.lock: regenerated after merge to include all packages
|
That's really interesting. I have confirmed it does set the User-Agent as required -- but I checked in dev mode. Speaking of their TOS, I see also: Do you have thoughts on that? I think the spirit of it is they don't want people downloading tiles they don't end up using, to reduce wasteful load on their servers. Would this feature, if merged, potentially cause that? |
|
@sensei-hacker Thanks for pointing this out! I agree with your interpretation of the OSM Standard tile policy regarding offline/bulk download. Before I change behavior in this PR, I want to confirm the intended direction with you:
If you agree with this direction, I will implement it in this PR. |
Seems reasonable to me. I see that for example MapTiler offers up to 5,000 sessions per month with their free tier, using the same API. Would it make sense to have a link to a documentation page that has a couple such providers? |
…map-generator # Conflicts: # js/appUpdater.js
|
@sensei-hacker Thank you for the suggestions! I've implemented the first part:
Regarding MapTiler: I'm starting work on adding it as a provider directly in the dropdown. Since it requires a personal API key, the UI will include a key input field (shown only when MapTiler is selected) with a short inline message guiding users to get a free key at maptiler.com -- no separate documentation page needed. |
That will probably be more convenient than the existing API key field that is under the gear icon at top right of Configurator, won't it. I guess it can be the same setting under the hood, but just put the input field right where people need it? |
|
@sensei-hacker Thanks for the suggestion! Just to clarify — there isn't an existing map API key field under the gear icon. The gear settings only have the map provider for the Mission/GPS tabs (OSM / ESRI / MapProxy with URL + layer), which is separate from the Map Generator. So the key is new and lives right in the Map Generator tab where it's most useful, stored persistently in Here's a summary of what's been added: New provider: MapTiler with 6 map types:
The key input shows only when MapTiler is selected, with an inline "Get a free key at maptiler.com" link. A help icon next to the Provider dropdown links directly to the README setup section. MapTiler's free tier covers 5,000 sessions/month which is plenty for personal use.
Full setup guide with registration steps: README → MapTiler Setup |
|







Add a new Map Generator tab that allows downloading offline map tiles for OSD map widgets on radios. Works without a flight controller connection.
Supported output targets: b14ckyy ETHOS Mapping Widget, Yaapu Telemetry (ETHOS and EdgeTX sub-targets). Map providers: OpenStreetMap, ESRI, Google (Street/Satellite/Hybrid/Terrain). Features: draw rectangle to select download area with live measurements, configurable zoom level range (1-20), sync tiles directly to mounted SD card, export tiles as ZIP archive, eject SD card from the app (Windows/macOS/Linux), local tile cache for faster repeated downloads, save/restore settings persistence, geocoder search, measure tool, right-click context menu.