mirror of
https://gitlab.com/mrubli/hugo-mod-leaflet.git
synced 2025-10-07 01:54:24 +00:00
Merge branch 'feature/quip-maps-v0.0.6'
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
<script>
|
<script>
|
||||||
map_options_{{ $uniqueMapId }}.heightgraph = {
|
map_options_{{ $uniqueMapId }}.heightgraph = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
expanded: {{ .Get "expanded" | default "false" }},
|
||||||
{{ with .Get "resizable" }}
|
{{ with .Get "resizable" }}
|
||||||
resizable: {{ . }},
|
resizable: {{ . }},
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Syntax summary:
|
Syntax summary:
|
||||||
|
|
||||||
{{< leaflet-map centerLat=FLOAT centerLon=FLOAT zoom=INT width="STRING" height="STRING" >}}
|
{{< leaflet-map centerLat=FLOAT centerLon=FLOAT zoom=INT width="STRING" height="STRING" resizable=BOOL maximizable=BOOL >}}
|
||||||
|
|
||||||
{{< leaflet-layer id="STRING" apiKey="STRING" >}}
|
{{< leaflet-layer id="STRING" apiKey="STRING" >}}
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ Syntax summary:
|
|||||||
|
|
||||||
{{< leaflet-scale >}}
|
{{< leaflet-scale >}}
|
||||||
|
|
||||||
{{< leaflet-elevation-profile resizable=BOOL >}}
|
{{< leaflet-elevation-profile expanded=BOOL resizable=BOOL width=INT height=INT minWidth=INT minHeight=INT maxWidth=INT maxHeight=INT >}}
|
||||||
|
|
||||||
{{< /leaflet-map >}}
|
{{< /leaflet-map >}}
|
||||||
|
|
||||||
@@ -28,6 +28,12 @@ Map options:
|
|||||||
height:
|
height:
|
||||||
Height of the map, including CSS units (e.g. "50%", "300px").
|
Height of the map, including CSS units (e.g. "50%", "300px").
|
||||||
Optional, defaults to "50vh".
|
Optional, defaults to "50vh".
|
||||||
|
resizable:
|
||||||
|
Boolean value indicating whether the map should be drag & drop resizable.
|
||||||
|
Optional, defaults to true.
|
||||||
|
maximizable:
|
||||||
|
Boolean value indicating whether the maximize button should be displayed.
|
||||||
|
Optional, defaults to true.
|
||||||
|
|
||||||
Layer options:
|
Layer options:
|
||||||
|
|
||||||
@@ -65,6 +71,9 @@ Elevation profile options:
|
|||||||
resizable:
|
resizable:
|
||||||
Boolean value indicating whether the elevation profile box should be drag & drop resizable.
|
Boolean value indicating whether the elevation profile box should be drag & drop resizable.
|
||||||
Optional, defaults to false.
|
Optional, defaults to false.
|
||||||
|
expanded:
|
||||||
|
Boolean value indicating whether the elevation profile should be expanded by default.
|
||||||
|
Optional, defaults to true.
|
||||||
width:
|
width:
|
||||||
Width of the elevation profile.
|
Width of the elevation profile.
|
||||||
Optional, defaults to 360.
|
Optional, defaults to 360.
|
||||||
@@ -105,6 +114,9 @@ Elevation profile options:
|
|||||||
enabled: [],
|
enabled: [],
|
||||||
},
|
},
|
||||||
scale: false,
|
scale: false,
|
||||||
|
maximize: {
|
||||||
|
enabled: {{ .Get "maximizable" | default "true" }},
|
||||||
|
},
|
||||||
markers: [],
|
markers: [],
|
||||||
tracks: [],
|
tracks: [],
|
||||||
heightgraph: null,
|
heightgraph: null,
|
||||||
@@ -141,11 +153,13 @@ Elevation profile options:
|
|||||||
// Create the map
|
// Create the map
|
||||||
var map = Quip.createTrackMap(map_options_{{ $uniqueId }});
|
var map = Quip.createTrackMap(map_options_{{ $uniqueId }});
|
||||||
|
|
||||||
|
{{ if .Get "resizable" | default "true" }}
|
||||||
// Make the map resizable
|
// Make the map resizable
|
||||||
$('#map_container_{{ $uniqueId }}').resizable({
|
$('#map_container_{{ $uniqueId }}').resizable({
|
||||||
handles: 'e, s, se',
|
handles: 'e, s, se',
|
||||||
resize: () => map.invalidateSize(),
|
resize: () => map.invalidateSize(),
|
||||||
});
|
});
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
// Move the Leaflet attribution out of the map container
|
// Move the Leaflet attribution out of the map container
|
||||||
$('#map_attribution_{{ $uniqueId }}').append(
|
$('#map_attribution_{{ $uniqueId }}').append(
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
.map-container {
|
.map-container {
|
||||||
|
position: relative;
|
||||||
padding: 6px 6px 18px 6px;
|
padding: 6px 6px 18px 6px;
|
||||||
background: #eee;
|
background: #eee;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -28,7 +29,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.map-attribution {
|
.map-attribution {
|
||||||
position: absolute;
|
|
||||||
left: 0px;
|
left: 0px;
|
||||||
bottom: 3px;
|
bottom: 3px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user