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

#include <map.h>

Data Fields

uint32_t debug_options
bool fully_loaded
bool gesture_in_progress
bool transition_in_progress
uint64_t latest_render_update_generation
mln_map_view view

Detailed Description

Immutable map state copied from the latest published generation.

Every field is unkeyed, fixed-size map state that changes only through this map's own commands or through load progress. Each map command that runs publishes a new generation and reports it through its completion, when it has one, even when the command changes nothing or fails, so a snapshot whose generation is at or past a completion observes that command.

Field Documentation

◆ debug_options

uint32_t mln_map_snapshot::debug_options

Debug overlay mask of mln_map_debug_option values.

◆ fully_loaded

bool mln_map_snapshot::fully_loaded

True once every requested style and tile resource finished loading.

◆ gesture_in_progress

bool mln_map_snapshot::gesture_in_progress

True while the map is inside a gesture.

A camera update or delta whose gesture_phase is MLN_GESTURE_PHASE_BEGIN or MLN_GESTURE_PHASE_UPDATE sets it; MLN_GESTURE_PHASE_END and MLN_GESTURE_PHASE_CANCEL clear it.

◆ latest_render_update_generation

uint64_t mln_map_snapshot::latest_render_update_generation

Generation of the latest render update the map published. A rendered frame at or past it draws map state that includes every command this snapshot observes, though animations and resource loads finish in later frames.

A command publishes the render update for its change before it reports its completion, and the completion reports that update's generation as mln_completion_result.render_update_generation. A frame result with disposition MLN_RENDER_RESULT_RENDERED and a map_update_generation at or past that value was rendered from map state that includes the command. A command group holds its commands' update until the outermost group ends, so this value stays behind the group's commands until then, while their completions already report the update that the group end publishes. For a camera command with a duration, that state is the transition's first step; the commanded camera appears in the update after the transition's last frame. Resources a command starts loading, such as a style or source URL, appear in later updates as they load.

◆ transition_in_progress

bool mln_map_snapshot::transition_in_progress

True while a camera command with a duration is still animating.

Each MapLibre transition reports its own MLN_RUNTIME_EVENT_MAP_CAMERA_DID_CHANGE as it ends, while others may keep the camera moving. The snapshot that the event's generation names reads false once the last transition has ended. A command without a duration never sets it.

◆ view

mln_map_view mln_map_snapshot::view

The map's camera, extent, projection mode, and viewport options. mln_map_projection_create() converts coordinates for this view.


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