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

#include <style.h>

Data Fields

mln_custom_source_fetch_tile_callback fetch_tile
mln_custom_source_cancel_tile_callback cancel_tile
void * user_data
mln_user_data_release release_user_data
mln_delivery_queue queue

Detailed Description

Options for custom geometry sources.

Field Documentation

◆ cancel_tile

mln_custom_source_cancel_tile_callback mln_custom_geometry_source_options::cancel_tile

Optional best-effort tile cancel callback. Null in queue mode.

◆ fetch_tile

mln_custom_source_fetch_tile_callback mln_custom_geometry_source_options::fetch_tile

Tile fetch callback. Required in callback mode; null in queue mode.

◆ queue

mln_delivery_queue mln_custom_geometry_source_options::queue

Optional. Queue delivery in place of fetch_tile and cancel_tile: each fetch and each cancel is copied into one MLN_DELIVERY_TYPE_CUSTOM_SOURCE_FETCH_TILE or MLN_DELIVERY_TYPE_CUSTOM_SOURCE_CANCEL_TILE delivery carrying user_data, and one MLN_DELIVERY_TYPE_RETIRED delivery follows the last of them where callback mode runs release_user_data. A command rejects an invalid queue handle with MLN_STATUS_INVALID_ARGUMENT and a released queue with MLN_STATUS_INVALID_STATE.

◆ release_user_data

mln_user_data_release mln_custom_geometry_source_options::release_user_data

Optional. Invoked once after an accepted command stops referencing user_data.

The call runs on the runtime execution thread when the source is removed explicitly, when a style command replaces the style that held the source, when the map is destroyed, or when asynchronous application rejects the source. It runs at most once for each accepted command. A synchronous rejection before command acceptance invokes no release. A host transfers its callback state to each accepted command and frees that state here. Null means the host needs no release.

Free callback state and return promptly. The callback may call the C API, but must not wait for runtime work that only its own thread can advance. Null in queue mode.

◆ user_data

void* mln_custom_geometry_source_options::user_data

Caller-owned callback context retained by pointer, or an opaque host token in queue mode.


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