diff --git a/VERSION b/VERSION index dfb227d..8d1830f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1196 \ No newline at end of file +1197 \ No newline at end of file diff --git a/backend/static/index.html b/backend/static/index.html index dfcb4ab..3c942f4 100644 --- a/backend/static/index.html +++ b/backend/static/index.html @@ -86,14 +86,14 @@ Ban Yaro - + - - - - - + + + + + @@ -617,11 +617,11 @@ - - - - - + + + + + @@ -631,7 +631,7 @@ - + diff --git a/backend/static/js/app.js b/backend/static/js/app.js index 23813da..fa74a5b 100644 --- a/backend/static/js/app.js +++ b/backend/static/js/app.js @@ -3,7 +3,7 @@ Router, State-Management, Navigation, Initialisierung. ============================================================ */ -const APP_VER = '1196'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen +const APP_VER = '1197'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen 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_VERSION = APP_VERSION; diff --git a/backend/static/js/map-gl-mini.js b/backend/static/js/map-gl-mini.js index b7d189a..92d07d6 100644 --- a/backend/static/js/map-gl-mini.js +++ b/backend/static/js/map-gl-mini.js @@ -25,10 +25,13 @@ panTo: function (latlon) { map.panTo(_ll(latlon)); return this; }, fitBounds: function (b, opts) { var bb = _toBounds(b); - if (bb) { - var pad = 40; + // Nur fitten wenn Bounds gültig UND der Container eine Größe hat (im Modal + // ist er beim Erstellen 0×0 → fitBounds würde NaN werfen; der Re-Fit nach + // Modal-Animation greift dann). + if (bb && !isNaN(bb.getWest()) && map.getContainer().clientWidth > 0) { + var pad = 30; if (opts && opts.padding) pad = Array.isArray(opts.padding) ? opts.padding[0] : opts.padding; - map.fitBounds(bb, { padding: pad, maxZoom: opts && opts.maxZoom, duration: 0 }); + try { map.fitBounds(bb, { padding: pad, maxZoom: opts && opts.maxZoom, duration: 0 }); } catch (e) {} } return this; }, @@ -46,6 +49,8 @@ off: function (ev, fn) { map.off(ev, fn); return this; }, getZoom: function () { return map.getZoom(); }, getCenter: function () { var c = map.getCenter(); return { lat: c.lat, lng: c.lng }; }, + // Leaflet-Handler-Stub (z.B. _suggestMap.scrollWheelZoom.disable()). + scrollWheelZoom: { disable: function () { try { map.scrollZoom.disable(); } catch (e) {} }, enable: function () { try { map.scrollZoom.enable(); } catch (e) {} } }, // Distanz in Metern (Haversine) — Ersatz für Leaflets map.distance. distance: function (a, b) { var la = a.lat != null ? a.lat : a[0], lo = a.lng != null ? a.lng : a[1]; @@ -177,6 +182,10 @@ map.addControl(new maplibregl.AttributionControl({ compact: true, customAttribution: '© OpenStreetMap contributors', })); + // Container kann beim Erstellen (Modal/Animation) noch 0×0 sein → mehrfach resizen. + var _rz = function () { try { map.resize(); } catch (e) {} }; + requestAnimationFrame(_rz); + setTimeout(_rz, 120); setTimeout(_rz, 400); return _wrapMap(map); }, diff --git a/backend/static/js/pages/routes.js b/backend/static/js/pages/routes.js index f6bc4b8..4284774 100644 --- a/backend/static/js/pages/routes.js +++ b/backend/static/js/pages/routes.js @@ -617,8 +617,8 @@ window.Page_routes = (() => { UI.map.circleMarker(lls[0], { radius:7, color:'#22C55E', fillColor:'#22C55E', fillOpacity:1, weight:2 }).addTo(_suggestMap); UI.map.circleMarker(lls.at(-1), { radius:7, color:'#EF4444', fillColor:'#EF4444', fillOpacity:1, weight:2 }).addTo(_suggestMap); _addRouteArrows(_suggestMap, track, '#3b82f6'); - _suggestMap.fitBounds(poly.getBounds(), { padding: [16, 16] }); - setTimeout(() => _suggestMap?.invalidateSize(), 120); + const _sfit = () => { _suggestMap?.invalidateSize(); _suggestMap?.fitBounds(poly.getBounds(), { padding: [16, 16] }); }; + _sfit(); setTimeout(_sfit, 200); setTimeout(_sfit, 500); }; _initMap(); @@ -2653,7 +2653,11 @@ window.Page_routes = (() => { _addRouteArrows(m, track, '#3b82f6'); UI.map.circleMarker(lls[0], { radius:7, color:'#22C55E', fillColor:'#22C55E', fillOpacity:1 }).addTo(m); UI.map.circleMarker(lls.at(-1), { radius:7, color:'#EF4444', fillColor:'#EF4444', fillOpacity:1 }).addTo(m); - m.fitBounds(poly.getBounds(), { padding:[10,10] }); + // Mehrfach fitten: beim Erstellen ist der Modal-Container evtl. noch 0×0 → nach + // der Animation (resize) erneut auf die ganze Route zoomen. + const _fit = () => { m.invalidateSize(); m.fitBounds(poly.getBounds(), { padding:[16,16] }); }; + _fit(); + setTimeout(_fit, 200); setTimeout(_fit, 500); return m; } diff --git a/backend/static/landing.html b/backend/static/landing.html index c84deca..9386743 100644 --- a/backend/static/landing.html +++ b/backend/static/landing.html @@ -4,7 +4,7 @@ - + Ban Yaro — Die Hunde-App für Deutschland, Österreich & Schweiz diff --git a/backend/static/sw.js b/backend/static/sw.js index 5068e7d..1d47798 100644 --- a/backend/static/sw.js +++ b/backend/static/sw.js @@ -4,7 +4,7 @@ ============================================================ */ // ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab -const VER = '1196'; +const VER = '1197'; const CACHE_VERSION = `by-v${VER}`; const CACHE_STATIC = `${CACHE_VERSION}-static`; const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten