mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-03 03:11:57 +00:00
feat(map): base layers - Topo, Light, Dark, Satellite, Esri Topo
Map tools > Layers > Map picks what the map is drawn from: - Topo: OpenTopoMap, as before. - Light and Dark: Esri's grey canvases, no labels, up to z16. - Satellite: Esri World Imagery. - Esri Topo. Each layer has its own folder for downloaded areas (/sdcard/maps-light, -dark, -sat, -esritopo; Topo stays in /sdcard/maps) and its own live-tile cache. Live-cache records carry the layer. Esri serves JPEG: decoded with LVGL's tjpgd (LV_USE_TJPGD), whatever the file name says. The layer is kept in NVS (mc_ui/layer); switching waits while a download or a deletion runs in the current folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -880,6 +880,11 @@ static void scanTrails() {
|
||||
static void onSavedTrail(lv_event_t* e) { s_ui->savedTrailPopup((int)(intptr_t)lv_event_get_user_data(e)); }
|
||||
|
||||
static void onNavTools(lv_event_t* e) { (void)e; s_ui->navToolsPopup(); }
|
||||
static void onMapLayer(lv_event_t* e) { // the map shows it at once: Map tools out of the way
|
||||
int i = choiceSelected((lv_obj_t*)lv_event_get_target(e));
|
||||
s_ui->navClosePopup();
|
||||
s_ui->setMapLayer(i);
|
||||
}
|
||||
static void onTrails(lv_event_t* e) {
|
||||
s_ui->setTrails(lv_obj_has_state((lv_obj_t*)lv_event_get_target(e), LV_STATE_CHECKED));
|
||||
}
|
||||
@@ -976,6 +981,7 @@ void UITask::navToolsPopup(bool back) {
|
||||
lv_obj_add_event_cb(lsw, onLiveTiles, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
|
||||
g = group(list, "LAYERS");
|
||||
choiceRow(g, "Map", "Topo, light, dark or satellite", mapview::LAYER_OPTS, mapview::s_layer, onMapLayer);
|
||||
lv_obj_t* tsw = switchRow(g, "Hiking trails", "Marked routes in their colours", nullptr);
|
||||
if (lvport::trailsOn()) lv_obj_add_state(tsw, LV_STATE_CHECKED);
|
||||
lv_obj_add_event_cb(tsw, onTrails, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
|
||||
Reference in New Issue
Block a user