From 475cb4fd5db4cd5744a857bcc04f32a7329f80d2 Mon Sep 17 00:00:00 2001 From: Martin Rubli Date: Sun, 15 Oct 2023 23:36:13 +0200 Subject: [PATCH] layouts: layer: Add selectorPosition parameter --- layouts/shortcodes/leaflet-layer.html | 3 +++ layouts/shortcodes/leaflet-map.html | 3 +++ 2 files changed, 6 insertions(+) diff --git a/layouts/shortcodes/leaflet-layer.html b/layouts/shortcodes/leaflet-layer.html index 82991fa..002ddcf 100644 --- a/layouts/shortcodes/leaflet-layer.html +++ b/layouts/shortcodes/leaflet-layer.html @@ -16,4 +16,7 @@ apiKey: '{{ . }}', {{ end }} }; + {{ with .Get "selectorPosition" }} + map_options_{{ $uniqueMapId }}.layers.position = {{ . }}; + {{ end }} diff --git a/layouts/shortcodes/leaflet-map.html b/layouts/shortcodes/leaflet-map.html index 339dbb7..9df8ec0 100644 --- a/layouts/shortcodes/leaflet-map.html +++ b/layouts/shortcodes/leaflet-map.html @@ -34,6 +34,9 @@ Layer options: (*) API key required apiKey: API key for tile access. + selectorPosition: + Position of the layer selector button. One of: "topleft", "topright", "bottomleft", "bottomright" + Optional, defaults to "bottomleft". If specified for more than one layer, the last one wins. Marker options: