From 27edbb270c05e220e82d8cf06d7dc0f743ad7131 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 7 Dec 2020 12:15:58 +0100 Subject: add Mapbox.Cmd.Option.encode --- src/Mapbox/Cmd/Option.elm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 } -- cgit v1.2.3