Compare commits
5 commits
939e48b0c7
...
8e623d8909
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e623d8909 | |||
| de25901fa2 | |||
| 70a1f5856a | |||
| 30e82b7931 | |||
| 695908f937 |
13 changed files with 155 additions and 36 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
1220
|
1222
|
||||||
|
|
@ -2601,6 +2601,18 @@ async def wurfboerse_page():
|
||||||
return HTMLResponse(content=html, headers={"Cache-Control": "max-age=1800"})
|
return HTMLResponse(content=html, headers={"Cache-Control": "max-age=1800"})
|
||||||
|
|
||||||
|
|
||||||
|
# Rechtsseiten: Pfad-URLs (SEO-Footer, App-Store-Metadaten, E-Mails) auf die
|
||||||
|
# SPA-Hash-Routen umleiten — die Inhalte leben als SPA-Seiten (#agb, …).
|
||||||
|
# Muss VOR dem SPA-Fallback registriert sein.
|
||||||
|
@app.get("/agb")
|
||||||
|
@app.get("/datenschutz")
|
||||||
|
@app.get("/impressum")
|
||||||
|
async def legal_page_redirect(request: _Request):
|
||||||
|
from fastapi.responses import RedirectResponse
|
||||||
|
page = request.url.path.strip("/")
|
||||||
|
return RedirectResponse(f"/#{page}", status_code=302)
|
||||||
|
|
||||||
|
|
||||||
# SPA Fallback — ALLE nicht-API-Routen gehen zur index.html
|
# SPA Fallback — ALLE nicht-API-Routen gehen zur index.html
|
||||||
@app.get("/{full_path:path}")
|
@app.get("/{full_path:path}")
|
||||||
async def spa_fallback(full_path: str):
|
async def spa_fallback(full_path: str):
|
||||||
|
|
|
||||||
|
|
@ -86,14 +86,14 @@
|
||||||
<title>Ban Yaro</title>
|
<title>Ban Yaro</title>
|
||||||
|
|
||||||
<!-- Theme + theme-color Statusleiste vor CSS setzen -->
|
<!-- Theme + theme-color Statusleiste vor CSS setzen -->
|
||||||
<script src="/js/boot-early.js?v=1220"></script>
|
<script src="/js/boot-early.js?v=1222"></script>
|
||||||
|
|
||||||
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
|
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
|
||||||
<link rel="stylesheet" href="/css/design-system.css?v=1220">
|
<link rel="stylesheet" href="/css/design-system.css?v=1222">
|
||||||
<link rel="stylesheet" href="/css/layout.css?v=1220">
|
<link rel="stylesheet" href="/css/layout.css?v=1222">
|
||||||
<link rel="stylesheet" href="/css/components.css?v=1220">
|
<link rel="stylesheet" href="/css/components.css?v=1222">
|
||||||
<link rel="stylesheet" href="/css/utilities.css?v=1220">
|
<link rel="stylesheet" href="/css/utilities.css?v=1222">
|
||||||
<link rel="stylesheet" href="/css/lists.css?v=1220">
|
<link rel="stylesheet" href="/css/lists.css?v=1222">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
|
@ -617,11 +617,11 @@
|
||||||
<div id="modal-container"></div>
|
<div id="modal-container"></div>
|
||||||
|
|
||||||
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
|
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
|
||||||
<script src="/js/api.js?v=1220"></script>
|
<script src="/js/api.js?v=1222"></script>
|
||||||
<script src="/js/ui.js?v=1220"></script>
|
<script src="/js/ui.js?v=1222"></script>
|
||||||
<script src="/js/app.js?v=1220"></script>
|
<script src="/js/app.js?v=1222"></script>
|
||||||
<script src="/js/worlds.js?v=1220"></script>
|
<script src="/js/worlds.js?v=1222"></script>
|
||||||
<script src="/js/offline-indicator.js?v=1220"></script>
|
<script src="/js/offline-indicator.js?v=1222"></script>
|
||||||
|
|
||||||
<!-- Feature-Seiten werden lazy geladen -->
|
<!-- Feature-Seiten werden lazy geladen -->
|
||||||
|
|
||||||
|
|
@ -631,7 +631,7 @@
|
||||||
|
|
||||||
|
|
||||||
<!-- Boot: Offline-Banner + SW-Registration (extrahiert für CSP) -->
|
<!-- Boot: Offline-Banner + SW-Registration (extrahiert für CSP) -->
|
||||||
<script src="/js/boot.js?v=1220"></script>
|
<script src="/js/boot.js?v=1222"></script>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
Router, State-Management, Navigation, Initialisierung.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const APP_VER = '1220'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
const APP_VER = '1222'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||||
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
|
||||||
window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator)
|
window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator)
|
||||||
window.APP_VERSION = APP_VERSION;
|
window.APP_VERSION = APP_VERSION;
|
||||||
|
|
@ -1123,7 +1123,12 @@ const App = (() => {
|
||||||
const _rawHash = location.hash.replace('#', '');
|
const _rawHash = location.hash.replace('#', '');
|
||||||
const _hashQuery = _rawHash.split('?')[1] || '';
|
const _hashQuery = _rawHash.split('?')[1] || '';
|
||||||
const _hashP = new URLSearchParams(_hashQuery);
|
const _hashP = new URLSearchParams(_hashQuery);
|
||||||
if (_hashP.get('verified') || _hashP.get('token') || location.pathname.startsWith('/teilen/')) {
|
// Rechtsseiten direkt verlinkt (iOS-App, App-Store-Metadaten, E-Mails,
|
||||||
|
// /impressum-Redirects) → ebenfalls in App bleiben statt /info
|
||||||
|
const _hashPage = _rawHash.split('?')[0];
|
||||||
|
const _legalPages = ['impressum', 'datenschutz', 'agb'];
|
||||||
|
if (_hashP.get('verified') || _hashP.get('token') || location.pathname.startsWith('/teilen/')
|
||||||
|
|| _legalPages.includes(_hashPage)) {
|
||||||
sessionStorage.setItem('by_stay_in_app', '1');
|
sessionStorage.setItem('by_stay_in_app', '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1198,7 +1203,11 @@ const App = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const startPage = (hashPage && pages[hashPage]) ? hashPage : 'welcome';
|
const startPage = (hashPage && pages[hashPage]) ? hashPage : 'welcome';
|
||||||
navigate(state.user ? startPage : 'welcome', false, hashParams);
|
// Hash-Route auch ohne Login ansteuern — öffentliche Seiten (AGB,
|
||||||
|
// Datenschutz, Impressum, …) müssen für anonyme Besucher erreichbar sein.
|
||||||
|
// Auth-pflichtige Seiten leitet navigate() über den requiresAuth-Guard
|
||||||
|
// selbst auf 'welcome' um.
|
||||||
|
navigate(startPage, false, hashParams);
|
||||||
if (window.Worlds && state.user) window.Worlds.init(state);
|
if (window.Worlds && state.user) window.Worlds.init(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,10 @@
|
||||||
// MapLibre-GL-Karte (zentrale Karte) aus ?mapgl=1/0 — wird in pages/map.js _useGL() ausgewertet.
|
// MapLibre-GL-Karte (zentrale Karte) aus ?mapgl=1/0 — wird in pages/map.js _useGL() ausgewertet.
|
||||||
var mg = new URLSearchParams(location.search).get('mapgl');
|
var mg = new URLSearchParams(location.search).get('mapgl');
|
||||||
if (mg !== null) localStorage.setItem('by_map_gl', mg === '0' ? '0' : '1');
|
if (mg !== null) localStorage.setItem('by_map_gl', mg === '0' ? '0' : '1');
|
||||||
|
// Offline-Vektorkacheln (byt://) aus ?tilesoffline=1/0 — wird in map-gl-style.js
|
||||||
|
// _offlineEnabled() ausgewertet (Staging-Default AN, localStorage übersteuert).
|
||||||
|
var to = new URLSearchParams(location.search).get('tilesoffline');
|
||||||
|
if (to !== null) localStorage.setItem('by_offline_tiles', to === '0' ? '0' : '1');
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,16 @@
|
||||||
var TILES_VER = '20260605';
|
var TILES_VER = '20260605';
|
||||||
function tilesUrl() { return window.location.origin + '/tiles/' + TILES_FILE + '?v=' + TILES_VER; }
|
function tilesUrl() { return window.location.origin + '/tiles/' + TILES_FILE + '?v=' + TILES_VER; }
|
||||||
|
|
||||||
// Offline-Tiles-Modus (byt://-Quelle). Opt-in via localStorage by_offline_tiles='1' bzw. ?tilesoffline=1.
|
// Offline-Tiles-Modus (byt://-Quelle). localStorage by_offline_tiles bzw. ?tilesoffline=1/0 übersteuert.
|
||||||
// Default AUS, bis auf Gerät verifiziert — dann hier auf Staging-Default umstellen (analog by_map_gl).
|
// Staging-Default AN seit 2026-06-06 (Gerätetest); Production bleibt AUS bis Freigabe (dann analog by_map_gl).
|
||||||
|
// ACHTUNG: Default-Logik synchron halten mit offline-indicator.js _offlineTilesMode().
|
||||||
function _offlineEnabled() {
|
function _offlineEnabled() {
|
||||||
try { return localStorage.getItem('by_offline_tiles') === '1'; } catch (e) { return false; }
|
try {
|
||||||
|
var 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; }
|
||||||
}
|
}
|
||||||
|
|
||||||
var THEMES = {
|
var THEMES = {
|
||||||
|
|
@ -52,7 +58,11 @@
|
||||||
: { type: 'vector', url: 'pmtiles://' + tilesUrl() };
|
: { type: 'vector', url: 'pmtiles://' + tilesUrl() };
|
||||||
return {
|
return {
|
||||||
version: 8,
|
version: 8,
|
||||||
glyphs: window.location.origin + '/fonts/{fontstack}/{range}.pbf',
|
// Offline-Modus: Glyphs übers byt://f/-Protokoll (IndexedDB-first, remote-Fallback) —
|
||||||
|
// der SW-Cache für /fonts wird bei App-Updates gepurged, IndexedDB nicht.
|
||||||
|
glyphs: useOffline
|
||||||
|
? 'byt://f/{fontstack}/{range}'
|
||||||
|
: window.location.origin + '/fonts/{fontstack}/{range}.pbf',
|
||||||
sources: {
|
sources: {
|
||||||
by: src,
|
by: src,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -52,17 +52,22 @@ window.MapOffline = (function () {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// MapLibre-Protokoll `byt://t/{z}/{x}/{y}` registrieren (idempotent).
|
// MapLibre-Protokolle registrieren (idempotent):
|
||||||
|
// byt://t/{z}/{x}/{y} → Vektorkachel (MVT)
|
||||||
|
// byt://f/{fontstack}/{range} → Glyph-PBF (fontstack ggf. URL-encodiert, je nach MapLibre-Version)
|
||||||
function registerProtocol() {
|
function registerProtocol() {
|
||||||
if (registerProtocol._done || typeof maplibregl === 'undefined') return;
|
if (registerProtocol._done || typeof maplibregl === 'undefined') return;
|
||||||
registerProtocol._done = true;
|
registerProtocol._done = true;
|
||||||
maplibregl.addProtocol('byt', function (params) {
|
maplibregl.addProtocol('byt', function (params) {
|
||||||
var m = /byt:\/\/t\/(\d+)\/(\d+)\/(\d+)/.exec(params.url);
|
var ret = function (u) {
|
||||||
if (!m) return Promise.resolve({ data: new ArrayBuffer(0) });
|
|
||||||
return tile(+m[1], +m[2], +m[3]).then(function (u) {
|
|
||||||
if (!u) return { data: new ArrayBuffer(0) };
|
if (!u) return { data: new ArrayBuffer(0) };
|
||||||
return { data: u.buffer.slice(u.byteOffset, u.byteOffset + u.byteLength) };
|
return { data: u.buffer.slice(u.byteOffset, u.byteOffset + u.byteLength) };
|
||||||
});
|
};
|
||||||
|
var t = /byt:\/\/t\/(\d+)\/(\d+)\/(\d+)/.exec(params.url);
|
||||||
|
if (t) return tile(+t[1], +t[2], +t[3]).then(ret);
|
||||||
|
var f = /byt:\/\/f\/([^/]+)\/(\d+-\d+)/.exec(params.url);
|
||||||
|
if (f) return glyph(decodeURIComponent(f[1]), f[2]).then(ret);
|
||||||
|
return Promise.resolve({ data: new ArrayBuffer(0) });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,21 +87,39 @@ window.MapOffline = (function () {
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Glyphs (Open Sans Regular/Semibold, Latin + Latin-Extended) holen, damit der Service-Worker sie cacht.
|
// Glyphs (Open Sans Regular/Semibold, Latin + Latin-Extended) in IndexedDB persistieren
|
||||||
|
// (Key-Präfix 'f/' im Tiles-Store, kein Schema-Bump) — überlebt App-Updates, anders als der
|
||||||
|
// SW-Cache, der beim Update gepurged wird. Offline serviert übers byt://f/-Protokoll.
|
||||||
// KRITISCH: ohne Glyphs lässt MapLibre offline die GANZE Kachel fallen (nicht nur die Labels) → leer.
|
// KRITISCH: ohne Glyphs lässt MapLibre offline die GANZE Kachel fallen (nicht nur die Labels) → leer.
|
||||||
// 0-255 + 256-511 deckt DE/FR/PL/CZ/IT-Sonderzeichen ab. (Persistenz über App-Updates = Follow-up.)
|
// 0-255 + 256-511 deckt DE/FR/PL/CZ/IT-Sonderzeichen ab.
|
||||||
var FONTS = ['Open Sans Regular', 'Open Sans Semibold'], RANGES = ['0-255', '256-511'];
|
var FONTS = ['Open Sans Regular', 'Open Sans Semibold'], RANGES = ['0-255', '256-511'];
|
||||||
|
function _glyphUrl(font, range) { return '/fonts/' + encodeURIComponent(font) + '/' + range + '.pbf'; }
|
||||||
function _cacheGlyphs() {
|
function _cacheGlyphs() {
|
||||||
var bytes = 0, jobs = [];
|
var bytes = 0, jobs = [];
|
||||||
FONTS.forEach(function (f) { RANGES.forEach(function (rg) {
|
FONTS.forEach(function (f) { RANGES.forEach(function (rg) {
|
||||||
jobs.push(fetch('/fonts/' + encodeURIComponent(f) + '/' + rg + '.pbf')
|
jobs.push(fetch(_glyphUrl(f, rg))
|
||||||
.then(function (r) { return r.ok ? r.arrayBuffer() : null; })
|
.then(function (r) { return r.ok ? r.arrayBuffer() : null; })
|
||||||
.then(function (b) { if (b) bytes += b.byteLength; })
|
.then(function (b) {
|
||||||
|
if (!b) return;
|
||||||
|
bytes += b.byteLength;
|
||||||
|
return _put('f/' + f + '/' + rg, new Uint8Array(b));
|
||||||
|
})
|
||||||
.catch(function () {}));
|
.catch(function () {}));
|
||||||
}); });
|
}); });
|
||||||
return Promise.all(jobs).then(function () { return bytes; });
|
return Promise.all(jobs).then(function () { return bytes; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Glyph-Bytes für fontstack/range — IndexedDB zuerst, sonst remote (online), sonst null.
|
||||||
|
function glyph(font, range) {
|
||||||
|
return _get('f/' + font + '/' + range).then(function (hit) {
|
||||||
|
if (hit) return hit instanceof Uint8Array ? hit : new Uint8Array(hit);
|
||||||
|
return fetch(_glyphUrl(font, range))
|
||||||
|
.then(function (r) { return r.ok ? r.arrayBuffer() : null; })
|
||||||
|
.then(function (b) { return b ? new Uint8Array(b) : null; })
|
||||||
|
.catch(function () { return null; });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Bereich um lat/lon (radiusKm, Default 5) herunterladen + in IndexedDB ablegen.
|
// Bereich um lat/lon (radiusKm, Default 5) herunterladen + in IndexedDB ablegen.
|
||||||
// onProgress({done,total,bytes}). Liefert {tiles,bytes}.
|
// onProgress({done,total,bytes}). Liefert {tiles,bytes}.
|
||||||
function downloadAround(lat, lon, radiusKm, onProgress) {
|
function downloadAround(lat, lon, radiusKm, onProgress) {
|
||||||
|
|
@ -135,7 +158,7 @@ window.MapOffline = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
registerProtocol: registerProtocol, downloadAround: downloadAround, tile: tile,
|
registerProtocol: registerProtocol, downloadAround: downloadAround, tile: tile, glyph: glyph,
|
||||||
stats: stats, hasRegion: hasRegion, clear: clear, MAXZOOM: MAXZOOM,
|
stats: stats, hasRegion: hasRegion, clear: clear, MAXZOOM: MAXZOOM,
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,15 @@ window.OfflineIndicator = (() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GL-Offline-Tiles-Modus (byt://-Vektorkacheln in IndexedDB) statt OSM-Raster.
|
// 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() {
|
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)
|
// 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()
|
// WICHTIG: dasselbe Schema/Version wie map-offline.js anlegen — sonst legt ein versionsloses open()
|
||||||
|
|
@ -373,7 +380,9 @@ window.OfflineIndicator = (() => {
|
||||||
function init() {
|
function init() {
|
||||||
refresh();
|
refresh();
|
||||||
_prefetchPages();
|
_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();
|
_prefetchData();
|
||||||
_bindLongPress();
|
_bindLongPress();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,11 @@ window.Page_map = (() => {
|
||||||
<span class="map-sd-label">Marker setzen</span>
|
<span class="map-sd-label">Marker setzen</span>
|
||||||
<button class="map-sd-btn map-fab--pin" id="map-pin-btn" title="Marker setzen"><svg class="ph-icon" aria-hidden="true"><use href="/icons/phosphor.svg#push-pin"></use></svg></button>
|
<button class="map-sd-btn map-fab--pin" id="map-pin-btn" title="Marker setzen"><svg class="ph-icon" aria-hidden="true"><use href="/icons/phosphor.svg#push-pin"></use></svg></button>
|
||||||
</div>
|
</div>
|
||||||
|
${(!_useGL() || _offlineTilesEnabled()) ? `
|
||||||
|
<div class="map-sd-item">
|
||||||
|
<span class="map-sd-label">Karte offline speichern</span>
|
||||||
|
<button class="map-sd-btn" id="map-offline-btn" title="Karte offline speichern"><svg class="ph-icon" aria-hidden="true"><use href="/icons/phosphor.svg#cloud-arrow-down"></use></svg></button>
|
||||||
|
</div>` : ''}
|
||||||
${App.hasPro(_appState?.user) ? `
|
${App.hasPro(_appState?.user) ? `
|
||||||
<div class="map-sd-item">
|
<div class="map-sd-item">
|
||||||
<span class="map-sd-label">Regenradar</span>
|
<span class="map-sd-label">Regenradar</span>
|
||||||
|
|
@ -368,6 +373,11 @@ window.Page_map = (() => {
|
||||||
_sdEl?.classList.remove('open');
|
_sdEl?.classList.remove('open');
|
||||||
_togglePlacementMode();
|
_togglePlacementMode();
|
||||||
});
|
});
|
||||||
|
document.getElementById('map-offline-btn')?.addEventListener('click', () => {
|
||||||
|
_sdEl?.classList.remove('open');
|
||||||
|
if (_engineGL) _downloadVectorRegion(); // GL: Vektorkacheln → IndexedDB (byt://)
|
||||||
|
else _cacheTiles(); // Leaflet: OSM-Raster → SW-Cache
|
||||||
|
});
|
||||||
document.getElementById('map-radar-btn')?.addEventListener('click', () => {
|
document.getElementById('map-radar-btn')?.addEventListener('click', () => {
|
||||||
_sdEl?.classList.remove('open');
|
_sdEl?.classList.remove('open');
|
||||||
_toggleRadar();
|
_toggleRadar();
|
||||||
|
|
@ -763,6 +773,18 @@ window.Page_map = (() => {
|
||||||
} catch (e) { return false; }
|
} catch (e) { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Offline-Vektorkacheln-Flag — gleiche Default-Logik wie map-gl-style.js _offlineEnabled()
|
||||||
|
// (dupliziert, weil map-gl-style.js erst mit der GL-Karte lazy lädt, das Markup aber sofort rendert).
|
||||||
|
// Steuert nur die Button-Sichtbarkeit: im GL-Modus ohne byt://-Quelle wäre der Download nutzlos.
|
||||||
|
function _offlineTilesEnabled() {
|
||||||
|
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; }
|
||||||
|
}
|
||||||
|
|
||||||
function loadMapLibre() {
|
function loadMapLibre() {
|
||||||
if (_maplibreLoaded) return Promise.resolve();
|
if (_maplibreLoaded) return Promise.resolve();
|
||||||
const v = '?v=' + (window.APP_VER || '');
|
const v = '?v=' + (window.APP_VER || '');
|
||||||
|
|
@ -2115,6 +2137,31 @@ window.Page_map = (() => {
|
||||||
return urls;
|
return urls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GL-Modus: Vektorkacheln (5 km um die Kartenmitte) + Glyphs → IndexedDB (byt://).
|
||||||
|
// Gegenstück zum Welten-FAB-Download (GPS-Position) — hier zählt die KARTENMITTE,
|
||||||
|
// damit man eine entfernte Gegend (Urlaubsort) vorab speichern kann. docs/OFFLINE_MAPS_PLAN.md
|
||||||
|
async function _downloadVectorRegion() {
|
||||||
|
if (!_map || !window.MapOffline) return;
|
||||||
|
const btn = document.getElementById('map-offline-btn');
|
||||||
|
if (btn?.classList.contains('loading')) return; // läuft bereits
|
||||||
|
const c = _map.getCenter();
|
||||||
|
btn?.classList.add('loading');
|
||||||
|
_setOsmStatus('Offline: 0 %…');
|
||||||
|
try {
|
||||||
|
const res = await MapOffline.downloadAround(c.lat, c.lng, 5, p => {
|
||||||
|
_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.`);
|
||||||
|
window.OfflineIndicator?.refresh(); // Pfoten-Segment 5 sofort grün
|
||||||
|
} catch (e) {
|
||||||
|
_setOsmStatus('');
|
||||||
|
UI.toast.error('Offline-Download fehlgeschlagen — bitte erneut versuchen.');
|
||||||
|
} finally {
|
||||||
|
btn?.classList.remove('loading');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function _cacheTiles() {
|
async function _cacheTiles() {
|
||||||
if (!_map) return;
|
if (!_map) return;
|
||||||
if (!('serviceWorker' in navigator) || !navigator.serviceWorker.controller) {
|
if (!('serviceWorker' in navigator) || !navigator.serviceWorker.controller) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="color-scheme" content="light dark">
|
<meta name="color-scheme" content="light dark">
|
||||||
<script src="/js/landing-init.js?v=1220"></script>
|
<script src="/js/landing-init.js?v=1222"></script>
|
||||||
<title>Ban Yaro — Die Hunde-App für Deutschland, Österreich & Schweiz</title>
|
<title>Ban Yaro — Die Hunde-App für Deutschland, Österreich & Schweiz</title>
|
||||||
<meta name="description" content="Ban Yaro: Die kostenlose All-in-One Hunde-App für DACH. Tagebuch, Giftköder-Alarm, Training mit KI, Forum, Wurfbörse, Stammbaum, Inzucht-Check — DSGVO-konform, offline-fähig, ohne App Store.">
|
<meta name="description" content="Ban Yaro: Die kostenlose All-in-One Hunde-App für DACH. Tagebuch, Giftköder-Alarm, Training mit KI, Forum, Wurfbörse, Stammbaum, Inzucht-Check — DSGVO-konform, offline-fähig, ohne App Store.">
|
||||||
<meta name="keywords" content="Hunde App, Hunde Community, Wurfbörse, Züchter, Welpen kaufen, Stammbaum Hund, Inzuchtkoeffizient, Hundezucht, Impfpass Hund, Giftköder Alarm, Gassi Community, Hundetraining App, Hunde Forum, Hunde KI, Hundefilm Datenbank, Welpen Marktplatz">
|
<meta name="keywords" content="Hunde App, Hunde Community, Wurfbörse, Züchter, Welpen kaufen, Stammbaum Hund, Inzuchtkoeffizient, Hundezucht, Impfpass Hund, Giftköder Alarm, Gassi Community, Hundetraining App, Hunde Forum, Hunde KI, Hundefilm Datenbank, Welpen Marktplatz">
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
// ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab
|
// ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab
|
||||||
const VER = '1220';
|
const VER = '1222';
|
||||||
const CACHE_VERSION = `by-v${VER}`;
|
const CACHE_VERSION = `by-v${VER}`;
|
||||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||||
|
|
|
||||||
|
|
@ -12,5 +12,8 @@ services:
|
||||||
- ./data:/data # gleiche DB wie die App (/data/banyaro.db)
|
- ./data:/data # gleiche DB wie die App (/data/banyaro.db)
|
||||||
environment:
|
environment:
|
||||||
- DB_PATH=/data/banyaro.db
|
- DB_PATH=/data/banyaro.db
|
||||||
# - COUNTRIES=switzerland austria germany # bei Bedarf überschreiben
|
# Abdeckung = TILES_REGIONS im Makefile — Karten- und POI-Abdeckung
|
||||||
|
# synchron halten! Env überschreibt den Default in refresh.sh, daher
|
||||||
|
# wirkt eine Änderung hier OHNE Image-Rebuild.
|
||||||
|
- COUNTRIES=germany austria switzerland france italy czech-republic poland slovakia hungary slovenia netherlands belgium luxembourg denmark liechtenstein
|
||||||
restart: "no"
|
restart: "no"
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,9 @@ set -euo pipefail
|
||||||
|
|
||||||
DB="${DB_PATH:-/data/banyaro.db}"
|
DB="${DB_PATH:-/data/banyaro.db}"
|
||||||
WORK="${WORK_DIR:-/work}"
|
WORK="${WORK_DIR:-/work}"
|
||||||
COUNTRIES="${COUNTRIES:-switzerland austria germany}"
|
# Default = TILES_REGIONS im Makefile (Karten- und POI-Abdeckung synchron halten).
|
||||||
|
# Produktiv setzt docker-compose.osm.yml die Liste zusätzlich per Env.
|
||||||
|
COUNTRIES="${COUNTRIES:-germany austria switzerland france italy czech-republic poland slovakia hungary slovenia netherlands belgium luxembourg denmark liechtenstein}"
|
||||||
GEOFABRIK="${GEOFABRIK_BASE:-https://download.geofabrik.de/europe}"
|
GEOFABRIK="${GEOFABRIK_BASE:-https://download.geofabrik.de/europe}"
|
||||||
KEEP_BACKUPS="${KEEP_BACKUPS:-3}"
|
KEEP_BACKUPS="${KEEP_BACKUPS:-3}"
|
||||||
PREBUILT_SQLITE="${PREBUILT_SQLITE:-}"
|
PREBUILT_SQLITE="${PREBUILT_SQLITE:-}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue