andre-dietrich / elm-mapbox / Mapbox.Cmd.Option

Animation options

Options common to map movement commands that involve animation, such as panBy and easeTo, controlling the duration and easing function of the animation. All properties are optional.

duration : Basics.Int -> Mapbox.Cmd.Internal.Option { a | duration : Mapbox.Cmd.Internal.Supported }

The animation's duration, measured in milliseconds.

easing : String -> Mapbox.Cmd.Internal.Option { a | easing : Mapbox.Cmd.Internal.Supported }

The name of an easing function. These must be passed to elmMapbox in the easingFunctions option.

offset : ( Basics.Int, Basics.Int ) -> Mapbox.Cmd.Internal.Option { a | offset : Mapbox.Cmd.Internal.Supported }

Offset of the target center relative to real map container center at the end of animation.

animate : Basics.Bool -> Mapbox.Cmd.Internal.Option { a | animate : Mapbox.Cmd.Internal.Supported }

If false, no animation will occur.

curve : Basics.Float -> Mapbox.Cmd.Internal.Option { a | curve : Mapbox.Cmd.Internal.Supported }

The zooming "curve" that will occur along the flight path. A high value maximizes zooming for an exaggerated animation, while a low value minimizes zooming for an effect closer to easeTo. 1.42 is the average value selected by participants in the user study discussed in van Wijk (2003). A value of 6 ^ 0.25 would be equivalent to the root mean squared average velocity. A value of 1 would produce a circular motion.

minZoom : Basics.Float -> Mapbox.Cmd.Internal.Option { a | minZoom : Mapbox.Cmd.Internal.Supported }

The zero-based zoom level at the peak of the flight path. If curve is specified, this option is ignored.

speed : Basics.Float -> Mapbox.Cmd.Internal.Option { a | speed : Mapbox.Cmd.Internal.Supported }

The average speed of the animation defined in relation to curve. A speed of 1.2 means that the map appears to move along the flight path by 1.2 times curve screenfuls every second. A screenful is the map's visible span. It does not correspond to a fixed physical distance, but varies by zoom level.

screenSpeed : Basics.Float -> Mapbox.Cmd.Internal.Option { a | screenSpeed : Mapbox.Cmd.Internal.Supported }

The average speed of the animation measured in screenfuls per second, assuming a linear timing curve. If speed is specified, this option is ignored.

maxDuration : Basics.Float -> Mapbox.Cmd.Internal.Option { a | maxDuration : Mapbox.Cmd.Internal.Supported }

The animation's maximum duration, measured in milliseconds. If duration exceeds maximum duration, it resets to 0.

Camera Options

Options common to jumpTo, easeTo, and flyTo, controlling the desired location, zoom, bearing, and pitch of the camera. All properties are optional, and when a property is omitted, the current camera value for that property will remain unchanged.

center : LngLat -> Mapbox.Cmd.Internal.Option { a | center : Mapbox.Cmd.Internal.Supported }

The desired center.

zoom : Basics.Float -> Mapbox.Cmd.Internal.Option { a | zoom : Mapbox.Cmd.Internal.Supported }

The desired zoom level.

bearing : Basics.Float -> Mapbox.Cmd.Internal.Option { a | bearing : Mapbox.Cmd.Internal.Supported }

The desired bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up.

pitch : Basics.Float -> Mapbox.Cmd.Internal.Option { a | pitch : Mapbox.Cmd.Internal.Supported }

The desired pitch, in degrees.

around : LngLat -> Mapbox.Cmd.Internal.Option { a | around : Mapbox.Cmd.Internal.Supported }

If zoom is specified, around determines the point around which the zoom is centered.

Fiting bounds

padding : Padding -> Mapbox.Cmd.Internal.Option { a | padding : Mapbox.Cmd.Internal.Supported }

The amount of padding in pixels to add to the given bounds.


type alias Padding =
{ top : Basics.Int
, right : Basics.Int
, bottom : Basics.Int
, left : Basics.Int 
}

linear : Basics.Bool -> Mapbox.Cmd.Internal.Option { a | linear : Mapbox.Cmd.Internal.Supported }

If true, the map transitions using easeTo . If false, the map transitions using flyTo.

maxZoom : Basics.Float -> Mapbox.Cmd.Internal.Option { a | maxZoom : Mapbox.Cmd.Internal.Supported }

The maximum zoom level to allow when the map view transitions to the specified bounds.