From c7dffe54d8debd1851d027553afc4ea4d1047f4a Mon Sep 17 00:00:00 2001 From: Rahul Butani Date: Mon, 4 Feb 2019 05:38:38 -0600 Subject: Handle (Float, Float) pixel values (#5) Versions of Google Chrome (and possibly other browsers) seem to return decimal pixel values for some zoom values. This results in silent errors; for Example01 specifically this causes Hover and Click events (onMouseMove and onClick) respectively to never make it to the update function. --- src/Mapbox/Element.elm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Mapbox/Element.elm b/src/Mapbox/Element.elm index 8eb9132..9b29392 100644 --- a/src/Mapbox/Element.elm +++ b/src/Mapbox/Element.elm @@ -232,7 +232,7 @@ type alias TouchEvent = decodePoint = - Decode.map2 (\a b -> ( a, b )) (Decode.field "x" Decode.int) (Decode.field "y" Decode.int) + Decode.map2 (\a b -> ( round a, round b )) (Decode.field "x" Decode.float) (Decode.field "y" Decode.float) decodeEventData = -- cgit v1.2.3