MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::AnimationOptions Struct Reference

#include <camera.hpp>

Public Member Functions

 AnimationOptions ()=default
 
 AnimationOptions (Duration d)
 

Public Attributes

std::optional< Durationduration
 
std::optional< double > velocity
 
std::optional< double > minZoom
 
std::optional< mbgl::util::UnitBeziereasing
 
std::function< void(double)> transitionFrameFn
 
std::function< void()> transitionFinishFn
 

Detailed Description

Various options for describing a transition between viewpoints with animation. All fields are optional; the default values depend on how this struct is used.

Definition at line 66 of file camera.hpp.

Constructor & Destructor Documentation

◆ AnimationOptions() [1/2]

mbgl::AnimationOptions::AnimationOptions ( )
default

Creates an animation with no options specified.

◆ AnimationOptions() [2/2]

mbgl::AnimationOptions::AnimationOptions ( Duration  d)
inline

Creates an animation with the specified duration.

Definition at line 97 of file camera.hpp.

Member Data Documentation

◆ duration

std::optional<Duration> mbgl::AnimationOptions::duration

Time to animate to the viewpoint defined herein.

Definition at line 68 of file camera.hpp.

◆ easing

std::optional<mbgl::util::UnitBezier> mbgl::AnimationOptions::easing

The easing timing curve of the transition.

Definition at line 82 of file camera.hpp.

◆ minZoom

std::optional<double> mbgl::AnimationOptions::minZoom

Zero-based zoom level at the peak of the flyTo() transition’s flight path.

Definition at line 79 of file camera.hpp.

◆ transitionFinishFn

std::function<void()> mbgl::AnimationOptions::transitionFinishFn

A function that is called once on the last frame of the transition, just before the corresponding screen update.

Definition at line 91 of file camera.hpp.

◆ transitionFrameFn

std::function<void(double)> mbgl::AnimationOptions::transitionFrameFn

A function that is called on each frame of the transition, just before a screen update, except on the last frame. The first parameter indicates the elapsed time as a percentage of the duration.

Definition at line 87 of file camera.hpp.

◆ velocity

std::optional<double> mbgl::AnimationOptions::velocity

Average velocity of a flyTo() transition, measured in screenfuls per second, assuming a linear timing curve.

A screenful is the visible span in pixels. It does not correspond to a fixed physical distance but rather varies by zoom level.

Definition at line 75 of file camera.hpp.


The documentation for this struct was generated from the following file: