MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
mln_animation_options Struct Reference

#include <map.h>

Data Fields

double duration_ms
 
double velocity
 
double min_zoom
 
uint64_t transition_id
 

Detailed Description

Optional animation controls for camera transitions.

Field Documentation

◆ duration_ms

double mln_animation_options::duration_ms

Duration in milliseconds. Must be finite and non-negative. Values that would overflow MapLibre Native's internal duration are invalid.

When this field is omitted, ease, pan, zoom, rotate, and pitch transitions default to zero and apply instantly, while mln_map_fly_to() derives a duration from velocity instead.

◆ min_zoom

double mln_animation_options::min_zoom

Peak zoom for flyTo transitions.

◆ transition_id

uint64_t mln_animation_options::transition_id

Caller-chosen identity for the transition this options struct starts.

When MLN_ANIMATION_OPTION_TRANSITION_ID is set, the transition emits one MLN_RUNTIME_EVENT_MAP_CAMERA_TRANSITION_FINISHED event carrying this value in its mln_runtime_event_camera_transition_finished payload. The C API passes the value through without interpreting it, so callers pick their own scheme, such as a monotonically increasing counter.

Each transition emits that event exactly once, whichever way it ends: running to completion, being superseded by a later camera command, being cancelled by mln_map_cancel_transitions(), or completing instantly as a zero-duration jump. A command this API rejects – one carrying a non-finite enabled camera field, for example – starts no transition and emits no such event. MapLibre Native reports the moment a transition releases the camera and does not report which of those outcomes occurred, so this event establishes transition identity rather than a completion reason. A host that needs to tell completion from cancellation compares the resulting camera against the requested one, or tracks which transition ID is current.

The event is queued on the runtime that owns the map and is drained by mln_runtime_poll_event(). For a transition that runs to completion, it is queued immediately before that transition's MLN_RUNTIME_EVENT_MAP_CAMERA_DID_CHANGE event.

When this field is omitted, the transition emits no such event.

◆ velocity

double mln_animation_options::velocity

Average flyTo velocity in screenfuls per second. Must be positive. Defaults to 1.2 when omitted. Applies to mln_map_fly_to().


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