|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Data Structures | |
| struct | mln_screen_box |
| struct | mln_screen_line_string |
| union | mln_rendered_query_geometry_data |
| struct | mln_rendered_query_geometry |
| struct | mln_rendered_feature_query_options |
| struct | mln_source_feature_query_options |
| struct | mln_rendered_feature |
| struct | mln_source_feature |
Typedefs | |
| typedef enum mln_rendered_query_geometry_type | mln_rendered_query_geometry_type |
| typedef struct mln_screen_box | mln_screen_box |
| typedef struct mln_screen_line_string | mln_screen_line_string |
| typedef union mln_rendered_query_geometry_data | mln_rendered_query_geometry_data |
| typedef struct mln_rendered_query_geometry | mln_rendered_query_geometry |
| typedef enum mln_rendered_feature_query_option_field | mln_rendered_feature_query_option_field |
| typedef struct mln_rendered_feature_query_options | mln_rendered_feature_query_options |
| typedef enum mln_source_feature_query_option_field | mln_source_feature_query_option_field |
| typedef struct mln_source_feature_query_options | mln_source_feature_query_options |
| typedef enum mln_rendered_feature_field | mln_rendered_feature_field |
| typedef struct mln_rendered_feature | mln_rendered_feature |
| typedef enum mln_source_feature_field | mln_source_feature_field |
| typedef struct mln_source_feature | mln_source_feature |
Enumerations | |
| enum | mln_rendered_query_geometry_type : uint32_t |
| enum | mln_rendered_feature_query_option_field : uint32_t |
| enum | mln_source_feature_query_option_field : uint32_t |
| enum | mln_rendered_feature_field : uint32_t |
| enum | mln_source_feature_field : uint32_t |
Functions | |
| mln_rendered_feature_query_options | mln_rendered_feature_query_options_default (void) |
| mln_source_feature_query_options | mln_source_feature_query_options_default (void) |
| mln_status | mln_render_session_query_rendered_features (mln_render_session session, const mln_rendered_query_geometry *geometry, const mln_rendered_feature_query_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic) |
| mln_status | mln_render_session_query_source_features (mln_render_session session, mln_buffer_view source_id, const mln_source_feature_query_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic) |
| mln_status | mln_render_session_query_feature_extensions (mln_render_session session, mln_buffer_view source_id, mln_buffer_view feature, mln_buffer_view extension, mln_buffer_view extension_field, const mln_buffer_view *arguments, const mln_completion *completion, mln_diagnostic *out_diagnostic) |
Public C API declarations for feature queries.
Query inputs are copied before return. Caller-driver queries complete only after the host services driver work on the graphics thread. Core-worker queries need no host service.
| typedef struct mln_rendered_feature mln_rendered_feature |
One rendered-feature query hit borrowed for a completion callback.
Every view is valid only for that callback; copy what the host keeps. feature is one UTF-8 GeoJSON Feature, and layer_id is the style layer that rendered it. A feature that several style layers render yields one hit per layer. source_id, source_layer_id, and state are present when the matching field bit is set; a layer without a source, such as a location indicator, has no source_id. state is a UTF-8 JSON object.
| typedef enum mln_rendered_feature_field mln_rendered_feature_field |
Optional fields for mln_rendered_feature.
Optional fields for mln_rendered_feature_query_options.
| typedef struct mln_rendered_feature_query_options mln_rendered_feature_query_options |
Options for rendered feature queries.
| typedef struct mln_rendered_query_geometry mln_rendered_query_geometry |
Rendered feature query geometry descriptor.
| typedef union mln_rendered_query_geometry_data mln_rendered_query_geometry_data |
Screen-space query geometry data.
Rendered feature query geometry variants.
| typedef struct mln_screen_box mln_screen_box |
Screen-space box in logical map pixels.
Corners may be given in any order and may extend past the viewport. Rendered queries normalize the corners and clip the box to the viewport.
| typedef struct mln_screen_line_string mln_screen_line_string |
Screen-space line string in logical map pixels.
| typedef struct mln_source_feature mln_source_feature |
One source-feature query hit borrowed for a completion callback.
Every view is valid only for that callback; copy what the host keeps. feature is one UTF-8 GeoJSON Feature. source_layer_id names the vector source layer the feature came from, and is present when its field bit is set; a source without source layers, such as GeoJSON, has none.
| typedef enum mln_source_feature_field mln_source_feature_field |
Optional fields for mln_source_feature.
Optional fields for mln_source_feature_query_options.
| typedef struct mln_source_feature_query_options mln_source_feature_query_options |
Options for source feature queries.
| enum mln_rendered_feature_field : uint32_t |
Optional fields for mln_rendered_feature.
| enum mln_rendered_feature_query_option_field : uint32_t |
Optional fields for mln_rendered_feature_query_options.
| enum mln_rendered_query_geometry_type : uint32_t |
Rendered feature query geometry variants.
| enum mln_source_feature_field : uint32_t |
Optional fields for mln_source_feature.
| enum mln_source_feature_query_option_field : uint32_t |
Optional fields for mln_source_feature_query_options.
| mln_status mln_render_session_query_feature_extensions | ( | mln_render_session | session, |
| mln_buffer_view | source_id, | ||
| mln_buffer_view | feature, | ||
| mln_buffer_view | extension, | ||
| mln_buffer_view | extension_field, | ||
| const mln_buffer_view * | arguments, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts a feature-extension query against the latest driver state. The completion borrows one mln_buffer_view holding UTF-8 JSON (value_count 1), valid only for the callback.
For the supercluster extension, the feature's cluster_id property and the limit and offset arguments are nonnegative JSON integers, such as 5 rather than 5.0. A feature without such a cluster_id yields an empty result. Leaves use a limit of 10 unless the arguments supply one, and apply an offset only with a limit.
Returns:
Completes with:
| mln_status mln_render_session_query_rendered_features | ( | mln_render_session | session, |
| const mln_rendered_query_geometry * | geometry, | ||
| const mln_rendered_feature_query_options * | options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts a rendered-feature query against the session's latest driver state.
The query reads the last frame that the session rendered, so render after a camera or style change for a result that matches it. The completion borrows value_count mln_rendered_feature values, value_size bytes apart.
Box geometry is normalized and clipped to the viewport, so a box that over-covers the viewport queries everything visible. A box that lies entirely outside the viewport yields an empty result. Point and line-string geometry are queried as given.
Returns:
Completes with:
| mln_status mln_render_session_query_source_features | ( | mln_render_session | session, |
| mln_buffer_view | source_id, | ||
| const mln_source_feature_query_options * | options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts a source-feature query against the session's latest driver state.
The query covers only the tiles that the source loaded for rendering, and a source loads tiles only while a visible layer uses it. The completion borrows value_count mln_source_feature values, value_size bytes apart.
Returns:
Completes with:
| mln_rendered_feature_query_options mln_rendered_feature_query_options_default | ( | void | ) |
Returns default rendered feature query options.
| mln_source_feature_query_options mln_source_feature_query_options_default | ( | void | ) |
Returns default source feature query options.