Function

MaplibreNativeFfiCamerafor_tile

Declaration [src]

MaplibreNativeFfiCameraOptions*
maplibre_native_ffi_camera_for_tile (
  const MaplibreNativeFfiCanonicalTileId* tile,
  const MaplibreNativeFfiLogicalSize* logical_size,
  GError** error
)

Description [src]

Computes the camera that shows exactly one tile on a square map.

Jump a map in MAPLIBRE_NATIVE_FFI_MAP_MODE_TILE to the camera to render tile, where logical_size is the map’s size. The camera centers the tile, zooms until the tile fills the map, and looks straight down with north up and no padding. The map keeps its camera within its zoom limits, so for a deep tile, raise the maximum zoom past the camera’s with maplibre_native_ffi_map_set_bounds_async().

See mln_camera_for_tile in the C API reference.

It fails with these errors:

  • MAPLIBRE_NATIVE_FFI_ERROR_INVALID_ARGUMENT when logical_size isn’t square, or is wider than 512 pixels. For denser tiles, raise the map’s scale factor instead.
  • MAPLIBRE_NATIVE_FFI_ERROR_INVALID_ARGUMENT when tile.x or tile.y isn’t less than 2 to the power tile.z, or when the tile can’t fill the map at a zoom from 0 to 25.5, as for tile 0/0/0 on a 256-pixel map.

Parameters

tile

Type: MaplibreNativeFfiCanonicalTileId

No description available.

The data is owned by the caller of the function.
logical_size

Type: MaplibreNativeFfiLogicalSize

No description available.

The data is owned by the caller of the function.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: MaplibreNativeFfiCameraOptions

The value.

The caller of the function takes ownership of the data, and is responsible for freeing it.