diff options
author | Jakub Hampl <kopomir@gmail.com> | 2018-08-21 15:51:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-21 15:51:05 +0100 |
commit | af8b5c077da700236667ccb3cdcd736774dd9e3b (patch) | |
tree | 5472d2c8fdf9cc81948a822e89672a0d74e5e0f3 /src/Mapbox/Element.elm | |
parent | 11d932001ed65fed690b835e5eef504f90845533 (diff) |
v0.19 compatibility (#1)
Diffstat (limited to 'src/Mapbox/Element.elm')
-rw-r--r-- | src/Mapbox/Element.elm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Mapbox/Element.elm b/src/Mapbox/Element.elm index 14b6873..b9cd74c 100644 --- a/src/Mapbox/Element.elm +++ b/src/Mapbox/Element.elm @@ -20,7 +20,7 @@ module Mapbox.Element exposing (EventData, MapboxAttr, TouchEvent, css, eventFea import Html exposing (Attribute, Html, node) import Html.Attributes exposing (attribute, property) -import Html.Events exposing (Options) +import Html.Events import Json.Decode as Decode exposing (Decoder, Value) import Json.Encode as Encode import LngLat exposing (LngLat) @@ -127,8 +127,7 @@ This needs more design before release. -} featureState : List ( Value, List ( String, Value ) ) -> MapboxAttr msg featureState = - List.map (\( feature, state ) -> Encode.list [ feature, Encode.object state ]) - >> Encode.list + Encode.list (\( feature, state ) -> Encode.list identity [ feature, Encode.object state ]) >> property "featureState" >> MapboxAttr @@ -150,7 +149,7 @@ a lot of data. Here you can specify which layers you want to search for intersec -} eventFeaturesLayers : List String -> MapboxAttr msg eventFeaturesLayers = - List.map Encode.string >> Encode.list >> property "eventFeaturesLayers" >> MapboxAttr + Encode.list Encode.string >> property "eventFeaturesLayers" >> MapboxAttr {-| This allows you to use other events not provided by this libary. @@ -158,9 +157,9 @@ eventFeaturesLayers = See <https://www.mapbox.com/mapbox-gl-js/api/#map.event> for all supported events. -} -onWithOptions : String -> Options -> Decoder msg -> MapboxAttr msg -onWithOptions type_ opts decoder = - Html.Events.onWithOptions type_ opts decoder |> MapboxAttr +on : String -> Decoder msg -> MapboxAttr msg +on type_ decoder = + Html.Events.on type_ decoder |> MapboxAttr {-| `point` is the coordinates in pixels in screen space. @@ -199,7 +198,7 @@ type alias TouchEvent = decodePoint = - Decode.map2 (,) (Decode.field "x" Decode.int) (Decode.field "y" Decode.int) + Decode.map2 (\a b -> ( a, b )) (Decode.field "x" Decode.int) (Decode.field "y" Decode.int) decodeEventData = |