feat(windkarte): InfoAccordion, anlagen-Hinweis, Tooltip ohne Icons
- Disclaimer aus CMS-Feld (hinweis_text) via InfoAccordion statt Hardcode - info_text-Feld für Block-Fließtext ergänzt - anlagen_geplant_hinweis-Feld in WindArea + Panel-Anzeige - Tooltip-Icons entfernt (square-outline/wind-turbine/map-marker inline SVGs) - Panel: square-outline → ruler-square für Fläche - Iconify-Subset neu generiert Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -283,20 +283,30 @@
|
||||
await selectFeature(L, feature, layer, area);
|
||||
});
|
||||
|
||||
// Hover tooltip
|
||||
// Hover tooltip — labels rendered bold via <strong>, an info glyph
|
||||
// gets appended after the count when the editor supplied a hint
|
||||
// string so users know there's more context in the side panel.
|
||||
const nrLabel = area.gebiets_nr ?? p.name ?? "";
|
||||
const title = area.bezeichnung
|
||||
? `${nrLabel} – ${area.bezeichnung}`
|
||||
: nrLabel;
|
||||
const lines: string[] = [];
|
||||
if (area.flaeche_ha != null) lines.push(`${t(T.windkarte_label_flaeche)}: ${area.flaeche_ha.toFixed(1)} ha`);
|
||||
if (area.gemeinden && area.gemeinden.length > 0) {
|
||||
lines.push(`${t(T.windkarte_label_gemeinden)}: ${area.gemeinden.join(', ')}`);
|
||||
}
|
||||
const esc = (s: string) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||
const row = (label: string, value: string, suffix = "") =>
|
||||
`<strong>${esc(label)}:</strong> ${esc(value)}${suffix}`;
|
||||
const lines: string[] = [];
|
||||
if (area.flaeche_ha != null) {
|
||||
lines.push(row(t(T.windkarte_label_flaeche), `${area.flaeche_ha.toFixed(1)} ha`));
|
||||
}
|
||||
if (area.anlagen_geplant != null) {
|
||||
const hint = area.anlagen_geplant_hinweis ? " *" : "";
|
||||
lines.push(row(t(T.windkarte_label_anlagen_geplant), `${area.anlagen_geplant}`, hint));
|
||||
}
|
||||
if (area.gemeinden && area.gemeinden.length > 0) {
|
||||
lines.push(row(t(T.windkarte_label_gemeinden), area.gemeinden.join(', ')));
|
||||
}
|
||||
const tooltipHtml =
|
||||
`<div class="font-semibold">${esc(title)}</div>` +
|
||||
(lines.length ? `<div class="mt-0.5 text-xs opacity-90">${lines.map(esc).join('<br/>')}</div>` : '');
|
||||
`<div class="text-sm font-bold pb-1 mb-1 border-b border-stein-200/60">${esc(title)}</div>` +
|
||||
(lines.length ? `<div class="text-xs opacity-90 leading-relaxed">${lines.join('<br/>')}</div>` : '');
|
||||
layer.bindTooltip(tooltipHtml, { sticky: true, className: "windkarte-tooltip" });
|
||||
|
||||
// Permanent label via divIcon marker at polygon center
|
||||
|
||||
Reference in New Issue
Block a user