--- import { partners, locatedPartners } from "../lib/partners"; import { STATES, DETAIL_STATES, VIEWS, MAP_WIDTH, MAP_HEIGHT, HAMBURG, RIVERS, WATER, REGION_LABELS, project, type MapView, } from "../lib/germanyMap"; interface Props { view?: MapView; eyebrow?: string; title?: string; } const { view = "hamburg", eyebrow = "Vertrauen", title = "Unsere Partner" } = Astro.props; const [vx, vy, vw, vh] = VIEWS[view].split(" ").map(Number); // Position jedes Standorts als Prozentwert im Kartenrahmen. Der Container // bekommt exakt das aspect-ratio des viewBox, deshalb stimmen die Prozente // unabhängig von der Rendergröße. const pins = locatedPartners .map((partner) => { const { x, y } = project(partner.location.lat, partner.location.lng); return { id: partner.file.replace(/\.[a-z]+$/i, ""), partner, left: ((x - vx) / vw) * 100, top: ((y - vy) / vh) * 100, }; }) .filter((p) => p.left >= 0 && p.left <= 100 && p.top >= 0 && p.top <= 100); // Westliche Standorte hängen links, östliche rechts — dadurch kreuzen sich // die Verbindungslinien nicht. Innerhalb der Spalte nach Nord-Süd sortiert. const sorted = [...pins].sort((a, b) => a.left - b.left); const half = Math.ceil(sorted.length / 2); const leftColumn = sorted.slice(0, half).sort((a, b) => a.top - b.top); const rightColumn = sorted.slice(half).sort((a, b) => a.top - b.top); // Alle Standorte liegen in Hamburg; das Bundesland wird deshalb als // einziges hervorgehoben, die Nachbarn geben nur Kontext. const highlighted = new Set(["Hamburg"]); const withoutLocation = partners.filter((p) => !p.location); ---

{title}

{partners.length} Unternehmen und Hotels mit Bienen vor Ort

{DETAIL_STATES.map((state) => )} {DETAIL_STATES.map((state) => ( ))} {DETAIL_STATES.map((state) => ( ))} {REGION_LABELS.map((label) => ( {label.name} ))} {STATES.map((state) => ( ))} {pins.map((pin) => ( ))}
{withoutLocation.length > 0 && (

Weitere Partner ({withoutLocation.length})

    {withoutLocation.map((partner) => (
  • {`Logo
  • ))}
)}