aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-12-07 12:15:58 +0100
committertv <tv@krebsco.de>2020-12-07 12:19:42 +0100
commit27edbb270c05e220e82d8cf06d7dc0f743ad7131 (patch)
tree02817ea159b9a86d554c664fe108119d8ea1a482
parent979e35147583e863f99f3f4cccef3c002e88a963 (diff)
add Mapbox.Cmd.Option.encode
-rw-r--r--src/Mapbox/Cmd/Option.elm8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Mapbox/Cmd/Option.elm b/src/Mapbox/Cmd/Option.elm
index 4c6374f..a6fc65c 100644
--- a/src/Mapbox/Cmd/Option.elm
+++ b/src/Mapbox/Cmd/Option.elm
@@ -1,4 +1,4 @@
-module Mapbox.Cmd.Option exposing (Padding, animate, around, bearing, center, curve, duration, easing, linear, maxDuration, maxZoom, minZoom, offset, padding, pitch, screenSpeed, speed, zoom)
+module Mapbox.Cmd.Option exposing (Padding, animate, around, bearing, center, curve, duration, easing, encode, linear, maxDuration, maxZoom, minZoom, offset, padding, pitch, screenSpeed, speed, zoom)
{-|
@@ -32,6 +32,12 @@ import Mapbox.Expression exposing (DataExpression, Expression)
import Mapbox.Helpers exposing (encodePair)
+encode : List (Option supported) -> Value
+encode =
+ List.map (\(Option key val) -> ( key, val ))
+ >> Encode.object
+
+
{-| The animation's duration, measured in milliseconds.
-}
duration : Int -> Option { a | duration : Supported }