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:
parent
da6451a1c7
commit
c7201aa07b
11 changed files with 36 additions and 36 deletions
|
|
@ -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 };
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue