Offline-Karten: POI-Marker offlinetauglich + Offline-Banner klappt ein (Geraetetest-Befunde)
- MapOffline.downloadAround speichert zusaetzlich /api/osm/pois je Typ fuer die Region-Bbox in IndexedDB (Key-Praefix p/, Merge per id — zweite Region loescht die erste nicht); MapOffline.pois(type,bbox) filtert fuer den Ausschnitt - map.js Phase-1-Fallback: Fetch fehlgeschlagen (offline) -> gespeicherte Region-POIs statt leerer Karte; Download-Toast zeigt Marker-Anzahl - Offline-Banner: nach 5s auf schmale Icon-Leiste eingeklappt (verdeckte die Karten-Legende); Inline-Styles nach components.css konsolidiert - Bump v1223
This commit is contained in:
parent
c5bdad2d86
commit
e2c75f04bc
9 changed files with 106 additions and 37 deletions
|
|
@ -1477,7 +1477,15 @@ window.Page_map = (() => {
|
|||
const pois = await fetch(`/api/osm/pois?${params}`).then(r => r.json());
|
||||
_replaceOsmMarkers(layerKey, pois);
|
||||
return pois.length;
|
||||
} catch { return 0; }
|
||||
} catch {
|
||||
// Offline: gespeicherte Region-POIs aus IndexedDB (MapOffline.downloadAround
|
||||
// legt sie beim Region-Download mit ab) statt leerer Karte.
|
||||
try {
|
||||
const off = window.MapOffline ? await MapOffline.pois(osmType, bbox) : [];
|
||||
if (off.length) { _replaceOsmMarkers(layerKey, off); return off.length; }
|
||||
} catch (e) {}
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
const fastCounts = await Promise.all(fastTasks);
|
||||
const fastTotal = fastCounts.reduce((a, b) => a + b, 0);
|
||||
|
|
@ -2152,7 +2160,7 @@ window.Page_map = (() => {
|
|||
_setOsmStatus(`Offline: ${Math.round(p.done / p.total * 100)} %…`);
|
||||
});
|
||||
_setOsmStatus('');
|
||||
UI.toast.success(`Gegend offline gespeichert — ${res.tiles} Kacheln, ${(res.bytes / 1048576).toFixed(1)} MB.`);
|
||||
UI.toast.success(`Gegend offline gespeichert — ${res.tiles} Kacheln, ${res.pois || 0} Marker, ${(res.bytes / 1048576).toFixed(1)} MB.`);
|
||||
window.OfflineIndicator?.refresh(); // Pfoten-Segment 5 sofort grün
|
||||
} catch (e) {
|
||||
_setOsmStatus('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue