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

#include <map.h>

Data Fields

mln_screen_point offset
double scale
double bearing
double pitch
mln_screen_point anchor

Detailed Description

One atomic relative camera update.

Each selected component resolves against the camera as it stands when the command runs. Immediate deltas therefore compose exactly, however many are queued. An animated delta starts from the value a running transition has reached and replaces that component's transition, so queue animated deltas only after the previous one has rendered or finished.

OFFSET pans first, in the current camera's logical pixels: the content moves by offset, so positive x moves it right and positive y moves it down, and a pointer drag delta passes through unchanged. The pan stops short of the horizon. SCALE, BEARING, and PITCH then change the camera about anchor when ANCHOR is set, keeping the coordinate under anchor in the panned camera fixed, or about the center otherwise. ANCHOR requires SCALE, BEARING, or PITCH. ANCHOR combines with OFFSET only for an immediate delta, one whose animation selects no DURATION or a zero duration; a two-finger gesture passes its centroid movement as offset and its new centroid as anchor. An animated bearing change takes the shorter way around.

fields may be zero, in which case the delta changes only the gesture phase and its animation's end handler runs at once. gesture_phase is applied around the camera write, as in mln_camera_update. The command copies this struct before returning.

Field Documentation

◆ anchor

mln_screen_point mln_camera_delta::anchor

Screen point in logical map pixels that scale, bearing, and pitch keep fixed.

◆ bearing

double mln_camera_delta::bearing

Degrees added to the bearing.

◆ offset

mln_screen_point mln_camera_delta::offset

Pan in logical map pixels; the content moves by this offset.

◆ pitch

double mln_camera_delta::pitch

Degrees added to the pitch; positive tilts further from straight down.

◆ scale

double mln_camera_delta::scale

Positive zoom factor; 2 zooms in one level.


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