various fixes

This commit is contained in:
Ben Goldsworthy 2024-07-23 10:08:36 +02:00
parent 1fd9adcb52
commit 46bd223627
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE
29 changed files with 6093 additions and 152 deletions

View file

@ -5,26 +5,45 @@
{{ define "main-class" }}--section location-map{{ end }}
{{ define "header-scripts" }}
<link rel="stylesheet" href="/css/leaflet.css"/>
<!-- Leaflet -->
<link rel="stylesheet" href="/css/leaflet/leaflet.css" />
<link rel="stylesheet" href="/js/leaflet-fullscreen/leaflet.fullscreen.css" />
{{ end }}
{{ define "footer-scripts" }}
<script src="/js/leaflet.js"></script>
<script src="/js/leaflet-heat.js"></script>
<!-- Leaflet -->
<script src="/js/leaflet/leaflet.js"></script>
<!-- Leaflet Heat -->
<script src="/js/leaflet-heat/leaflet-heat.js"></script>
<!-- Leaflet Fullscreen -->
<script src="/js/leaflet-fullscreen/leaflet.fullscreen.min.js"></script>
<script>
var map = L.map('map').setView([55, -3], 3);
var map = L.map('map', {
fullscreenControl: true
}).setView([55, -3], 3);
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo(map);
{{- range $.Site.Data.locations -}}
/* L.marker([{{ .lat }}, {{ .lon }}]).addTo(map); */
{{- end -}}
{{- $locations := partialCached "util/get_location_leaf_nodes.html.tmpl" $.Site.Data.locations -}}
{{/*
{{- range .Site.AllPages -}}
{{- with .Params.locations -}}
{{- range . -}}
{{- with ( index $locations ( replaceRE `, [A-Z]+` "" . ) ) -}}
L.marker([{{ .lat }}, {{ .lon }}]).addTo(map);
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
*/}}
L.heatLayer(
[
{{- range .Site.AllPages -}}
@ -39,7 +58,7 @@
],
{
minOpacity: 0.5,
gradient: {0.2: 'blue', 0.5: 'lime', 1: 'red'}
gradient: {0.1: 'blue', 0.3: 'lime', 0.8: 'orange', 1: 'red'}
}
).addTo(map);
</script>