aboutsummaryrefslogtreecommitdiffstats
path: root/src/Mapbox
diff options
context:
space:
mode:
authorAndré Dietrich <andre.dietrich@ovgu.de>2019-09-06 13:33:31 +0200
committerAndré Dietrich <andre.dietrich@ovgu.de>2019-09-06 13:39:55 +0200
commit05165af0a4317814e8240ec3742d28bf4bbbe7ab (patch)
treeb1b1ab36296a969c6d0ada0bdabaaaedf62f89e0 /src/Mapbox
parent5e78c8d4bd8527d2b0cd38022ab414eb9545e6d5 (diff)
added zoom_ and center_ attributes to mapbox Elements
Diffstat (limited to 'src/Mapbox')
-rw-r--r--src/Mapbox/Element.elm18
1 files 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