From 05165af0a4317814e8240ec3742d28bf4bbbe7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Dietrich?= Date: Fri, 6 Sep 2019 13:33:31 +0200 Subject: added zoom_ and center_ attributes to mapbox Elements --- src/Mapbox/Element.elm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Mapbox/Element.elm b/src/Mapbox/Element.elm index 7802983..5a93501 100644 --- a/src/Mapbox/Element.elm +++ b/src/Mapbox/Element.elm @@ -1,6 +1,6 @@ module Mapbox.Element exposing ( map, css, MapboxAttr - , token, id, maxZoom, minZoom, maxBounds, renderWorldCopies, featureState + , token, id, zoom_, center_, maxZoom, minZoom, maxBounds, renderWorldCopies, featureState , EventData, TouchEvent, eventFeaturesFilter, eventFeaturesLayers , onMouseDown, onMouseUp, onMouseOver, onMouseMove, onClick, onDblClick, onMouseOut, onContextMenu, onZoom, onZoomStart, onZoomEnd, onRotate, onRotateStart, onRotateEnd, onTouchEnd, onTouchMove, onTouchCancel, on ) @@ -12,7 +12,7 @@ module Mapbox.Element exposing ### Attributes -@docs token, id, maxZoom, minZoom, maxBounds, renderWorldCopies, featureState +@docs token, id, zoom_, center_, maxZoom, minZoom, maxBounds, renderWorldCopies, featureState ### Events @@ -75,6 +75,20 @@ css = node "link" [ attribute "href" "https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.0/mapbox-gl.css", attribute "rel" "stylesheet" ] [] +{-| Define the default zoom level of the map (0-24). +-} +zoom_ : Float -> MapboxAttr msg +zoom_ = + Encode.float >> property "zoom" >> MapboxAttr + + +{-| The default center pos. +-} +center_ : LngLat -> MapboxAttr msg +center_ = + LngLat.encodeAsPair >> property "center" >> MapboxAttr + + {-| The minimum zoom level of the map (0-24). -} minZoom : Float -> MapboxAttr msg -- cgit v1.2.3