leuchttuerme-ostsee/themes/leuchttuerm/layouts/index.html
2022-10-14 16:05:03 +02:00

49 lines
No EOL
2.1 KiB
HTML

{{ define "main" }}
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.2/dist/leaflet.css" integrity="sha256-sA+zWATbFveLLNqWO2gtiw3HL/lh1giY/Inf1BJ0z14=" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.9.2/dist/leaflet.js" 3integrity="sha256-o9N1jGDZrf5tS+Ft4gbIK7mYMipq9lqpVJ91xHSyKhg=" crossorigin=""></script>
<style type="text/css">
#map { height: calc(100pc - 96px); }
</style>
<div id="map"></div>
<script language="javascript">
var map = L.map('map').setView([53.73, 11.7], 8.5);
L.tileLayer('https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg', {
maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
var leuchtTurm = L.icon({
iconUrl: 'leuchtturm.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [50, 50], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [20, 40], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [-0, -25] // point from which the popup should open relative to the iconAnchor
});
var leuchtTurmBund = L.icon({
iconUrl: 'leuchturm-bunt.png',
//shadowUrl: 'leaf-shadow.png',
iconSize: [50, 50], // size of the icon
//shadowSize: [50, 64], // size of the shadow
iconAnchor: [20, 40], // point of the icon which will correspond to marker's location
//shadowAnchor: [4, 62], // the same for the shadow
popupAnchor: [-0, -45] // point from which the popup should open relative to the iconAnchor
});
{{ $pages := where (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) ".Params.leuchtturm" "==" true }}
{{ range $pages }}
{{- if (isset .Params "visited") -}}
L.marker([{{ .Params.lat }}, {{ .Params.lon }}], {icon: leuchtTurmBund}).addTo(map)
{{- else -}}
L.marker([{{ .Params.lat }}, {{ .Params.lon }}], {icon: leuchtTurm}).addTo(map)
{{- end -}}
.bindPopup('<img src="https://www.kekskurse.de//img/2022/02/leuchtturm-ueckermuende/DSC09212.jpg" style="width:100%;"> <br>{{ .Title }}');
{{- end -}}
</script>
{{ end }}