Add Map in Posts
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user