Method
MaplibreNativeFfiMapfit_camera_to_geometry_async
Declaration [src]
void
maplibre_native_ffi_map_fit_camera_to_geometry_async (
MaplibreNativeFfiMap* self,
const char* geometry,
MaplibreNativeFfiCameraFitUpdate* update,
GAsyncReadyCallback callback,
gpointer user_data
)
Description [src]
Moves the camera to fit a GeoJSON geometry in the map’s view, at once or with an animation.
geometry is a GeoJSON geometry object with at least one coordinate, not a
feature. The camera is the one that
maplibre_native_ffi_map_camera_for_geometry_async() computes after the
commands sent before this one apply. The function finishes when the map
applies the change, before an animation ends.
See mln_map_fit_camera_to_geometry in the
C API reference.
It fails with these errors:
MAPLIBRE_NATIVE_FFI_ERROR_INVALID_ARGUMENTwhen the padding inupdateleaves no room for the area. The camera doesn’t move.
Without callback, nothing reports whether the call succeeds.
This method completes asynchronously. Use maplibre_native_ffi_map_fit_camera_to_geometry_finish() inside the GAsyncReadyCallback to obtain the result of the operation.
Parameters
geometry-
Type:
const char*The UTF-8 text.
The data is owned by the caller of the method. The value is a NUL terminated UTF-8 string. update-
Type:
MaplibreNativeFfiCameraFitUpdateNo description available.
The data is owned by the caller of the method. callback-
Type:
GAsyncReadyCallbackThe callback to call when the call finishes.
The argument can be NULL. user_data-
Type:
gpointerThe data to pass to
callback.The argument can be NULL.The data is owned by the caller of the method.