layouts: scale: Add position parameter

This commit is contained in:
Martin Rubli
2023-10-15 23:36:31 +02:00
parent 475cb4fd5d
commit c7fb817a0b
2 changed files with 9 additions and 2 deletions

View File

@@ -50,7 +50,9 @@ Track options:
Scale options:
(none)
position:
Position of the scale. One of: "topleft", "topright", "bottomleft", "bottomright"
Optional, defaults to "bottomright".
Elevation profile options:

View File

@@ -5,5 +5,10 @@
{{ $uniqueMapId := .Parent.Ordinal | safeJS }}
<script>
map_options_{{ $uniqueMapId }}.scale = { enabled: true };
map_options_{{ $uniqueMapId }}.scale = {
enabled: true,
{{ with .Get "position" }}
position: {{ . }},
{{ end }}
};
</script>