Offline-Karten Follow-ups: Staging-Default AN, Karten-Download-Button, Glyph-Persistenz
- by_offline_tiles Default AN auf staging.banyaro.app (localStorage/?tilesoffline=1/0 uebersteuert) - Speed-Dial 'Karte offline speichern': GL -> MapOffline.downloadAround(Kartenmitte, 5km), Leaflet -> alter Raster-Prefetch (_cacheTiles war seit FAB-Redesign verwaist) - Glyphs in IndexedDB (Key-Praefix f/) + byt://f/-Protokoll: ueberlebt App-Updates - OSM-Raster-Prefetch im Offline-Tiles-Modus uebersprungen (GL nutzt das Raster nicht) - Button-Sichtbarkeit gated: GL ohne Offline-Flag (= Production) zeigt ihn nicht
This commit is contained in:
parent
30e82b7931
commit
70a1f5856a
5 changed files with 109 additions and 16 deletions
|
|
@ -21,8 +21,15 @@ window.OfflineIndicator = (() => {
|
|||
}
|
||||
|
||||
// GL-Offline-Tiles-Modus (byt://-Vektorkacheln in IndexedDB) statt OSM-Raster.
|
||||
// Default-Logik MUSS map-gl-style.js _offlineEnabled() entsprechen (Staging-AN seit 2026-06-06);
|
||||
// dupliziert weil map-gl-style.js lazy mit der GL-Karte lädt, dieses Modul aber sofort.
|
||||
function _offlineTilesMode() {
|
||||
try { return localStorage.getItem('by_offline_tiles') === '1'; } catch (e) { return false; }
|
||||
try {
|
||||
const flag = localStorage.getItem('by_offline_tiles');
|
||||
if (flag === '1') return true;
|
||||
if (flag === '0') return false;
|
||||
return location.hostname === 'staging.banyaro.app';
|
||||
} catch (e) { return false; }
|
||||
}
|
||||
// Ist eine Offline-Region (Vektorkacheln) in IndexedDB gespeichert? (ohne MapOffline zu laden)
|
||||
// WICHTIG: dasselbe Schema/Version wie map-offline.js anlegen — sonst legt ein versionsloses open()
|
||||
|
|
@ -373,7 +380,9 @@ window.OfflineIndicator = (() => {
|
|||
function init() {
|
||||
refresh();
|
||||
_prefetchPages();
|
||||
_prefetchTiles();
|
||||
// OSM-Raster-Prefetch nur für die Leaflet-Karte — die GL-Karte (byt://-Vektorkacheln)
|
||||
// nutzt das Raster nicht. Komplett-Entfernung wenn Flag dauerhaft AN (OFFLINE_MAPS_PLAN.md).
|
||||
if (!_offlineTilesMode()) _prefetchTiles();
|
||||
_prefetchData();
|
||||
_bindLongPress();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue