|
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 uint32_t | mln_rendered_feature_query_option_fields |
| 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 uint32_t | mln_source_feature_query_option_fields |
| typedef struct mln_source_feature_query_options | mln_source_feature_query_options |
| typedef struct mln_rendered_feature | mln_rendered_feature |
| typedef struct mln_source_feature | mln_source_feature |
Enumerations | |
| enum | mln_rendered_query_geometry_type : uint32_t { MLN_RENDERED_QUERY_GEOMETRY_TYPE_POINT = 1 , MLN_RENDERED_QUERY_GEOMETRY_TYPE_BOX = 2 , MLN_RENDERED_QUERY_GEOMETRY_TYPE_LINE_STRING = 3 } |
| enum | mln_rendered_feature_query_option_field : uint32_t { MLN_RENDERED_FEATURE_QUERY_OPTION_LAYER_IDS = 1U << 0U } |
| enum | mln_source_feature_query_option_field : uint32_t { MLN_SOURCE_FEATURE_QUERY_OPTION_SOURCE_LAYER_IDS = 1U << 0U } |
Find the features on the map or in a source.
| typedef struct mln_rendered_feature mln_rendered_feature |
A feature that a rendered feature query found.
The fields that mln_rendered_feature_query_options sets.
| typedef uint32_t mln_rendered_feature_query_option_fields |
A set of mln_rendered_feature_query_option_field bits.
| typedef struct mln_rendered_feature_query_options mln_rendered_feature_query_options |
Options for a rendered feature query.
| typedef struct mln_rendered_query_geometry mln_rendered_query_geometry |
The screen area that a rendered feature query covers.
| typedef union mln_rendered_query_geometry_data mln_rendered_query_geometry_data |
The point, box, or line of a rendered feature query.
The shape of the screen area that a rendered feature query covers.
| typedef struct mln_screen_box mln_screen_box |
A rectangle of the screen, from its min corner to its max corner.
| typedef struct mln_screen_line_string mln_screen_line_string |
A line through points on the screen.
| typedef struct mln_source_feature mln_source_feature |
A feature that a source feature query found.
The fields that mln_source_feature_query_options sets.
| typedef uint32_t mln_source_feature_query_option_fields |
A set of mln_source_feature_query_option_field bits.
| typedef struct mln_source_feature_query_options mln_source_feature_query_options |
Options for a source feature query.
| enum mln_rendered_feature_query_option_field : uint32_t |
The fields that mln_rendered_feature_query_options sets.
| Enumerator | |
|---|---|
| MLN_RENDERED_FEATURE_QUERY_OPTION_LAYER_IDS | |
| enum mln_rendered_query_geometry_type : uint32_t |
| enum mln_source_feature_query_option_field : uint32_t |
The fields that mln_source_feature_query_options sets.
| Enumerator | |
|---|---|
| MLN_SOURCE_FEATURE_QUERY_OPTION_SOURCE_LAYER_IDS | |
| mln_status mln_render_session_get_cluster_children | ( | mln_render_session | session, |
| mln_buffer_view | source_id, | ||
| uint32_t | cluster_id, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Reads the children of a cluster in a clustered GeoJSON source.
cluster_id is the "cluster_id" property of a cluster feature. The result is a GeoJSON feature collection of the clusters and points that the cluster splits into at the next zoom level.
The query reads the source's data from the session's most recent render attempt, so a change to the data shows once the session tries to render again.
A cluster ID belongs to one version of the source's data. After the data changes, feature queries can return IDs from the earlier version until the source's tiles reload, and such an ID completes with MLN_STATUS_NOT_FOUND or names a different cluster. Query the features again for current IDs.
Completes with:
| mln_status mln_render_session_get_cluster_expansion_zoom | ( | mln_render_session | session, |
| mln_buffer_view | source_id, | ||
| uint32_t | cluster_id, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Reads the zoom level at which a cluster of a clustered GeoJSON source splits.
cluster_id is the "cluster_id" property of a cluster feature. At the result's zoom level, the cluster splits into two or more clusters or points.
A cluster ID can go out of date as mln_render_session_get_cluster_children() describes.
Completes with:
| mln_status mln_render_session_get_cluster_leaves | ( | mln_render_session | session, |
| mln_buffer_view | source_id, | ||
| uint32_t | cluster_id, | ||
| uint32_t | limit, | ||
| uint32_t | offset, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Reads the points in a cluster of a clustered GeoJSON source.
cluster_id is the "cluster_id" property of a cluster feature. The result is a GeoJSON feature collection of the original point features. It skips the first offset points and then holds up to limit of them, so a limit of 0 gives an empty collection.
A cluster ID can go out of date as mln_render_session_get_cluster_children() describes.
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 ) |
Finds the features that the session drew in an area of the screen.
The query reads the last frame that the session rendered. A feature that several layers draw appears once for each layer.
| 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 ) |
Finds the features of the source named source_id.
The query covers only the tiles that the source has loaded for the current view. A source loads tiles only while a visible layer uses it.