From 9bd079e10dfa68df2f2fec5adb35df90edb3525f Mon Sep 17 00:00:00 2001 From: Jakub Hampl Date: Fri, 15 Feb 2019 20:50:23 +0000 Subject: Mapbox Upgrade + Simplified Enums (#9) --- style-generator/src/Decoder/Expression.elm | 70 ++++++++++++++++-------------- style-generator/src/Main.elm | 4 -- 2 files changed, 38 insertions(+), 36 deletions(-) (limited to 'style-generator') diff --git a/style-generator/src/Decoder/Expression.elm b/style-generator/src/Decoder/Expression.elm index 137ab26..aa4dd87 100644 --- a/style-generator/src/Decoder/Expression.elm +++ b/style-generator/src/Decoder/Expression.elm @@ -35,88 +35,94 @@ decodeLiteral = makeConstant s = case s of "map" -> - Lib.eValue "anchorMap" + Lib.eValue "map" "viewport" -> - Lib.eValue "anchorViewport" + Lib.eValue "viewport" "auto" -> - Lib.eValue "anchorAuto" + Lib.eValue "auto" "center" -> - Lib.eValue "positionCenter" + Lib.eValue "center" "left" -> - Lib.eValue "positionLeft" + Lib.eValue "left" "right" -> - Lib.eValue "positionRight" + Lib.eValue "right" "top" -> - Lib.eValue "positionTop" + Lib.eValue "top" "bottom" -> - Lib.eValue "positionBottom" + Lib.eValue "bottom" - "topRight" -> - Lib.eValue "positionTopRight" + "top-left" -> + Lib.eValue "topLeft" - "topLeft" -> - Lib.eValue "positionTopLeft" + "top-right" -> + Lib.eValue "topRight" - "bottomLeft" -> - Lib.eValue "positionBottomLeft" + "bottom-left" -> + Lib.eValue "bottomLeft" - "bottomRight" -> - Lib.eValue "positionBottomRight" + "bottom-right" -> + Lib.eValue "bottomRight" "none" -> - Lib.eValue "textFitNone" + Lib.eValue "none" "width" -> - Lib.eValue "textFitWidth" + Lib.eValue "width" "height" -> - Lib.eValue "textFitHeight" + Lib.eValue "height" "both" -> - Lib.eValue "textFitBoth" + Lib.eValue "both" "butt" -> - Lib.eValue "lineCapButt" + Lib.eValue "butt" "round" -> - Lib.eValue "lineCapRound" + Lib.eValue "rounded" "square" -> - Lib.eValue "lineCapSquare" + Lib.eValue "square" "bevel" -> - Lib.eValue "lineJoinBevel" + Lib.eValue "bevel" "miter" -> - Lib.eValue "lineJoinMiter" + Lib.eValue "miter" "point" -> - Lib.eValue "symbolPlacementPoint" + Lib.eValue "point" "line-center" -> - Lib.eValue "symbolPlacementLineCenter" + Lib.eValue "lineCenter" "line" -> - Lib.eValue "symbolPlacementLine" + Lib.eValue "line" "uppercase" -> - Lib.eValue "textTransformUppercase" + Lib.eValue "uppercase" "lowercase" -> - Lib.eValue "textTransformLowercase" + Lib.eValue "lowercase" "linear" -> - Lib.eValue "rasterResamplingLinear" + Lib.eValue "linear" "nearest" -> - Lib.eValue "rasterResamplingNearest" + Lib.eValue "nearest" + + "viewport-y" -> + Lib.eValue "viewportY" + + "source" -> + Lib.eValue "source" _ -> case Color.parse s of diff --git a/style-generator/src/Main.elm b/style-generator/src/Main.elm index 3b1a153..fe07bc4 100644 --- a/style-generator/src/Main.elm +++ b/style-generator/src/Main.elm @@ -203,10 +203,6 @@ results attrs model = , Element.paragraph [] [ Element.text "In Studio, hit the share button. This will give you the style url and token. This tool will attempt to generate an elm-mapbox style for you. It is not perfect, but should give a nice head-start. Try to compile the file and see if you get any errors." ] , Element.paragraph [] [ text "There are a few common limitations that are relatively easy to fix with some grepping. For example, " - , code "Layer.lineJoin E.lineCapRound" - , text " should be replaced by " - , code "Layer.lineJoin E.lineJoinRound" - , text ". Also " , code "Layer.textField" , text " is often followed by " , code "E.toString" -- cgit v1.2.3