- static/geo/deutschland-bundeslaender.geojson (BKG, vereinfacht, ~40KB) - map.js: Tile-Layer entfernt, Bundeslaender-GeoJSON per same-origin fetch als Vektor-Hintergrund; Detail-Minikarte als Deutschland-Locator - hugo.toml: OSM tileURL entfernt, Attribution nur noch als Text - CSS: neutraler Kartenhintergrund statt Tile-Grau - Ergebnis: 0 externe Requests (per Playwright-Netzwerk-Audit verifiziert)
47 lines
1.8 KiB
HTML
47 lines
1.8 KiB
HTML
{{/*
|
|
Karten-Partial. Aufruf mit dict:
|
|
(dict "pages" <slice von Schauplatz-Seiten> "klein" false)
|
|
Baut den Leaflet-Container und bettet die Marker-Daten als JSON ein
|
|
(kein externer Request → CORS-frei, statisch). Der Filter kommt aus explorer.html.
|
|
*/}}
|
|
{{ $pages := .pages }}
|
|
{{ $klein := .klein }}
|
|
{{ $default := .markerColor | default site.Params.kategorieFarbeDefault | default "#1e2758" }}
|
|
|
|
{{/* Farb-Map (Kategorie → Hex) für map.js aus data/kategorien.yaml */}}
|
|
{{ $colorMap := dict }}
|
|
{{ range $k, $v := site.Data.kategorien }}{{ $colorMap = merge $colorMap (dict $k $v.color) }}{{ end }}
|
|
|
|
{{/* Marker-Daten aufbauen */}}
|
|
{{ $places := slice }}
|
|
{{ range $pages }}
|
|
{{ $img := "" }}
|
|
{{ with .Resources.GetMatch "{cover,*featured*,image}.*" }}{{ $img = .RelPermalink }}
|
|
{{ else }}{{ with .Params.image }}{{ $img = . | relURL }}{{ end }}{{ end }}
|
|
{{ if and .Params.lat .Params.lng }}
|
|
{{ $places = $places | append (dict
|
|
"title" .Title
|
|
"subtitle" (.Params.subtitle | default "")
|
|
"url" .RelPermalink
|
|
"lat" .Params.lat
|
|
"lng" .Params.lng
|
|
"categories" (.Params.kategorien | default slice)
|
|
"img" $img
|
|
) }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ $payload := dict
|
|
"places" $places
|
|
"colors" $colorMap
|
|
"defaultColor" $default
|
|
"klein" ($klein | default false)
|
|
"geojsonUrl" ("geo/deutschland-bundeslaender.geojson" | relURL)
|
|
"attribution" (site.Params.map.attribution | default "Geodaten: © GeoBasis-DE / BKG (Bundesländergrenzen)")
|
|
}}
|
|
|
|
<div id="op-map" class="op-map{{ if $klein }} op-map--klein{{ end }}"
|
|
role="application" aria-label="{{ i18n "mapAria" }}"></div>
|
|
|
|
<script type="application/json" id="op-map-data">{{ $payload | jsonify | safeJS }}</script>
|