Method

MaplibreNativeFfiMapcamera_for_geometry_async

Declaration [src]

void
maplibre_native_ffi_map_camera_for_geometry_async (
  MaplibreNativeFfiMap* self,
  const char* geometry,
  MaplibreNativeFfiCameraFitOptions* fit_options,
  GAsyncReadyCallback callback,
  gpointer user_data
)

Description [src]

Computes a camera that fits a GeoJSON geometry in the map’s view.

geometry is a GeoJSON geometry object with at least one coordinate, not a feature. The camera keeps the map’s bearing and pitch unless fit_options sets them, and its zoom stays within the map’s zoom limits.

See mln_map_camera_for_geometry in the C API reference.

It fails with these errors:

  • MAPLIBRE_NATIVE_FFI_ERROR_INVALID_ARGUMENT when the padding in fit_options leaves no room for the area.

This method completes asynchronously. Use maplibre_native_ffi_map_camera_for_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.
fit_options

Type: MaplibreNativeFfiCameraFitOptions

The value, or NULL.

The argument can be NULL.
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.