mirror of
https://gitlab.com/mrubli/hugo-mod-leaflet.git
synced 2025-10-07 01:54:24 +00:00
layouts: map: Allow specifying width/height in the shortcode tag
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
Syntax summary:
|
||||
|
||||
{{< leaflet-map centerLat=FLOAT centerLon=FLOAT zoom=INT >}}
|
||||
{{< leaflet-map centerLat=FLOAT centerLon=FLOAT zoom=INT width="STRING" height="STRING" >}}
|
||||
|
||||
{{< leaflet-layer id="STRING" apiKey="STRING" >}}
|
||||
|
||||
@@ -22,6 +22,12 @@ Map options:
|
||||
Center point coordinates of the map as decimal values. Optional iif tracks or markers are given.
|
||||
zoom:
|
||||
Zoom level of the map. Optional iif tracks or markers are given.
|
||||
width:
|
||||
Width of the map, including CSS units (e.g. "50%", "300px").
|
||||
Optional, defaults to "600px".
|
||||
height:
|
||||
Height of the map, including CSS units (e.g. "50%", "300px").
|
||||
Optional, defaults to "400px".
|
||||
|
||||
Layer options:
|
||||
|
||||
@@ -84,7 +90,7 @@ Elevation profile options:
|
||||
|
||||
{{ $uniqueId := .Ordinal | safeJS }}
|
||||
|
||||
<div id="map_container_{{ $uniqueId }}" class="map-container">
|
||||
<div id="map_container_{{ $uniqueId }}" class="map-container" style="width: {{ .Get "width" | default "600px" }}; height: {{ .Get "height" | default "400px" }};">
|
||||
<div id="map_{{ $uniqueId }}" class="map"></div>
|
||||
<div id="map_backdrop_{{ $uniqueId }}" class="map-backdrop"></div>
|
||||
<div id="map_attribution_{{ $uniqueId }}" class="map-attribution"></div>
|
||||
|
@@ -1,6 +1,4 @@
|
||||
.map-container {
|
||||
height: 400px;
|
||||
width: 600px;
|
||||
padding: 6px 6px 18px 6px;
|
||||
background: #eee;
|
||||
border-radius: 8px;
|
||||
|
Reference in New Issue
Block a user