Add Map in Posts

This commit is contained in:
2022-10-07 18:31:03 +02:00
parent 6dfa8dad9b
commit c9ee674b2d
14 changed files with 1859 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
{{ $Lat := $.Param "Latitude" }}
{{ $Lon := $.Param "Longitude" }}
<div class="post container">
<div class="post-header-section">
@@ -18,6 +21,12 @@
<p>
{{ .Content }}
</p>
{{ if (and (isset .Params "longitude") (isset .Params "latitude")) }}
{{ partial "leaflet-loader" . }}
<h3>Map</h3>
{{ partial "leaflet-map" (dict "context" . "mapHeight" "200px" "mapLat" $Lat "mapLon" $Lon) }}
{{ partial "leaflet-marker" (dict "context" . "markerLat" $Lat "markerLon" $Lon) }}
{{ end }}
</div>
</div>