Method

MaplibreNativeFfiMapapply_camera_delta_async

Declaration [src]

void
maplibre_native_ffi_map_apply_camera_delta_async (
  MaplibreNativeFfiMap* self,
  MaplibreNativeFfiCameraDelta* delta,
  GAsyncReadyCallback callback,
  gpointer user_data
)

Description [src]

Moves the camera relative to where it is, as a gesture does.

delta can pan the map’s content by an offset on the screen, scale the zoom, and add to the bearing and pitch. An anchor keeps one screen point in place while the scale, bearing, or pitch changes. An anchor needs one of those changes, and combines with an offset only when the delta has no animation. The function finishes when the map applies the delta, before an animation ends.

A delta that replaces an animated one starts from where that animation left the camera, so the rest of the replaced change never happens. To reach an exact camera, use maplibre_native_ffi_map_update_camera_async().

A delta in the end phase can carry momentum, which keeps the camera moving from the gesture’s release velocities and slows it on each rendered frame. The gesture lasts until the momentum ends: the snapshot keeps gesture_in_progress set, and camera events report MAPLIBRE_NATIVE_FFI_CAMERA_CHANGE_SOURCE_MOMENTUM. With momentum, animation sets only transition_id and the end handler, which runs when the gesture ends.

A delta in the begin phase, maplibre_native_ffi_map_cancel_camera_transitions_async(), or a cancellation by that ID stops the momentum. A later command that sets a field stops only the parts of the momentum that move that field. On a tilted map, the pan moves the map’s content the same distance on the screen in every direction.

See mln_map_apply_camera_delta in the C API reference.

Without callback, nothing reports whether the call succeeds.

This method completes asynchronously. Use maplibre_native_ffi_map_apply_camera_delta_finish() inside the GAsyncReadyCallback to obtain the result of the operation.

Parameters

delta

Type: MaplibreNativeFfiCameraDelta

No description available.

The data is owned by the caller of the method.
callback

Type: GAsyncReadyCallback

The callback to call when the call finishes.

The argument can be NULL.
user_data

Type: gpointer

The data to pass to callback.

The argument can be NULL.
The data is owned by the caller of the method.