From af8b5c077da700236667ccb3cdcd736774dd9e3b Mon Sep 17 00:00:00 2001 From: Jakub Hampl Date: Tue, 21 Aug 2018 15:51:05 +0100 Subject: v0.19 compatibility (#1) --- src/Mapbox/Cmd/Option.elm | 11 +++++------ src/Mapbox/Cmd/Template.elm | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) (limited to 'src/Mapbox/Cmd') diff --git a/src/Mapbox/Cmd/Option.elm b/src/Mapbox/Cmd/Option.elm index 2e3321d..4c6374f 100644 --- a/src/Mapbox/Cmd/Option.elm +++ b/src/Mapbox/Cmd/Option.elm @@ -1,4 +1,4 @@ -module Mapbox.Cmd.Option exposing (duration, easing, offset, animate, curve, minZoom, speed, screenSpeed, maxDuration, center, zoom, bearing, pitch, around, padding, Padding, linear, maxZoom) +module Mapbox.Cmd.Option exposing (Padding, animate, around, bearing, center, curve, duration, easing, linear, maxDuration, maxZoom, minZoom, offset, padding, pitch, screenSpeed, speed, zoom) {-| @@ -25,12 +25,11 @@ Options common to `jumpTo`, `easeTo`, and `flyTo`, controlling the desired locat -} -import Mapbox.Helpers exposing (encodePair) import Json.Encode as Encode exposing (Value) -import Mapbox.Cmd.Internal as Internal exposing (Option(..), Supported) -import Mapbox.Helpers exposing (encodePair) import LngLat exposing (LngLat) +import Mapbox.Cmd.Internal as Internal exposing (Option(..), Supported) import Mapbox.Expression exposing (DataExpression, Expression) +import Mapbox.Helpers exposing (encodePair) {-| The animation's duration, measured in milliseconds. @@ -176,7 +175,7 @@ maxDuration = -} layers : List String -> Option { a | layers : Supported } layers = - List.map Encode.string >> Encode.list >> Option "layers" + Encode.list Encode.string >> Option "layers" {-| A filter to limit query results. @@ -197,4 +196,4 @@ intersectsPoint = -} intersectsBox : ( LngLat, LngLat ) -> Option { a | query : Supported } intersectsBox = - encodePair (LngLat.encodeAsPair) >> Option "query" + encodePair LngLat.encodeAsPair >> Option "query" diff --git a/src/Mapbox/Cmd/Template.elm b/src/Mapbox/Cmd/Template.elm index 4d412d5..3dbf66d 100644 --- a/src/Mapbox/Cmd/Template.elm +++ b/src/Mapbox/Cmd/Template.elm @@ -1,4 +1,4 @@ -module Mapbox.Cmd.Template exposing (Id, Outgoing, Option, Supported, panBy, panTo, zoomTo, zoomIn, zoomOut, rotateTo, jumpTo, easeTo, flyTo, stop, fitBounds, resize) +module Mapbox.Cmd.Template exposing (Id, Option, Outgoing, Supported, easeTo, fitBounds, flyTo, jumpTo, panBy, panTo, resize, rotateTo, stop, zoomIn, zoomOut, zoomTo) {-| This module has a bunch of essentially imperative commands for your map. @@ -27,9 +27,9 @@ You can of course customize the module you copy into your codebase to support th import Json.Decode as Decode import Json.Encode as Encode exposing (Value) +import LngLat exposing (LngLat) import Mapbox.Cmd.Internal as Internal exposing (Option(..), Supported) import Mapbox.Helpers exposing (encodePair) -import LngLat exposing (LngLat) {-| The type of a port that you need to provide for this module to work. @@ -367,30 +367,30 @@ queryRenderedFeatures prt id reqId options = -} queryResults : ((Value -> msg) -> Sub msg) -> (Int -> ( LngLat, LngLat ) -> response) -> (Int -> List Value -> response) -> (String -> response) -> (response -> msg) -> Sub msg -queryResults prt getBounds queryRenderedFeatures error tagger = - prt (decodeResponse getBounds queryRenderedFeatures error >> tagger) +queryResults prt getBounds_ queryRenderedFeatures_ error_ tagger = + prt (decodeResponse getBounds_ queryRenderedFeatures_ error_ >> tagger) -responseDecoder getBounds queryRenderedFeatures = +responseDecoder getBounds_ queryRenderedFeatures_ = Decode.field "type" Decode.string |> Decode.andThen (\s -> case s of "getBounds" -> - Decode.map2 getBounds (Decode.field "id" Decode.int) (Decode.field "bounds" (decodePair LngLat.decodeFromPair)) + Decode.map2 getBounds_ (Decode.field "id" Decode.int) (Decode.field "bounds" (decodePair LngLat.decodeFromPair)) "queryRenderedFeatures" -> - Decode.map2 queryRenderedFeatures (Decode.field "id" Decode.int) (Decode.field "features" (Decode.list Decode.value)) + Decode.map2 queryRenderedFeatures_ (Decode.field "id" Decode.int) (Decode.field "features" (Decode.list Decode.value)) _ -> Decode.fail <| "Unrecognized response type: " ++ s ) -decodeResponse getBounds queryRenderedFeatures error value = - case Decode.decodeValue (responseDecoder getBounds queryRenderedFeatures) value of +decodeResponse getBounds_ queryRenderedFeatures_ error_ value = + case Decode.decodeValue (responseDecoder getBounds_ queryRenderedFeatures_) value of Ok res -> res Err e -> - error e + error_ (Decode.errorToString e) -- cgit v1.2.3