summaryrefslogtreecommitdiff
path: root/themes/CodeIT/layouts/shortcodes/mapbox.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/CodeIT/layouts/shortcodes/mapbox.html')
-rw-r--r--themes/CodeIT/layouts/shortcodes/mapbox.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/themes/CodeIT/layouts/shortcodes/mapbox.html b/themes/CodeIT/layouts/shortcodes/mapbox.html
index 516d370..5ae9d76 100644
--- a/themes/CodeIT/layouts/shortcodes/mapbox.html
+++ b/themes/CodeIT/layouts/shortcodes/mapbox.html
@@ -12,6 +12,7 @@
{{- $fullscreen := $mapbox.fullscreen -}}
{{- $width := "100%" -}}
{{- $height := "20rem" -}}
+{{- $properties := "" -}}
{{- if .IsNamedParams -}}
{{- $lightStyle = .Get "light-style" | default $lightStyle -}}
@@ -22,12 +23,16 @@
{{- $fullscreen = .Get "fullscreen" | ne false | and $fullscreen -}}
{{- $width = .Get "width" | default $width -}}
{{- $height = .Get "height" | default $height -}}
+ {{- $properties = .Get "properties" | default "" -}}
{{- else -}}
{{- $lightStyle = .Get 4 | default $lightStyle -}}
{{- $darkStyle = .Get 5 | default $darkStyle -}}
{{- end -}}
+
+{{- $optionsJson := getJSON $properties -}}
+
{{- $darkStyle = $darkStyle | default $lightStyle -}}
-{{- $options := dict "lng" $lng "lat" $lat "zoom" $zoom "marked" $marked "lightStyle" $lightStyle "darkStyle" $darkStyle "geolocate" $geolocate "navigation" $navigation "scale" $scale "fullscreen" $fullscreen -}}
+{{- $options := dict "lng" $lng "lat" $lat "zoom" $zoom "marked" $marked "lightStyle" $lightStyle "darkStyle" $darkStyle "geolocate" $geolocate "navigation" $navigation "scale" $scale "fullscreen" $fullscreen "optionsJson" $optionsJson -}}
{{- $id := dict "Content" $options "Scratch" .Page.Scratch | partial "function/id.html" -}}
<div class="mapbox" id="{{ $id }}" style="width: {{ $width }}; height: {{ $height }};"></div>
{{- .Page.Scratch.SetInMap "this" "mapbox" true -}}