Karten-Attribution: standardmäßig eingeklappt (nur ⓘ) + doppelten Hinweis entfernt

Punkt 6: MapLibre rendert die Compact-Attribution offen (maplibregl-compact-show
+ open) → voller Text '© OpenStreetMap contributors' immer sichtbar. Neuer Helper
MapGLStyle.collapseAttribution() entfernt die Klasse/open nach dem Hinzufügen →
nur noch das ⓘ, der Text erscheint erst auf Klick (rechtlich nach ODbL ausreichend).
In map-gl-mini.js (Seitenkarten) + map.js (zentrale Karte) verdrahtet.

Punkt 7: poison.js + lost.js hatten UNTER der Karte zusätzlich ein hartkodiertes
'© OpenStreetMap-Mitwirkende' — doppelt zum Karten-ⓘ. Entfernt (+ ungenutzte
.lost-map-attribution CSS-Klasse). Verifiziert: osmTextLeafCount 2-3 → 1, compactShown true → false.
This commit is contained in:
rene 2026-06-05 15:48:11 +02:00
parent da6451a1c7
commit c7201aa07b
11 changed files with 36 additions and 36 deletions

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '1206'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '1207'; // ← 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;

View file

@ -244,6 +244,7 @@
map.addControl(new maplibregl.AttributionControl({
compact: true, customAttribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}));
MapGLStyle.collapseAttribution(map); // nur ⓘ, nicht ausgeschrieben
// Container kann beim Erstellen (Modal/Animation) noch 0×0 sein → mehrfach resizen.
var _rz = function () { try { map.resize(); } catch (e) {} };
requestAnimationFrame(_rz);

View file

@ -141,5 +141,20 @@
};
}
window.MapGLStyle = { build: build, tilesUrl: tilesUrl, tilesFile: TILES_FILE };
// Compact-Attribution standardmäßig EINGEKLAPPT lassen (nur das ⓘ; der volle Text
// "© OpenStreetMap contributors" erscheint erst auf Klick). MapLibre rendert sie sonst
// offen (Klasse maplibregl-compact-show + open). Rechtlich reicht das ⓘ (ODbL).
function collapseAttribution(map) {
var fn = function () {
try {
var a = map.getContainer().querySelector('.maplibregl-ctrl-attrib');
if (a) { a.classList.remove('maplibregl-compact-show'); a.removeAttribute('open'); }
} catch (e) {}
};
fn();
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(fn);
setTimeout(fn, 60);
}
window.MapGLStyle = { build: build, tilesUrl: tilesUrl, tilesFile: TILES_FILE, collapseAttribution: collapseAttribution };
})();

View file

@ -107,13 +107,9 @@ window.Page_lost = (() => {
<div id="lost-map"
style="height:280px;border-radius:var(--radius-md);overflow:hidden;
margin-bottom:var(--space-4);
background:var(--c-surface-2)">
</div>
<div style="font-size:10px;color:var(--c-text-secondary);
text-align:right;margin-bottom:var(--space-4);
padding:2px var(--space-2) 0">
© OpenStreetMap-Mitwirkende
</div>
<p id="lost-info"
style="font-size:var(--text-sm);color:var(--c-text-secondary);

View file

@ -782,6 +782,7 @@ window.Page_map = (() => {
_map.addControl(new maplibregl.AttributionControl({
compact: true, customAttribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}));
MapGLStyle.collapseAttribution(_map); // nur ⓘ, nicht ausgeschrieben
if (!_userPos) {
_frankfurtTimer = setTimeout(() => _mapFlyTo(50.1109, 8.6821, 14, { duration: 2.5 }), 1200);

View file

@ -61,13 +61,9 @@ window.Page_poison = (() => {
<div id="poison-map"
style="height:280px;border-radius:var(--radius-md);overflow:hidden;
margin-bottom:var(--space-4);
background:var(--c-surface-2)">
</div>
<div style="font-size:10px;color:var(--c-text-secondary);
text-align:right;margin-bottom:var(--space-4);
padding:2px var(--space-2) 0">
© OpenStreetMap-Mitwirkende
</div>
<div style="display:flex;gap:var(--space-2);flex-wrap:wrap;margin-bottom:var(--space-3)">
<a href="tel:110" class="btn btn-secondary" style="flex:1;text-align:center;text-decoration:none">