C API
API Reference
Section titled “API Reference”| Name | Description |
|---|---|
mln_vec3 | Three-component vector used by free camera options. |
mln_feature | GeoJSON feature input descriptor graph. |
mln_geojson | GeoJSON geometry, feature, or feature collection input descriptor graph. Nested geometry and property descriptors share the 64-depth descriptor limit documented on mln_geometry and mln_json_value. |
mln_geometry | MapLibre geometry input descriptor graph. |
mln_lat_lng | Geographic coordinate in degrees used by map and projection APIs. |
mln_tile_id | Overscaled tile identity reported in tile observer events. |
mln_quaternion | Quaternion stored as x, y, z, w components. |
mln_json_array | JSON value array view. |
mln_json_value | JSON-like value input descriptor graph used by feature properties/states. |
mln_screen_box | Screen-space box in logical map pixels. |
mln_edge_insets | Screen-space inset in logical map pixels. |
mln_json_member | JSON object member view. |
mln_json_object | JSON object member array view. |
mln_map_options | Options used when creating a map. |
mln_string_view | UTF-8 text view. The pointer may be null only when size is 0. |
mln_unit_bezier | Cubic easing curve for animated camera transitions. |
mln_screen_point | Screen-space point in logical map pixels. |
mln_bound_options | Optional map camera constraint fields. |
mln_runtime_event | Event payload returned by mln_runtime_poll_event(). |
mln_camera_options | Camera fields used for snapshots and camera commands. |
mln_coordinate_span | Coordinate array view. Coordinates are latitude/longitude pairs. |
mln_lat_lng_bounds | Geographic bounds in degrees. |
mln_projection_mode | MapLibre axonometric rendering options used for snapshots and commands. |
mln_queried_feature | One copied query result feature. |
mln_rendering_stats | Rendering statistics reported in MLN_RUNTIME_EVENT_PAYLOAD_RENDER_FRAME. |
mln_runtime_options | |
mln_polygon_geometry | Polygon ring array view. Each ring is a coordinate span. |
mln_projected_meters | Lower-level Spherical Mercator projected-meter coordinate. |
mln_resource_request | |
mln_animation_options | Optional animation controls for camera transitions. |
mln_map_tile_options | Tile prefetch and LOD tuning controls. |
mln_resource_provider | |
mln_resource_response | |
mln_style_image_info | Fixed metadata for one runtime style image. |
mln_canonical_tile_id | Canonical tile identity used by custom geometry source callbacks. |
mln_feature_collection | Feature collection view. |
mln_resource_transform | |
mln_style_source_info | Fixed source metadata returned by mln_map_get_style_source_info(). |
mln_camera_fit_options | Optional fitting controls for camera-for-viewport queries. |
mln_geometry_collection | Geometry collection view. |
mln_screen_line_string | Screen-space line string in logical map pixels. |
mln_texture_image_info | CPU image readback metadata for a texture session frame. |
mln_free_camera_options | Free camera position and orientation in MapLibre Native camera space. |
mln_multi_line_geometry | Multi-line geometry view. Each line is a coordinate span. |
mln_offline_region_info | Region data view returned from a snapshot or list handle. |
mln_style_image_options | Options for runtime style images. |
mln_map_viewport_options | Live map viewport and render-transform controls. |
mln_offline_region_status | Offline region status snapshot. |
mln_feature_state_selector | Feature-state source, feature, and key selector. |
mln_multi_polygon_geometry | Multi-polygon geometry view. Each polygon contains ring views. |
mln_rendered_query_geometry | Rendered feature query geometry descriptor. |
mln_metal_surface_descriptor | Metal native surface session attachment options. |
mln_owned_texture_descriptor | Default texture session attachment options for a session-owned target. |
mln_offline_region_definition | Tagged offline region definition. |
mln_premultiplied_rgba8_image | Caller-owned premultiplied RGBA8 image pixels. |
mln_runtime_event_render_map | Payload for MLN_RUNTIME_EVENT_MAP_RENDER_MAP_FINISHED. |
mln_vulkan_surface_descriptor | Vulkan native surface session attachment options. |
mln_metal_owned_texture_frame | Metal frame acquired from a session-owned texture target. |
mln_runtime_event_tile_action | Payload for MLN_RUNTIME_EVENT_MAP_TILE_ACTION. |
mln_style_tile_source_options | Options for vector and raster tile sources. |
mln_resource_transform_response | |
mln_runtime_event_render_frame | Payload for MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_FINISHED. |
mln_vulkan_owned_texture_frame | Vulkan frame acquired from a session-owned texture target. |
mln_source_feature_query_options | Options for source feature queries. |
mln_feature_extension_result_info | Tagged feature extension query result view. |
mln_custom_geometry_source_options | Options for custom geometry sources. |
mln_metal_owned_texture_descriptor | Metal texture session attachment options for a session-owned target. |
mln_rendered_feature_query_options | Options for rendered feature queries. |
mln_vulkan_owned_texture_descriptor | Vulkan texture session attachment options for a session-owned target. |
mln_metal_borrowed_texture_descriptor | Metal caller-owned texture session attachment options. |
mln_offline_geometry_region_definition | Geometry offline region definition. |
mln_runtime_event_style_image_missing | Payload for MLN_RUNTIME_EVENT_MAP_STYLE_IMAGE_MISSING. |
mln_vulkan_borrowed_texture_descriptor | Vulkan caller-owned texture session attachment options. |
mln_runtime_event_offline_region_status | Payload for MLN_RUNTIME_EVENT_OFFLINE_REGION_STATUS_CHANGED. |
mln_offline_tile_pyramid_region_definition | Tile-pyramid offline region definition. |
mln_runtime_event_offline_region_response_error | Payload for MLN_RUNTIME_EVENT_OFFLINE_REGION_RESPONSE_ERROR. |
mln_runtime_event_offline_region_tile_count_limit | Payload for MLN_RUNTIME_EVENT_OFFLINE_REGION_TILE_COUNT_LIMIT_EXCEEDED. |
Enumerations
Section titled “Enumerations”mln_camera_option_field
Section titled “mln_camera_option_field”enum mln_camera_option_field| Value | Description |
|---|---|
MLN_CAMERA_OPTION_CENTER | |
MLN_CAMERA_OPTION_ZOOM | |
MLN_CAMERA_OPTION_BEARING | |
MLN_CAMERA_OPTION_PITCH | |
MLN_CAMERA_OPTION_CENTER_ALTITUDE | |
MLN_CAMERA_OPTION_PADDING | |
MLN_CAMERA_OPTION_ANCHOR | |
MLN_CAMERA_OPTION_ROLL | |
MLN_CAMERA_OPTION_FOV |
Field mask values for mln_camera_options.
mln_animation_option_field
Section titled “mln_animation_option_field”enum mln_animation_option_field| Value | Description |
|---|---|
MLN_ANIMATION_OPTION_DURATION | |
MLN_ANIMATION_OPTION_VELOCITY | |
MLN_ANIMATION_OPTION_MIN_ZOOM | |
MLN_ANIMATION_OPTION_EASING |
Field mask values for mln_animation_options.
mln_camera_fit_option_field
Section titled “mln_camera_fit_option_field”enum mln_camera_fit_option_field| Value | Description |
|---|---|
MLN_CAMERA_FIT_OPTION_PADDING | |
MLN_CAMERA_FIT_OPTION_BEARING | |
MLN_CAMERA_FIT_OPTION_PITCH |
Field mask values for mln_camera_fit_options.
mln_bound_option_field
Section titled “mln_bound_option_field”enum mln_bound_option_field| Value | Description |
|---|---|
MLN_BOUND_OPTION_BOUNDS | |
MLN_BOUND_OPTION_MIN_ZOOM | |
MLN_BOUND_OPTION_MAX_ZOOM | |
MLN_BOUND_OPTION_MIN_PITCH | |
MLN_BOUND_OPTION_MAX_PITCH |
Field mask values for mln_bound_options.
mln_free_camera_option_field
Section titled “mln_free_camera_option_field”enum mln_free_camera_option_field| Value | Description |
|---|---|
MLN_FREE_CAMERA_OPTION_POSITION | |
MLN_FREE_CAMERA_OPTION_ORIENTATION |
Field mask values for mln_free_camera_options.
mln_projection_mode_field
Section titled “mln_projection_mode_field”enum mln_projection_mode_field| Value | Description |
|---|---|
MLN_PROJECTION_MODE_AXONOMETRIC | |
MLN_PROJECTION_MODE_X_SKEW | |
MLN_PROJECTION_MODE_Y_SKEW |
Field mask values for MapLibre axonometric rendering options.
mln_map_debug_option
Section titled “mln_map_debug_option”enum mln_map_debug_option| Value | Description |
|---|---|
MLN_MAP_DEBUG_TILE_BORDERS | |
MLN_MAP_DEBUG_PARSE_STATUS | |
MLN_MAP_DEBUG_TIMESTAMPS | |
MLN_MAP_DEBUG_COLLISION | |
MLN_MAP_DEBUG_OVERDRAW | |
MLN_MAP_DEBUG_STENCIL_CLIP | |
MLN_MAP_DEBUG_DEPTH_BUFFER |
Debug overlay mask values for mln_map_set_debug_options().
mln_north_orientation
Section titled “mln_north_orientation”enum mln_north_orientation| Value | Description |
|---|---|
MLN_NORTH_ORIENTATION_UP | |
MLN_NORTH_ORIENTATION_RIGHT | |
MLN_NORTH_ORIENTATION_DOWN | |
MLN_NORTH_ORIENTATION_LEFT |
Map north orientation values used by mln_map_viewport_options.
mln_constrain_mode
Section titled “mln_constrain_mode”enum mln_constrain_mode| Value | Description |
|---|---|
MLN_CONSTRAIN_MODE_NONE | |
MLN_CONSTRAIN_MODE_HEIGHT_ONLY | |
MLN_CONSTRAIN_MODE_WIDTH_AND_HEIGHT | |
MLN_CONSTRAIN_MODE_SCREEN |
Map constraint modes used by mln_map_viewport_options.
mln_viewport_mode
Section titled “mln_viewport_mode”enum mln_viewport_mode| Value | Description |
|---|---|
MLN_VIEWPORT_MODE_DEFAULT | |
MLN_VIEWPORT_MODE_FLIPPED_Y |
Viewport orientation modes used by mln_map_viewport_options.
mln_map_viewport_option_field
Section titled “mln_map_viewport_option_field”enum mln_map_viewport_option_field| Value | Description |
|---|---|
MLN_MAP_VIEWPORT_OPTION_NORTH_ORIENTATION | |
MLN_MAP_VIEWPORT_OPTION_CONSTRAIN_MODE | |
MLN_MAP_VIEWPORT_OPTION_VIEWPORT_MODE | |
MLN_MAP_VIEWPORT_OPTION_FRUSTUM_OFFSET |
Field mask values for mln_map_viewport_options.
mln_tile_lod_mode
Section titled “mln_tile_lod_mode”enum mln_tile_lod_mode| Value | Description |
|---|---|
MLN_TILE_LOD_MODE_DEFAULT | |
MLN_TILE_LOD_MODE_DISTANCE |
Tile LOD algorithms used by mln_map_tile_options.
mln_map_tile_option_field
Section titled “mln_map_tile_option_field”enum mln_map_tile_option_field| Value | Description |
|---|---|
MLN_MAP_TILE_OPTION_PREFETCH_ZOOM_DELTA | |
MLN_MAP_TILE_OPTION_LOD_MIN_RADIUS | |
MLN_MAP_TILE_OPTION_LOD_SCALE | |
MLN_MAP_TILE_OPTION_LOD_PITCH_THRESHOLD | |
MLN_MAP_TILE_OPTION_LOD_ZOOM_SHIFT | |
MLN_MAP_TILE_OPTION_LOD_MODE |
Field mask values for mln_map_tile_options.
mln_map_mode
Section titled “mln_map_mode”enum mln_map_mode| Value | Description |
|---|---|
MLN_MAP_MODE_CONTINUOUS | Continuously updates as data arrives and map state changes. |
MLN_MAP_MODE_STATIC | Produces one-off still images of an arbitrary viewport. |
MLN_MAP_MODE_TILE | Produces one-off still images for a single tile. |
Map rendering modes used when creating a map.
mln_geometry_type
Section titled “mln_geometry_type”enum mln_geometry_type| Value | Description |
|---|---|
MLN_GEOMETRY_TYPE_EMPTY | |
MLN_GEOMETRY_TYPE_POINT | |
MLN_GEOMETRY_TYPE_LINE_STRING | |
MLN_GEOMETRY_TYPE_POLYGON | |
MLN_GEOMETRY_TYPE_MULTI_POINT | |
MLN_GEOMETRY_TYPE_MULTI_LINE_STRING | |
MLN_GEOMETRY_TYPE_MULTI_POLYGON | |
MLN_GEOMETRY_TYPE_GEOMETRY_COLLECTION |
Geometry variant tags used by mln_geometry.
mln_json_value_type
Section titled “mln_json_value_type”enum mln_json_value_type| Value | Description |
|---|---|
MLN_JSON_VALUE_TYPE_NULL | |
MLN_JSON_VALUE_TYPE_BOOL | |
MLN_JSON_VALUE_TYPE_UINT | |
MLN_JSON_VALUE_TYPE_INT | |
MLN_JSON_VALUE_TYPE_DOUBLE | |
MLN_JSON_VALUE_TYPE_STRING | |
MLN_JSON_VALUE_TYPE_ARRAY | |
MLN_JSON_VALUE_TYPE_OBJECT |
JSON-like value variant tags used by mln_json_value.
mln_feature_state_selector_field
Section titled “mln_feature_state_selector_field”enum mln_feature_state_selector_field| Value | Description |
|---|---|
MLN_FEATURE_STATE_SELECTOR_SOURCE_LAYER_ID | |
MLN_FEATURE_STATE_SELECTOR_FEATURE_ID | |
MLN_FEATURE_STATE_SELECTOR_STATE_KEY |
Optional fields for mln_feature_state_selector.
mln_feature_identifier_type
Section titled “mln_feature_identifier_type”enum mln_feature_identifier_type| Value | Description |
|---|---|
MLN_FEATURE_IDENTIFIER_TYPE_NULL | |
MLN_FEATURE_IDENTIFIER_TYPE_UINT | |
MLN_FEATURE_IDENTIFIER_TYPE_INT | |
MLN_FEATURE_IDENTIFIER_TYPE_DOUBLE | |
MLN_FEATURE_IDENTIFIER_TYPE_STRING |
Feature identifier variant tags used by mln_feature.
mln_geojson_type
Section titled “mln_geojson_type”enum mln_geojson_type| Value | Description |
|---|---|
MLN_GEOJSON_TYPE_GEOMETRY | |
MLN_GEOJSON_TYPE_FEATURE | |
MLN_GEOJSON_TYPE_FEATURE_COLLECTION |
GeoJSON variant tags used by mln_geojson.
mln_status
Section titled “mln_status”enum mln_status| Value | Description |
|---|---|
MLN_STATUS_OK | |
MLN_STATUS_INVALID_ARGUMENT | A pointer, size field, mask, or handle argument was invalid. |
MLN_STATUS_INVALID_STATE | The object is valid but not currently in a state that permits the call. |
MLN_STATUS_WRONG_THREAD | The handle is thread-affine and the call was made from the wrong thread. |
MLN_STATUS_UNSUPPORTED | The entry point or requested behavior is unavailable in this build. |
MLN_STATUS_NATIVE_ERROR | A native MapLibre error or C++ exception was converted to status. |
Status values returned by status-returning functions.
mln_render_backend_flag
Section titled “mln_render_backend_flag”enum mln_render_backend_flag| Value | Description |
|---|---|
MLN_RENDER_BACKEND_FLAG_METAL | |
MLN_RENDER_BACKEND_FLAG_VULKAN |
Render backend support flags reported by this native library build.
mln_rendered_query_geometry_type
Section titled “mln_rendered_query_geometry_type”enum mln_rendered_query_geometry_type| Value | Description |
|---|---|
MLN_RENDERED_QUERY_GEOMETRY_TYPE_POINT | |
MLN_RENDERED_QUERY_GEOMETRY_TYPE_BOX | |
MLN_RENDERED_QUERY_GEOMETRY_TYPE_LINE_STRING |
Rendered feature query geometry variants.
mln_rendered_feature_query_option_field
Section titled “mln_rendered_feature_query_option_field”enum mln_rendered_feature_query_option_field| Value | Description |
|---|---|
MLN_RENDERED_FEATURE_QUERY_OPTION_LAYER_IDS |
Optional fields for mln_rendered_feature_query_options.
mln_source_feature_query_option_field
Section titled “mln_source_feature_query_option_field”enum mln_source_feature_query_option_field| Value | Description |
|---|---|
MLN_SOURCE_FEATURE_QUERY_OPTION_SOURCE_LAYER_IDS |
Optional fields for mln_source_feature_query_options.
mln_queried_feature_field
Section titled “mln_queried_feature_field”enum mln_queried_feature_field| Value | Description |
|---|---|
MLN_QUERIED_FEATURE_SOURCE_ID | |
MLN_QUERIED_FEATURE_SOURCE_LAYER_ID | |
MLN_QUERIED_FEATURE_STATE |
Optional fields returned by mln_queried_feature.
mln_feature_extension_result_type
Section titled “mln_feature_extension_result_type”enum mln_feature_extension_result_type| Value | Description |
|---|---|
MLN_FEATURE_EXTENSION_RESULT_TYPE_VALUE | |
MLN_FEATURE_EXTENSION_RESULT_TYPE_FEATURE_COLLECTION |
Feature extension query result variants.
mln_style_source_type
Section titled “mln_style_source_type”enum mln_style_source_type| Value | Description |
|---|---|
MLN_STYLE_SOURCE_TYPE_UNKNOWN | |
MLN_STYLE_SOURCE_TYPE_VECTOR | |
MLN_STYLE_SOURCE_TYPE_RASTER | |
MLN_STYLE_SOURCE_TYPE_RASTER_DEM | |
MLN_STYLE_SOURCE_TYPE_GEOJSON | |
MLN_STYLE_SOURCE_TYPE_IMAGE | |
MLN_STYLE_SOURCE_TYPE_VIDEO | |
MLN_STYLE_SOURCE_TYPE_ANNOTATIONS | |
MLN_STYLE_SOURCE_TYPE_CUSTOM_VECTOR |
Style source type values returned by mln_map_get_style_source_type().
mln_style_tile_source_option_field
Section titled “mln_style_tile_source_option_field”enum mln_style_tile_source_option_field| Value | Description |
|---|---|
MLN_STYLE_TILE_SOURCE_OPTION_MIN_ZOOM | |
MLN_STYLE_TILE_SOURCE_OPTION_MAX_ZOOM | |
MLN_STYLE_TILE_SOURCE_OPTION_ATTRIBUTION | |
MLN_STYLE_TILE_SOURCE_OPTION_SCHEME | |
MLN_STYLE_TILE_SOURCE_OPTION_BOUNDS | |
MLN_STYLE_TILE_SOURCE_OPTION_TILE_SIZE | |
MLN_STYLE_TILE_SOURCE_OPTION_VECTOR_ENCODING | |
MLN_STYLE_TILE_SOURCE_OPTION_RASTER_ENCODING |
Field mask values for mln_style_tile_source_options.
mln_style_tile_scheme
Section titled “mln_style_tile_scheme”enum mln_style_tile_scheme| Value | Description |
|---|---|
MLN_STYLE_TILE_SCHEME_XYZ | |
MLN_STYLE_TILE_SCHEME_TMS |
Tile URL coordinate scheme values used by mln_style_tile_source_options.
mln_style_vector_tile_encoding
Section titled “mln_style_vector_tile_encoding”enum mln_style_vector_tile_encoding| Value | Description |
|---|---|
MLN_STYLE_VECTOR_TILE_ENCODING_MVT | |
MLN_STYLE_VECTOR_TILE_ENCODING_MLT |
Vector tile encoding values used by mln_style_tile_source_options.
mln_style_raster_dem_encoding
Section titled “mln_style_raster_dem_encoding”enum mln_style_raster_dem_encoding| Value | Description |
|---|---|
MLN_STYLE_RASTER_DEM_ENCODING_MAPBOX | |
MLN_STYLE_RASTER_DEM_ENCODING_TERRARIUM |
DEM raster encoding values used by mln_style_tile_source_options.
mln_custom_geometry_source_option_field
Section titled “mln_custom_geometry_source_option_field”enum mln_custom_geometry_source_option_field| Value | Description |
|---|---|
MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_MIN_ZOOM | |
MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_MAX_ZOOM | |
MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_TOLERANCE | |
MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_TILE_SIZE | |
MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_BUFFER | |
MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_CLIP | |
MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_WRAP |
Field mask values for mln_custom_geometry_source_options.
mln_style_image_option_field
Section titled “mln_style_image_option_field”enum mln_style_image_option_field| Value | Description |
|---|---|
MLN_STYLE_IMAGE_OPTION_PIXEL_RATIO | |
MLN_STYLE_IMAGE_OPTION_SDF |
Field mask values for mln_style_image_options.
mln_location_indicator_image_kind
Section titled “mln_location_indicator_image_kind”enum mln_location_indicator_image_kind| Value | Description |
|---|---|
MLN_LOCATION_INDICATOR_IMAGE_KIND_TOP | |
MLN_LOCATION_INDICATOR_IMAGE_KIND_BEARING | |
MLN_LOCATION_INDICATOR_IMAGE_KIND_SHADOW |
Location indicator image-name properties.
mln_log_severity
Section titled “mln_log_severity”enum mln_log_severity| Value | Description |
|---|---|
MLN_LOG_SEVERITY_INFO | |
MLN_LOG_SEVERITY_WARNING | |
MLN_LOG_SEVERITY_ERROR |
Log severity values emitted by MapLibre Native.
mln_log_severity_mask
Section titled “mln_log_severity_mask”enum mln_log_severity_mask| Value | Description |
|---|---|
MLN_LOG_SEVERITY_MASK_INFO | |
MLN_LOG_SEVERITY_MASK_WARNING | |
MLN_LOG_SEVERITY_MASK_ERROR | |
MLN_LOG_SEVERITY_MASK_DEFAULT | |
MLN_LOG_SEVERITY_MASK_ALL |
Bitmask values for log severities dispatched asynchronously.
mln_log_event
Section titled “mln_log_event”enum mln_log_event| Value | Description |
|---|---|
MLN_LOG_EVENT_GENERAL | |
MLN_LOG_EVENT_SETUP | |
MLN_LOG_EVENT_SHADER | |
MLN_LOG_EVENT_PARSE_STYLE | |
MLN_LOG_EVENT_PARSE_TILE | |
MLN_LOG_EVENT_RENDER | |
MLN_LOG_EVENT_STYLE | |
MLN_LOG_EVENT_DATABASE | |
MLN_LOG_EVENT_HTTP_REQUEST | |
MLN_LOG_EVENT_SPRITE | |
MLN_LOG_EVENT_IMAGE | |
MLN_LOG_EVENT_OPENGL | |
MLN_LOG_EVENT_JNI | |
MLN_LOG_EVENT_ANDROID | |
MLN_LOG_EVENT_CRASH | |
MLN_LOG_EVENT_GLYPH | |
MLN_LOG_EVENT_TIMING |
Log event categories emitted by MapLibre Native.
mln_network_status
Section titled “mln_network_status”enum mln_network_status| Value | Description |
|---|---|
MLN_NETWORK_STATUS_ONLINE | |
MLN_NETWORK_STATUS_OFFLINE |
mln_runtime_option_flag
Section titled “mln_runtime_option_flag”enum mln_runtime_option_flag| Value | Description |
|---|---|
MLN_RUNTIME_OPTION_MAXIMUM_CACHE_SIZE |
mln_ambient_cache_operation
Section titled “mln_ambient_cache_operation”enum mln_ambient_cache_operation| Value | Description |
|---|---|
MLN_AMBIENT_CACHE_OPERATION_RESET_DATABASE | |
MLN_AMBIENT_CACHE_OPERATION_PACK_DATABASE | |
MLN_AMBIENT_CACHE_OPERATION_INVALIDATE | |
MLN_AMBIENT_CACHE_OPERATION_CLEAR |
mln_offline_region_definition_type
Section titled “mln_offline_region_definition_type”enum mln_offline_region_definition_type| Value | Description |
|---|---|
MLN_OFFLINE_REGION_DEFINITION_TILE_PYRAMID | |
MLN_OFFLINE_REGION_DEFINITION_GEOMETRY |
mln_offline_region_download_state
Section titled “mln_offline_region_download_state”enum mln_offline_region_download_state| Value | Description |
|---|---|
MLN_OFFLINE_REGION_DOWNLOAD_INACTIVE | |
MLN_OFFLINE_REGION_DOWNLOAD_ACTIVE |
mln_runtime_event_type
Section titled “mln_runtime_event_type”enum mln_runtime_event_type| Value | Description |
|---|---|
MLN_RUNTIME_EVENT_MAP_CAMERA_WILL_CHANGE | |
MLN_RUNTIME_EVENT_MAP_CAMERA_IS_CHANGING | |
MLN_RUNTIME_EVENT_MAP_CAMERA_DID_CHANGE | |
MLN_RUNTIME_EVENT_MAP_STYLE_LOADED | |
MLN_RUNTIME_EVENT_MAP_LOADING_STARTED | |
MLN_RUNTIME_EVENT_MAP_LOADING_FINISHED | |
MLN_RUNTIME_EVENT_MAP_LOADING_FAILED | |
MLN_RUNTIME_EVENT_MAP_IDLE | |
MLN_RUNTIME_EVENT_MAP_RENDER_UPDATE_AVAILABLE | |
MLN_RUNTIME_EVENT_MAP_RENDER_ERROR | |
MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FINISHED | |
MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FAILED | |
MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_STARTED | |
MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_FINISHED | |
MLN_RUNTIME_EVENT_MAP_RENDER_MAP_STARTED | |
MLN_RUNTIME_EVENT_MAP_RENDER_MAP_FINISHED | |
MLN_RUNTIME_EVENT_MAP_STYLE_IMAGE_MISSING | |
MLN_RUNTIME_EVENT_MAP_TILE_ACTION | |
MLN_RUNTIME_EVENT_OFFLINE_REGION_STATUS_CHANGED | |
MLN_RUNTIME_EVENT_OFFLINE_REGION_RESPONSE_ERROR | |
MLN_RUNTIME_EVENT_OFFLINE_REGION_TILE_COUNT_LIMIT_EXCEEDED |
Runtime event types returned by mln_runtime_poll_event().
mln_runtime_event_source_type
Section titled “mln_runtime_event_source_type”enum mln_runtime_event_source_type| Value | Description |
|---|---|
MLN_RUNTIME_EVENT_SOURCE_RUNTIME | |
MLN_RUNTIME_EVENT_SOURCE_MAP |
Source kinds used by mln_runtime_event.source_type.
mln_runtime_event_payload_type
Section titled “mln_runtime_event_payload_type”enum mln_runtime_event_payload_type| Value | Description |
|---|---|
MLN_RUNTIME_EVENT_PAYLOAD_NONE | |
MLN_RUNTIME_EVENT_PAYLOAD_RENDER_FRAME | |
MLN_RUNTIME_EVENT_PAYLOAD_RENDER_MAP | |
MLN_RUNTIME_EVENT_PAYLOAD_STYLE_IMAGE_MISSING | |
MLN_RUNTIME_EVENT_PAYLOAD_TILE_ACTION | |
MLN_RUNTIME_EVENT_PAYLOAD_OFFLINE_REGION_STATUS | |
MLN_RUNTIME_EVENT_PAYLOAD_OFFLINE_REGION_RESPONSE_ERROR | |
MLN_RUNTIME_EVENT_PAYLOAD_OFFLINE_REGION_TILE_COUNT_LIMIT |
Payload kinds used by mln_runtime_event.payload_type.
mln_render_mode
Section titled “mln_render_mode”enum mln_render_mode| Value | Description |
|---|---|
MLN_RENDER_MODE_PARTIAL | |
MLN_RENDER_MODE_FULL |
Render modes reported by render observer events.
mln_tile_operation
Section titled “mln_tile_operation”enum mln_tile_operation| Value | Description |
|---|---|
MLN_TILE_OPERATION_REQUESTED_FROM_CACHE | |
MLN_TILE_OPERATION_REQUESTED_FROM_NETWORK | |
MLN_TILE_OPERATION_LOAD_FROM_NETWORK | |
MLN_TILE_OPERATION_LOAD_FROM_CACHE | |
MLN_TILE_OPERATION_START_PARSE | |
MLN_TILE_OPERATION_END_PARSE | |
MLN_TILE_OPERATION_ERROR | |
MLN_TILE_OPERATION_CANCELLED | |
MLN_TILE_OPERATION_NULL |
Tile operations reported by tile observer events.
mln_resource_kind
Section titled “mln_resource_kind”enum mln_resource_kind| Value | Description |
|---|---|
MLN_RESOURCE_KIND_UNKNOWN | |
MLN_RESOURCE_KIND_STYLE | |
MLN_RESOURCE_KIND_SOURCE | |
MLN_RESOURCE_KIND_TILE | |
MLN_RESOURCE_KIND_GLYPHS | |
MLN_RESOURCE_KIND_SPRITE_IMAGE | |
MLN_RESOURCE_KIND_SPRITE_JSON | |
MLN_RESOURCE_KIND_IMAGE |
mln_resource_loading_method
Section titled “mln_resource_loading_method”enum mln_resource_loading_method| Value | Description |
|---|---|
MLN_RESOURCE_LOADING_METHOD_ALL | |
MLN_RESOURCE_LOADING_METHOD_CACHE_ONLY | |
MLN_RESOURCE_LOADING_METHOD_NETWORK_ONLY |
mln_resource_priority
Section titled “mln_resource_priority”enum mln_resource_priority| Value | Description |
|---|---|
MLN_RESOURCE_PRIORITY_REGULAR | |
MLN_RESOURCE_PRIORITY_LOW |
mln_resource_usage
Section titled “mln_resource_usage”enum mln_resource_usage| Value | Description |
|---|---|
MLN_RESOURCE_USAGE_ONLINE | |
MLN_RESOURCE_USAGE_OFFLINE |
mln_resource_storage_policy
Section titled “mln_resource_storage_policy”enum mln_resource_storage_policy| Value | Description |
|---|---|
MLN_RESOURCE_STORAGE_POLICY_PERMANENT | |
MLN_RESOURCE_STORAGE_POLICY_VOLATILE |
mln_resource_response_status
Section titled “mln_resource_response_status”enum mln_resource_response_status| Value | Description |
|---|---|
MLN_RESOURCE_RESPONSE_STATUS_OK | |
MLN_RESOURCE_RESPONSE_STATUS_ERROR | |
MLN_RESOURCE_RESPONSE_STATUS_NO_CONTENT | |
MLN_RESOURCE_RESPONSE_STATUS_NOT_MODIFIED |
mln_resource_error_reason
Section titled “mln_resource_error_reason”enum mln_resource_error_reason| Value | Description |
|---|---|
MLN_RESOURCE_ERROR_REASON_NONE | |
MLN_RESOURCE_ERROR_REASON_NOT_FOUND | |
MLN_RESOURCE_ERROR_REASON_SERVER | |
MLN_RESOURCE_ERROR_REASON_CONNECTION | |
MLN_RESOURCE_ERROR_REASON_RATE_LIMIT | |
MLN_RESOURCE_ERROR_REASON_OTHER |
mln_resource_provider_decision
Section titled “mln_resource_provider_decision”enum mln_resource_provider_decision| Value | Description |
|---|---|
MLN_RESOURCE_PROVIDER_DECISION_PASS_THROUGH | |
MLN_RESOURCE_PROVIDER_DECISION_HANDLE |
Typedefs
Section titled “Typedefs”mln_runtime
Section titled “mln_runtime”struct mln_runtime mln_runtime()mln_map
Section titled “mln_map”struct mln_map mln_map()mln_map_projection
Section titled “mln_map_projection”struct mln_map_projection mln_map_projection()mln_offline_region_snapshot
Section titled “mln_offline_region_snapshot”struct mln_offline_region_snapshot mln_offline_region_snapshot()mln_offline_region_list
Section titled “mln_offline_region_list”struct mln_offline_region_list mln_offline_region_list()mln_json_snapshot
Section titled “mln_json_snapshot”struct mln_json_snapshot mln_json_snapshot()mln_resource_request_handle
Section titled “mln_resource_request_handle”struct mln_resource_request_handle mln_resource_request_handle()mln_render_session
Section titled “mln_render_session”struct mln_render_session mln_render_session()mln_feature_query_result
Section titled “mln_feature_query_result”struct mln_feature_query_result mln_feature_query_result()mln_feature_extension_result
Section titled “mln_feature_extension_result”struct mln_feature_extension_result mln_feature_extension_result()mln_style_id_list
Section titled “mln_style_id_list”struct mln_style_id_list mln_style_id_list()mln_custom_geometry_source_tile_callback
Section titled “mln_custom_geometry_source_tile_callback”void(* mln_custom_geometry_source_tile_callback()Callback invoked for custom geometry source tile requests and cancels.
mln_log_callback
Section titled “mln_log_callback”uint32_t(* mln_log_callback()Receives a MapLibre Native log record.
The message pointer is borrowed for the callback duration. Returning non-zero consumes the record. Returning zero lets MapLibre Native’s platform logger handle it.
mln_offline_region_id
Section titled “mln_offline_region_id”int64_t mln_offline_region_id()mln_resource_transform_callback
Section titled “mln_resource_transform_callback”mln_status(* mln_resource_transform_callback()Rewrites a network resource URL.
This callback can only replace the request URL. It cannot mutate headers, bodies, cache policy, or convert a request into an error.
Callback invocations follow these rules:
-
MapLibre may invoke the callback on a worker or network thread instead of the runtime owner thread.
-
The callback must be thread-safe, return quickly, and must not call this C API.
-
url and out_response are borrowed for the callback duration.
-
The C API copies out_response->url before the callback returns when a replacement URL is set.
-
A non-OK return status is treated as no rewrite and does not fail the resource request.
-
The callback and user_data must remain valid until no live maps or in-flight requests can invoke the transform, normally until runtime teardown.
mln_resource_provider_callback
Section titled “mln_resource_provider_callback”uint32_t(* mln_resource_provider_callback()Intercepts a network resource request.
The callback runs synchronously on the thread that reaches the C API network file source. That thread may be a MapLibre worker or network thread instead of the runtime owner thread.
Request handling follows these rules:
-
request and its pointed-to fields are borrowed for the callback duration.
-
MLN_RESOURCE_PROVIDER_DECISION_PASS_THROUGH lets native OnlineFileSource handle the request.
-
After returning PASS_THROUGH, the provider must not retain, complete, or release the handle.
-
MLN_RESOURCE_PROVIDER_DECISION_HANDLE lets the provider complete the request through the handle inline or later.
-
Unknown decision values produce a provider error response. The C API releases the provided handle and does not pass the request through.
-
The C API copies completion data, and mln_resource_request_complete() may be called from any thread.
-
Providers must release handled request handles after they no longer need to complete or observe cancellation.
-
The callback must be thread-safe, return quickly, and must not call map or runtime C API functions.
-
The callback may call resource request handle functions for the provided handle.
Functions
Section titled “Functions”mln_runtime_offline_region_create
Section titled “mln_runtime_offline_region_create”mln_status mln_runtime_offline_region_create(mln_runtime * runtime, const mln_offline_region_definition * definition, const uint8_t * metadata, size_t metadata_size, mln_offline_region_snapshot ** out_region)Creates a tile-pyramid offline region.
The returned snapshot owns copied region data. Destroy it with mln_offline_region_snapshot_destroy(). Input strings, geometry descriptors, and metadata are borrowed for the duration of this call and are not retained.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, definition is null or invalid, metadata is null with a non-zero size, out_region is null, or *out_region is not null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_region_get
Section titled “mln_runtime_offline_region_get”mln_status mln_runtime_offline_region_get(mln_runtime * runtime, mln_offline_region_id region_id, mln_offline_region_snapshot ** out_region, bool * out_found)Gets an offline region snapshot by ID.
On success, out_found indicates whether the region exists. When out_found is false, *out_region remains null.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, out_region is null, *out_region is not null, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_regions_list
Section titled “mln_runtime_offline_regions_list”mln_status mln_runtime_offline_regions_list(mln_runtime * runtime, mln_offline_region_list ** out_regions)Lists offline region snapshots in the runtime database.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, out_regions is null, or *out_regions is not null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_regions_merge_database
Section titled “mln_runtime_offline_regions_merge_database”mln_status mln_runtime_offline_regions_merge_database(mln_runtime * runtime, const char * side_database_path, mln_offline_region_list ** out_regions)Merges offline regions from another database path.
The returned list owns the exact region list reported by MapLibre Native’s merge callback. The side database may be upgraded in place by native code and must be writable when native merge requires it.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, side_database_path is null, out_regions is null, or *out_regions is not null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_region_update_metadata
Section titled “mln_runtime_offline_region_update_metadata”mln_status mln_runtime_offline_region_update_metadata(mln_runtime * runtime, mln_offline_region_id region_id, const uint8_t * metadata, size_t metadata_size, mln_offline_region_snapshot ** out_region)Updates opaque binary metadata for an offline region.
The returned snapshot contains the updated metadata.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, metadata is null with a non-zero size, out_region is null, *out_region is not null, or no region exists for id.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_region_get_status
Section titled “mln_runtime_offline_region_get_status”mln_status mln_runtime_offline_region_get_status(mln_runtime * runtime, mln_offline_region_id region_id, mln_offline_region_status * out_status)Gets the current completed/download status for an offline region.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, out_status is null, out_status->size is too small, or no region exists for id.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_region_set_observed
Section titled “mln_runtime_offline_region_set_observed”mln_status mln_runtime_offline_region_set_observed(mln_runtime * runtime, mln_offline_region_id region_id, bool observed)Enables or disables runtime events for an offline region.
Observer callbacks are copied into runtime events. Disabling observation also discards queued events for this region.
Returns:
-
MLN_STATUS_OK when the observer command was accepted.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, or no region exists for region_id.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_region_set_download_state
Section titled “mln_runtime_offline_region_set_download_state”mln_status mln_runtime_offline_region_set_download_state(mln_runtime * runtime, mln_offline_region_id region_id, uint32_t state)Sets an offline region’s native download state.
Register observation separately with mln_runtime_offline_region_set_observed() to receive progress and error events.
Returns:
-
MLN_STATUS_OK when the state command was accepted.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, state is not a mln_offline_region_download_state value, or no region exists for region_id.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_region_invalidate
Section titled “mln_runtime_offline_region_invalidate”mln_status mln_runtime_offline_region_invalidate(mln_runtime * runtime, mln_offline_region_id region_id)Invalidates cached resources for an offline region.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, or no region exists for id.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_runtime_offline_region_delete
Section titled “mln_runtime_offline_region_delete”mln_status mln_runtime_offline_region_delete(mln_runtime * runtime, mln_offline_region_id region_id)Deletes an offline region.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, or no region exists for id.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when a native database error or internal exception is converted to status.
mln_offline_region_snapshot_get
Section titled “mln_offline_region_snapshot_get”mln_status mln_offline_region_snapshot_get(const mln_offline_region_snapshot * snapshot, mln_offline_region_info * out_info)Copies a region data view out of a snapshot handle.
On success, out_info receives pointers into snapshot-owned storage. Those pointers remain valid until the snapshot is destroyed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when snapshot is null or not live, out_info is null, or out_info->size is too small.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_offline_region_snapshot_destroy
Section titled “mln_offline_region_snapshot_destroy”void mln_offline_region_snapshot_destroy(mln_offline_region_snapshot * snapshot)Destroys an offline region snapshot handle. Null is accepted as a no-op.
mln_offline_region_list_count
Section titled “mln_offline_region_list_count”mln_status mln_offline_region_list_count(const mln_offline_region_list * list, size_t * out_count)Gets the number of regions in a list handle.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when list is null or not live, or out_count is null.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_offline_region_list_get
Section titled “mln_offline_region_list_get”mln_status mln_offline_region_list_get(const mln_offline_region_list * list, size_t index, mln_offline_region_info * out_info)Copies a region data view for one list entry.
On success, out_info receives pointers into list-owned storage. Those pointers remain valid until the list is destroyed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when list is null or not live, index is out of range, out_info is null, or out_info->size is too small.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_offline_region_list_destroy
Section titled “mln_offline_region_list_destroy”void mln_offline_region_list_destroy(mln_offline_region_list * list)Destroys an offline region list handle. Null is accepted as a no-op.
mln_map_options_default
Section titled “mln_map_options_default”mln_map_options mln_map_options_default(void)Returns map options initialized for this C API version.
mln_map_create
Section titled “mln_map_create”mln_status mln_map_create(mln_runtime * runtime, const mln_map_options * options, mln_map ** out_map)Creates a map handle on the runtime owner thread.
On success, the runtime owner thread becomes the map owner thread.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, out_map is null, *out_map is not null, or options are invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_request_repaint
Section titled “mln_map_request_repaint”mln_status mln_map_request_repaint(mln_map * map)Requests a repaint for a continuous map.
Continuous maps also invalidate automatically when style data, resources, camera, or transitions change. Ask attached render targets to process the latest update when MLN_RUNTIME_EVENT_MAP_RENDER_UPDATE_AVAILABLE is reported. Repaint requests do not produce MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FINISHED or MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FAILED events.
Returns:
-
MLN_STATUS_OK when the request was accepted.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live.
-
MLN_STATUS_INVALID_STATE when map is not in MLN_MAP_MODE_CONTINUOUS.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_request_still_image
Section titled “mln_map_request_still_image”mln_status mln_map_request_still_image(mln_map * map)Requests one still image for a static or tile map.
Pump the runtime and poll runtime events for this map until MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FINISHED or MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FAILED is reported. While the request is pending, process each MLN_RUNTIME_EVENT_MAP_RENDER_UPDATE_AVAILABLE event from this map. Render targets use mln_render_session_render_update(). Surface targets present directly. A render-update call can return MLN_STATUS_INVALID_STATE before the next update is available; keep pumping and polling in that case. After MLN_RUNTIME_EVENT_MAP_STILL_IMAGE_FINISHED, use the latest successful texture update when the host needs image bytes or a backend texture.
Returns:
-
MLN_STATUS_OK when the request was accepted.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live.
-
MLN_STATUS_INVALID_STATE when map is not in MLN_MAP_MODE_STATIC or MLN_MAP_MODE_TILE, or when a still-image request is already pending.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_destroy
Section titled “mln_map_destroy”mln_status mln_map_destroy(mln_map * map)Destroys a map handle on its owner thread.
The map must not have an attached render session.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not a live map handle.
-
MLN_STATUS_INVALID_STATE when map still has an attached render target session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_style_url
Section titled “mln_map_set_style_url”mln_status mln_map_set_style_url(mln_map * map, const char * url)Loads a style URL through MapLibre Native style APIs.
This is a map command. The return status reports synchronous acceptance or failure. Later native success and failure are reported through runtime events.
Returns:
-
MLN_STATUS_OK when the load request was accepted.
-
MLN_STATUS_INVALID_ARGUMENT when map is null, not live, or url is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when a synchronous native error is reported or an internal exception is converted to status.
mln_map_set_style_json
Section titled “mln_map_set_style_json”mln_status mln_map_set_style_json(mln_map * map, const char * json)Loads inline style JSON through MapLibre Native style APIs.
This is a map command. The return status reports synchronous acceptance or failure. Later native success and failure are reported through runtime events. Malformed JSON can fail synchronously and still enqueue a loading-failed event.
Returns:
-
MLN_STATUS_OK when the load request was accepted.
-
MLN_STATUS_INVALID_ARGUMENT when map is null, not live, or json is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when a synchronous native error is reported or an internal exception is converted to status.
mln_c_version
Section titled “mln_c_version”uint32_t mln_c_version(void)Reports the C ABI contract version. The value is 0 while the ABI is unstable, and will increment on each SemVer major release.
mln_supported_render_backend_mask
Section titled “mln_supported_render_backend_mask”uint32_t mln_supported_render_backend_mask(void)Reports the render backends available in this native library build.
The return value is a mask of mln_render_backend_flag values.
mln_rendered_feature_query_options_default
Section titled “mln_rendered_feature_query_options_default”mln_rendered_feature_query_options mln_rendered_feature_query_options_default(void)Returns default rendered feature query options.
mln_source_feature_query_options_default
Section titled “mln_source_feature_query_options_default”mln_source_feature_query_options mln_source_feature_query_options_default(void)Returns default source feature query options.
mln_rendered_query_geometry_point
Section titled “mln_rendered_query_geometry_point”mln_rendered_query_geometry mln_rendered_query_geometry_point(mln_screen_point point)Returns a rendered point query geometry descriptor.
mln_rendered_query_geometry_box
Section titled “mln_rendered_query_geometry_box”mln_rendered_query_geometry mln_rendered_query_geometry_box(mln_screen_box box)Returns a rendered box query geometry descriptor.
mln_rendered_query_geometry_line_string
Section titled “mln_rendered_query_geometry_line_string”mln_rendered_query_geometry mln_rendered_query_geometry_line_string(const mln_screen_point * points, size_t point_count)Returns a rendered line-string query geometry descriptor.
mln_render_session_query_rendered_features
Section titled “mln_render_session_query_rendered_features”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, mln_feature_query_result ** out_result)Queries rendered features from the latest render session state.
The session renderer must already exist. geometry and options are borrowed for the duration of the call. Passing null for options uses default options. On success, *out_result receives an owned result handle. Destroy it with mln_feature_query_result_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live, geometry is null or invalid, options are invalid, out_result is null, or *out_result is not null.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_query_source_features
Section titled “mln_render_session_query_source_features”mln_status mln_render_session_query_source_features(mln_render_session * session, mln_string_view source_id, const mln_source_feature_query_options * options, mln_feature_query_result ** out_result)Queries source features from the latest render session state.
The session renderer must already exist. source_id and options are borrowed for the duration of the call. Passing null for options uses default options. On success, *out_result receives an owned result handle. Destroy it with mln_feature_query_result_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live, source_id is invalid or empty, options are invalid, out_result is null, or *out_result is not null.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_query_feature_extensions
Section titled “mln_render_session_query_feature_extensions”mln_status mln_render_session_query_feature_extensions(mln_render_session * session, mln_string_view source_id, const mln_feature * feature, mln_string_view extension, mln_string_view extension_field, const mln_json_value * arguments, mln_feature_extension_result ** out_result)Queries a feature extension from the latest render session state.
The session renderer must already exist. source_id, feature, extension, extension_field, and arguments are borrowed for the duration of the call. arguments may be null. When non-null, arguments must be a JSON object descriptor. On success, *out_result receives an owned result handle. Destroy it with mln_feature_extension_result_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live, source_id, feature, extension, extension_field, or arguments are invalid, out_result is null, or *out_result is not null.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_feature_query_result_count
Section titled “mln_feature_query_result_count”mln_status mln_feature_query_result_count(const mln_feature_query_result * result, size_t * out_count)Gets the number of features in a query result handle.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when result is null or not live, or out_count is null.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_feature_query_result_get
Section titled “mln_feature_query_result_get”mln_status mln_feature_query_result_get(const mln_feature_query_result * result, size_t index, mln_queried_feature * out_feature)Borrows one feature from a query result handle.
On success, out_feature receives views into result-owned storage. Those views remain valid until result is destroyed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when result is null or not live, index is out of range, out_feature is null, or out_feature->size is too small.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_feature_query_result_destroy
Section titled “mln_feature_query_result_destroy”void mln_feature_query_result_destroy(mln_feature_query_result * result)Destroys a feature query result handle. Null is accepted as a no-op.
mln_feature_extension_result_get
Section titled “mln_feature_extension_result_get”mln_status mln_feature_extension_result_get(const mln_feature_extension_result * result, mln_feature_extension_result_info * out_info)Borrows a feature extension query result view.
On success, out_info receives views into result-owned storage. Those views remain valid until result is destroyed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when result is null or not live, out_info is null, or out_info->size is too small.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_feature_extension_result_destroy
Section titled “mln_feature_extension_result_destroy”void mln_feature_extension_result_destroy(mln_feature_extension_result * result)Destroys a feature extension result handle. Null is accepted as a no-op.
mln_style_tile_source_options_default
Section titled “mln_style_tile_source_options_default”mln_style_tile_source_options mln_style_tile_source_options_default(void)Returns default tile source options.
mln_custom_geometry_source_options_default
Section titled “mln_custom_geometry_source_options_default”mln_custom_geometry_source_options mln_custom_geometry_source_options_default(void)Returns default custom geometry source options.
mln_premultiplied_rgba8_image_default
Section titled “mln_premultiplied_rgba8_image_default”mln_premultiplied_rgba8_image mln_premultiplied_rgba8_image_default(void)Returns a default premultiplied RGBA8 image descriptor.
mln_style_image_options_default
Section titled “mln_style_image_options_default”mln_style_image_options mln_style_image_options_default(void)Returns default runtime style image options.
mln_style_image_info_default
Section titled “mln_style_image_info_default”mln_style_image_info mln_style_image_info_default(void)Returns default runtime style image metadata.
mln_style_id_list_count
Section titled “mln_style_id_list_count”mln_status mln_style_id_list_count(const mln_style_id_list * list, size_t * out_count)Gets the number of IDs in a style ID list handle.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when list is null or not live, or out_count is null.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_style_id_list_get
Section titled “mln_style_id_list_get”mln_status mln_style_id_list_get(const mln_style_id_list * list, size_t index, mln_string_view * out_id)Borrows one ID from a style ID list handle.
On success, out_id receives a view into list-owned storage. The view remains valid until the list is destroyed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when list is null or not live, index is out of range, or out_id is null.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_style_id_list_destroy
Section titled “mln_style_id_list_destroy”void mln_style_id_list_destroy(mln_style_id_list * list)Destroys a style ID list handle. Null is accepted as a no-op.
mln_map_add_style_source_json
Section titled “mln_map_add_style_source_json”mln_status mln_map_add_style_source_json(mln_map * map, mln_string_view source_id, const mln_json_value * source_json)Adds one style source from a style-spec source JSON object.
source_id and source_json are borrowed for the call. source_json is the object that appears under sources[source_id] in a style document. The function parses and copies the accepted source into MapLibre Native before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, source_json is null or invalid, the source ID already exists, or the source JSON cannot be converted.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_remove_style_source
Section titled “mln_map_remove_style_source”mln_status mln_map_remove_style_source(mln_map * map, mln_string_view source_id, bool * out_removed)Removes one style source by ID.
source_id is borrowed for the call. On success, out_removed reports whether a source existed and was removed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, or out_removed is null.
-
MLN_STATUS_INVALID_STATE when the source exists but a layer still uses it.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_style_source_exists
Section titled “mln_map_style_source_exists”mln_status mln_map_style_source_exists(mln_map * map, mln_string_view source_id, bool * out_exists)Reports whether a style source ID exists.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, or out_exists is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_style_source_type
Section titled “mln_map_get_style_source_type”mln_status mln_map_get_style_source_type(mln_map * map, mln_string_view source_id, uint32_t * out_source_type, bool * out_found)Gets one style source type.
On success, out_found reports whether source_id exists. When found, out_source_type receives one of mln_style_source_type.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, out_source_type is null, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_style_source_info
Section titled “mln_map_get_style_source_info”mln_status mln_map_get_style_source_info(mln_map * map, mln_string_view source_id, mln_style_source_info * out_info, bool * out_found)Copies fixed metadata for one style source.
The returned struct contains string lengths, not string contents. Use mln_map_copy_style_source_attribution() to copy attribution bytes when has_attribution is true. The source ID is the lookup key and is also available through style source ID lists.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, out_info is null, out_info->size is too small, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_copy_style_source_attribution
Section titled “mln_map_copy_style_source_attribution”mln_status mln_map_copy_style_source_attribution(mln_map * map, mln_string_view source_id, char * out_attribution, size_t attribution_capacity, size_t * out_attribution_size, bool * out_found)Copies one style source attribution string into caller-owned memory.
source_id is borrowed for the call. out_attribution may be null only when attribution_capacity is 0. On success, out_attribution_size receives the byte length of the attribution, excluding any null terminator. When out_found is false or the source has no attribution, out_attribution_size receives 0.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, out_attribution is null with non-zero capacity, attribution_capacity is too small for a present attribution, out_attribution_size is null, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_list_style_source_ids
Section titled “mln_map_list_style_source_ids”mln_status mln_map_list_style_source_ids(mln_map * map, mln_style_id_list ** out_source_ids)Copies style source IDs in style order.
On success, *out_source_ids receives an owned list handle. Destroy it with mln_style_id_list_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_source_ids is null, or *out_source_ids is not null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_geojson_source_url
Section titled “mln_map_add_geojson_source_url”mln_status mln_map_add_geojson_source_url(mln_map * map, mln_string_view source_id, mln_string_view url)Adds a GeoJSON source with URL data.
source_id and url are borrowed for the call. The source loads GeoJSON from url through MapLibre Native’s resource system.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id or url is invalid or empty, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_geojson_source_data
Section titled “mln_map_add_geojson_source_data”mln_status mln_map_add_geojson_source_data(mln_map * map, mln_string_view source_id, const mln_geojson * data)Adds a GeoJSON source with inline data.
source_id and data are borrowed for the call. The accepted GeoJSON descriptor is copied into MapLibre Native before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, data is null or invalid, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_geojson_source_url
Section titled “mln_map_set_geojson_source_url”mln_status mln_map_set_geojson_source_url(mln_map * map, mln_string_view source_id, mln_string_view url)Updates one GeoJSON source to load data from a URL.
source_id and url are borrowed for the call.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id or url is invalid or empty, the source does not exist, or the source is not a GeoJSON source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_geojson_source_data
Section titled “mln_map_set_geojson_source_data”mln_status mln_map_set_geojson_source_data(mln_map * map, mln_string_view source_id, const mln_geojson * data)Updates one GeoJSON source with inline data.
source_id and data are borrowed for the call. The accepted GeoJSON descriptor is copied into MapLibre Native before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, data is null or invalid, the source does not exist, or the source is not a GeoJSON source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_vector_source_url
Section titled “mln_map_add_vector_source_url”mln_status mln_map_add_vector_source_url(mln_map * map, mln_string_view source_id, mln_string_view url, const mln_style_tile_source_options * options)Adds a vector source with a TileJSON URL.
source_id and url are borrowed for the call. options may be null for defaults. For URL sources, min_zoom, max_zoom, and vector_encoding override values from the loaded TileJSON when their field bits are set.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id or url is invalid or empty, options is invalid, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_vector_source_tiles
Section titled “mln_map_add_vector_source_tiles”mln_status mln_map_add_vector_source_tiles(mln_map * map, mln_string_view source_id, const mln_string_view * tiles, size_t tile_count, const mln_style_tile_source_options * options)Adds a vector source with inline tile URLs.
source_id and tile URL views are borrowed for the call. The function copies accepted strings into MapLibre Native before return. options may be null for defaults.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, tile URLs are null, empty, or invalid, options is invalid, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_raster_source_url
Section titled “mln_map_add_raster_source_url”mln_status mln_map_add_raster_source_url(mln_map * map, mln_string_view source_id, mln_string_view url, const mln_style_tile_source_options * options)Adds a raster source with a TileJSON URL.
source_id and url are borrowed for the call. options may be null for defaults. For URL sources, only tile_size is used when its field bit is set.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id or url is invalid or empty, options is invalid, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_raster_source_tiles
Section titled “mln_map_add_raster_source_tiles”mln_status mln_map_add_raster_source_tiles(mln_map * map, mln_string_view source_id, const mln_string_view * tiles, size_t tile_count, const mln_style_tile_source_options * options)Adds a raster source with inline tile URLs.
source_id and tile URL views are borrowed for the call. The function copies accepted strings into MapLibre Native before return. options may be null for defaults.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, tile URLs are null, empty, or invalid, options is invalid, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_raster_dem_source_url
Section titled “mln_map_add_raster_dem_source_url”mln_status mln_map_add_raster_dem_source_url(mln_map * map, mln_string_view source_id, mln_string_view url, const mln_style_tile_source_options * options)Adds a raster DEM source with a TileJSON URL.
source_id and url are borrowed for the call. options may be null for defaults. For URL sources, tile_size and raster_encoding are used when their field bits are set.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id or url is invalid or empty, options is invalid, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_raster_dem_source_tiles
Section titled “mln_map_add_raster_dem_source_tiles”mln_status mln_map_add_raster_dem_source_tiles(mln_map * map, mln_string_view source_id, const mln_string_view * tiles, size_t tile_count, const mln_style_tile_source_options * options)Adds a raster DEM source with inline tile URLs.
source_id and tile URL views are borrowed for the call. The function copies accepted strings into MapLibre Native before return. options may be null for defaults.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, tile URLs are null, empty, or invalid, options is invalid, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_custom_geometry_source
Section titled “mln_map_add_custom_geometry_source”mln_status mln_map_add_custom_geometry_source(mln_map * map, mln_string_view source_id, const mln_custom_geometry_source_options * options)Adds a custom geometry source.
source_id is borrowed for the call. options is borrowed for the call, but the callback function pointers and user_data pointer are retained by value. The callback functions and user_data must remain valid until the source is removed, the style is replaced, or the map is destroyed, and until any in-flight callback invocation has returned. For URL loads, style replacement occurs when the new style loads, not when the load request is accepted. For inline JSON loads, style replacement completes before mln_map_set_style_json() returns successfully.
fetch_tile and cancel_tile may run on arbitrary native worker threads, may be concurrent with owner-thread map calls, and must not call thread-affine map APIs directly. Queue work back to the map owner thread before calling mln_map_set_custom_geometry_source_tile_data() or invalidation functions. Callbacks must not throw, panic, longjmp, or otherwise unwind through the C ABI. cancel_tile is best-effort and may be repeated or race with fetch_tile.
Custom geometry sources belong to the current style. Replacing the style drops sources that were added to the previous style.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, options is null or invalid, fetch_tile is null, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_custom_geometry_source_tile_data
Section titled “mln_map_set_custom_geometry_source_tile_data”mln_status mln_map_set_custom_geometry_source_tile_data(mln_map * map, mln_string_view source_id, mln_canonical_tile_id tile_id, const mln_geojson * data)Sets custom geometry source data for one canonical tile.
source_id and data are borrowed for the call. The accepted GeoJSON descriptor is copied into MapLibre Native before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, tile_id is invalid, data is null or invalid, the source does not exist, or the source is not a custom geometry source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_invalidate_custom_geometry_source_tile
Section titled “mln_map_invalidate_custom_geometry_source_tile”mln_status mln_map_invalidate_custom_geometry_source_tile(mln_map * map, mln_string_view source_id, mln_canonical_tile_id tile_id)Invalidates custom geometry source data for one canonical tile.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, tile_id is invalid, the source does not exist, or the source is not a custom geometry source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_invalidate_custom_geometry_source_region
Section titled “mln_map_invalidate_custom_geometry_source_region”mln_status mln_map_invalidate_custom_geometry_source_region(mln_map * map, mln_string_view source_id, mln_lat_lng_bounds bounds)Invalidates custom geometry source data inside one geographic region.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, bounds is invalid, the source does not exist, or the source is not a custom geometry source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_style_image
Section titled “mln_map_set_style_image”mln_status mln_map_set_style_image(mln_map * map, mln_string_view image_id, const mln_premultiplied_rgba8_image * image, const mln_style_image_options * options)Sets one runtime style image.
image_id, image, and image pixels are borrowed for the call. The function copies accepted pixel bytes into the current style before return. If image_id already exists, the native image is replaced.
Runtime style images belong to the current style. Loading another style URL or JSON document drops images that were added to the previous style.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, image_id is invalid or empty, image or options is invalid, image pixels are null, image dimensions or stride are invalid, or image byte_length is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_remove_style_image
Section titled “mln_map_remove_style_image”mln_status mln_map_remove_style_image(mln_map * map, mln_string_view image_id, bool * out_removed)Removes one runtime style image by ID.
image_id is borrowed for the call. On success, out_removed reports whether an image existed and was removed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, image_id is invalid or empty, or out_removed is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_style_image_exists
Section titled “mln_map_style_image_exists”mln_status mln_map_style_image_exists(mln_map * map, mln_string_view image_id, bool * out_exists)Reports whether a runtime style image ID exists.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, image_id is invalid or empty, or out_exists is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_style_image_info
Section titled “mln_map_get_style_image_info”mln_status mln_map_get_style_image_info(mln_map * map, mln_string_view image_id, mln_style_image_info * out_info, bool * out_found)Copies fixed metadata for one runtime style image.
On success, out_found reports whether image_id exists. When not found, out_info receives default image metadata.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, image_id is invalid or empty, out_info is null, out_info->size is too small, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_copy_style_image_premultiplied_rgba8
Section titled “mln_map_copy_style_image_premultiplied_rgba8”mln_status mln_map_copy_style_image_premultiplied_rgba8(mln_map * map, mln_string_view image_id, uint8_t * out_pixels, size_t pixel_capacity, size_t * out_byte_length, bool * out_found)Copies one runtime style image as tightly packed premultiplied RGBA8 pixels.
image_id is borrowed for the call. out_pixels may be null only when pixel_capacity is 0. On success, out_byte_length receives the required byte length. When out_found is false, out_byte_length receives 0. If pixel_capacity is too small for a present image, out_byte_length still receives the required byte length and the function returns MLN_STATUS_INVALID_ARGUMENT.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, image_id is invalid or empty, out_pixels is null with non-zero capacity, pixel_capacity is too small for a present image, out_byte_length is null, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_image_source_url
Section titled “mln_map_add_image_source_url”mln_status mln_map_add_image_source_url(mln_map * map, mln_string_view source_id, const mln_lat_lng * coordinates, size_t coordinate_count, mln_string_view url)Adds an image source that loads its image from a URL.
source_id, coordinates, and url are borrowed for the call. coordinates must contain exactly four coordinates in top-left, top-right, bottom-right, bottom-left order. The function copies accepted strings and coordinates into the current style before return. Later URL load or decode failures are reported through runtime events.
Image sources belong to the current style. Loading another style URL or JSON document drops sources that were added to the previous style.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id or url is invalid or empty, coordinates is null or invalid, coordinate_count is not 4, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_image_source_image
Section titled “mln_map_add_image_source_image”mln_status mln_map_add_image_source_image(mln_map * map, mln_string_view source_id, const mln_lat_lng * coordinates, size_t coordinate_count, const mln_premultiplied_rgba8_image * image)Adds an image source with inline image pixels.
source_id, coordinates, image, and image pixels are borrowed for the call. coordinates must contain exactly four coordinates in top-left, top-right, bottom-right, bottom-left order. The function copies accepted coordinates and pixels into the current style before return.
Image sources belong to the current style. Loading another style URL or JSON document drops sources that were added to the previous style.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, coordinates is null or invalid, coordinate_count is not 4, image is invalid, image pixels are null, image dimensions or stride are invalid, image byte_length is too small, or the source ID already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_image_source_url
Section titled “mln_map_set_image_source_url”mln_status mln_map_set_image_source_url(mln_map * map, mln_string_view source_id, mln_string_view url)Updates an image source to load its image from a URL.
source_id and url are borrowed for the call. Later URL load or decode failures are reported through runtime events.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id or url is invalid or empty, the source does not exist, or the source is not an image source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_image_source_image
Section titled “mln_map_set_image_source_image”mln_status mln_map_set_image_source_image(mln_map * map, mln_string_view source_id, const mln_premultiplied_rgba8_image * image)Updates an image source with inline image pixels.
source_id, image, and image pixels are borrowed for the call. The function copies accepted pixels into MapLibre Native before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, image is invalid, image pixels are null, image dimensions or stride are invalid, image byte_length is too small, the source does not exist, or the source is not an image source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_image_source_coordinates
Section titled “mln_map_set_image_source_coordinates”mln_status mln_map_set_image_source_coordinates(mln_map * map, mln_string_view source_id, const mln_lat_lng * coordinates, size_t coordinate_count)Updates image source coordinates.
coordinates is borrowed for the call and must contain exactly four coordinates in top-left, top-right, bottom-right, bottom-left order. The function copies accepted coordinates into MapLibre Native before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, coordinates is null or invalid, coordinate_count is not 4, the source does not exist, or the source is not an image source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_image_source_coordinates
Section titled “mln_map_get_image_source_coordinates”mln_status mln_map_get_image_source_coordinates(mln_map * map, mln_string_view source_id, mln_lat_lng * out_coordinates, size_t coordinate_capacity, size_t * out_coordinate_count, bool * out_found)Copies image source coordinates.
On success, out_found reports whether source_id exists. When found, out_coordinate_count receives 4. If coordinate_capacity is less than 4, out_coordinate_count still receives 4 and the function returns MLN_STATUS_INVALID_ARGUMENT.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, source_id is invalid or empty, out_coordinates is null with non-zero capacity, coordinate_capacity is too small for a found source, out_coordinate_count is null, out_found is null, or the source exists and is not an image source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_hillshade_layer
Section titled “mln_map_add_hillshade_layer”mln_status mln_map_add_hillshade_layer(mln_map * map, mln_string_view layer_id, mln_string_view source_id, mln_string_view before_layer_id)Adds a hillshade layer for a raster DEM source.
layer_id, source_id, and before_layer_id are borrowed for the call. Passing an empty before_layer_id appends the layer; otherwise the layer is inserted before that existing layer.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id or source_id is invalid or empty, before_layer_id is invalid or does not exist, layer_id already exists, source_id does not exist, or source_id is not a raster DEM source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_color_relief_layer
Section titled “mln_map_add_color_relief_layer”mln_status mln_map_add_color_relief_layer(mln_map * map, mln_string_view layer_id, mln_string_view source_id, mln_string_view before_layer_id)Adds a color-relief layer for a raster DEM source.
layer_id, source_id, and before_layer_id are borrowed for the call. Passing an empty before_layer_id appends the layer; otherwise the layer is inserted before that existing layer. Use mln_map_set_layer_property() with color-relief-color to set the color ramp expression.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id or source_id is invalid or empty, before_layer_id is invalid or does not exist, layer_id already exists, source_id does not exist, or source_id is not a raster DEM source.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_location_indicator_layer
Section titled “mln_map_add_location_indicator_layer”mln_status mln_map_add_location_indicator_layer(mln_map * map, mln_string_view layer_id, mln_string_view before_layer_id)Adds a source-free location indicator layer.
layer_id and before_layer_id are borrowed for the call. Passing an empty before_layer_id appends the layer; otherwise the layer is inserted before that existing layer.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, before_layer_id is invalid or does not exist, or layer_id already exists.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_location_indicator_location
Section titled “mln_map_set_location_indicator_location”mln_status mln_map_set_location_indicator_location(mln_map * map, mln_string_view layer_id, mln_lat_lng coordinate, double altitude)Sets a location indicator layer location.
coordinate uses normal C API latitude/longitude order. The underlying style property is written as [longitude, latitude, altitude].
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, coordinate or altitude is invalid, the layer does not exist, or the layer is not a location indicator layer.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_location_indicator_bearing
Section titled “mln_map_set_location_indicator_bearing”mln_status mln_map_set_location_indicator_bearing(mln_map * map, mln_string_view layer_id, double bearing)Sets a location indicator layer bearing in degrees.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, bearing is not finite float32, the layer does not exist, or the layer is not a location indicator layer.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_location_indicator_accuracy_radius
Section titled “mln_map_set_location_indicator_accuracy_radius”mln_status mln_map_set_location_indicator_accuracy_radius(mln_map * map, mln_string_view layer_id, double radius)Sets a location indicator layer accuracy radius in logical pixels.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, radius is negative or not finite float32, the layer does not exist, or the layer is not a location indicator layer.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_location_indicator_image_name
Section titled “mln_map_set_location_indicator_image_name”mln_status mln_map_set_location_indicator_image_name(mln_map * map, mln_string_view layer_id, uint32_t image_kind, mln_string_view image_id)Sets one location indicator image-name property.
image_id is borrowed for the call and copied into native style storage. The named style image does not need to exist when this function is called.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id or image_id is invalid or empty, image_kind is invalid, the layer does not exist, or the layer is not a location indicator layer.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_add_style_layer_json
Section titled “mln_map_add_style_layer_json”mln_status mln_map_add_style_layer_json(mln_map * map, const mln_json_value * layer_json, mln_string_view before_layer_id)Adds one style layer from a full style-spec layer JSON object.
layer_json and before_layer_id are borrowed for the call. layer_json must contain id and type members. Passing an empty before_layer_id appends the layer; otherwise the layer is inserted before that existing layer.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_json is null or invalid, the layer ID already exists, before_layer_id is invalid or does not exist, or the layer JSON cannot be converted.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_remove_style_layer
Section titled “mln_map_remove_style_layer”mln_status mln_map_remove_style_layer(mln_map * map, mln_string_view layer_id, bool * out_removed)Removes one style layer by ID.
layer_id is borrowed for the call. On success, out_removed reports whether a layer existed and was removed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, or out_removed is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_style_layer_exists
Section titled “mln_map_style_layer_exists”mln_status mln_map_style_layer_exists(mln_map * map, mln_string_view layer_id, bool * out_exists)Reports whether a style layer ID exists.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, or out_exists is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_style_layer_type
Section titled “mln_map_get_style_layer_type”mln_status mln_map_get_style_layer_type(mln_map * map, mln_string_view layer_id, mln_string_view * out_layer_type, bool * out_found)Borrows one style layer type string.
On success, out_found reports whether layer_id exists. When found, out_layer_type receives a view of a static style-spec layer type string.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, out_layer_type is null, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_list_style_layer_ids
Section titled “mln_map_list_style_layer_ids”mln_status mln_map_list_style_layer_ids(mln_map * map, mln_style_id_list ** out_layer_ids)Copies style layer IDs in style order.
On success, *out_layer_ids receives an owned list handle. Destroy it with mln_style_id_list_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_layer_ids is null, or *out_layer_ids is not null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_move_style_layer
Section titled “mln_map_move_style_layer”mln_status mln_map_move_style_layer(mln_map * map, mln_string_view layer_id, mln_string_view before_layer_id)Moves one style layer before another layer or to the top.
layer_id and before_layer_id are borrowed for the call. Passing an empty before_layer_id moves the layer to the top of the style order.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, before_layer_id is invalid, layer_id does not exist, or before_layer_id is non-empty and does not exist.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_style_layer_json
Section titled “mln_map_get_style_layer_json”mln_status mln_map_get_style_layer_json(mln_map * map, mln_string_view layer_id, mln_json_snapshot ** out_layer, bool * out_found)Copies one style layer as a full style-spec layer JSON snapshot.
On success, out_found reports whether layer_id exists. When found, *out_layer receives an owned snapshot handle.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, out_layer is null, *out_layer is not null, or out_found is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_style_light_json
Section titled “mln_map_set_style_light_json”mln_status mln_map_set_style_light_json(mln_map * map, const mln_json_value * light_json)Sets the style light from a style-spec light JSON object.
light_json is borrowed for the call. The function parses and copies the accepted light into MapLibre Native before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, light_json is null or invalid, or the light JSON cannot be converted.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_style_light_property
Section titled “mln_map_set_style_light_property”mln_status mln_map_set_style_light_property(mln_map * map, mln_string_view property_name, const mln_json_value * value)Sets one style light property using its MapLibre style-spec property name.
property_name and value are borrowed for the call. value is a style-spec JSON value descriptor. The function parses and copies the accepted value into MapLibre Native’s typed light property storage before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, property_name is invalid or empty, value is null or invalid, the property name is unknown, or the property value cannot be converted for that property.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_style_light_property
Section titled “mln_map_get_style_light_property”mln_status mln_map_get_style_light_property(mln_map * map, mln_string_view property_name, mln_json_snapshot ** out_value)Copies one style light property as a style-spec JSON value snapshot.
On success, *out_value receives an owned snapshot handle. Use mln_json_snapshot_get() to borrow its root JSON value. Destroy the snapshot with mln_json_snapshot_destroy(). Undefined native style light properties return null snapshots.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, property_name is invalid or empty, out_value is null, or *out_value is not null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_layer_property
Section titled “mln_map_set_layer_property”mln_status mln_map_set_layer_property(mln_map * map, mln_string_view layer_id, mln_string_view property_name, const mln_json_value * value)Sets one layer property using its MapLibre style-spec property name.
layer_id, property_name, and value are borrowed for the call. value is a style-spec JSON value descriptor. Expressions use style-spec expression JSON arrays. The function parses and copies the accepted value into MapLibre Native’s typed style property storage before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id or property_name is invalid or empty, value is null or invalid, the layer does not exist, the property name is unknown for that layer, or the property value cannot be converted for that property.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_layer_property
Section titled “mln_map_get_layer_property”mln_status mln_map_get_layer_property(mln_map * map, mln_string_view layer_id, mln_string_view property_name, mln_json_snapshot ** out_value)Copies one layer property as a style-spec JSON value snapshot.
On success, *out_value receives an owned snapshot handle. Use mln_json_snapshot_get() to borrow its root JSON value. Destroy the snapshot with mln_json_snapshot_destroy(). Undefined native style properties return null snapshots.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id or property_name is invalid or empty, out_value is null, *out_value is not null, or the layer does not exist.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_layer_filter
Section titled “mln_map_set_layer_filter”mln_status mln_map_set_layer_filter(mln_map * map, mln_string_view layer_id, const mln_json_value * filter)Sets or clears one layer filter.
layer_id and filter are borrowed for the call. Passing null for filter clears the layer filter. Non-null filters use the MapLibre style-spec filter JSON representation. The function parses and copies the accepted filter into MapLibre Native’s typed filter expression storage before return.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, filter is invalid, the layer does not exist, or the filter cannot be converted.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_layer_filter
Section titled “mln_map_get_layer_filter”mln_status mln_map_get_layer_filter(mln_map * map, mln_string_view layer_id, mln_json_snapshot ** out_filter)Copies one layer filter as a style-spec JSON value snapshot.
On success, *out_filter receives an owned snapshot handle. Use mln_json_snapshot_get() to borrow its root JSON value. Destroy the snapshot with mln_json_snapshot_destroy(). Missing filters return null snapshots.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, layer_id is invalid or empty, out_filter is null, *out_filter is not null, or the layer does not exist.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_camera_options_default
Section titled “mln_camera_options_default”mln_camera_options mln_camera_options_default(void)Returns empty camera options initialized for this C API version.
mln_animation_options_default
Section titled “mln_animation_options_default”mln_animation_options mln_animation_options_default(void)Returns empty animation options initialized for this C API version.
mln_camera_fit_options_default
Section titled “mln_camera_fit_options_default”mln_camera_fit_options mln_camera_fit_options_default(void)Returns empty camera fitting options initialized for this C API version.
mln_bound_options_default
Section titled “mln_bound_options_default”mln_bound_options mln_bound_options_default(void)Returns empty map bound options initialized for this C API version.
mln_free_camera_options_default
Section titled “mln_free_camera_options_default”mln_free_camera_options mln_free_camera_options_default(void)Returns empty free camera options initialized for this C API version.
mln_projection_mode_default
Section titled “mln_projection_mode_default”mln_projection_mode mln_projection_mode_default(void)Returns empty axonometric rendering options initialized for this C API version.
mln_map_viewport_options_default
Section titled “mln_map_viewport_options_default”mln_map_viewport_options mln_map_viewport_options_default(void)Returns empty viewport options initialized for this C API version.
mln_map_tile_options_default
Section titled “mln_map_tile_options_default”mln_map_tile_options mln_map_tile_options_default(void)Returns empty tile tuning options initialized for this C API version.
mln_map_set_debug_options
Section titled “mln_map_set_debug_options”mln_status mln_map_set_debug_options(mln_map * map, uint32_t options)Applies MapLibre debug overlay mask bits to a map.
Pass 0 to disable all debug overlays.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, or options contains unknown bits.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_debug_options
Section titled “mln_map_get_debug_options”mln_status mln_map_get_debug_options(mln_map * map, uint32_t * out_options)Copies the current MapLibre debug overlay mask bits.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, or out_options is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_rendering_stats_view_enabled
Section titled “mln_map_set_rendering_stats_view_enabled”mln_status mln_map_set_rendering_stats_view_enabled(mln_map * map, bool enabled)Enables or disables MapLibre’s rendering stats overlay view.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_rendering_stats_view_enabled
Section titled “mln_map_get_rendering_stats_view_enabled”mln_status mln_map_get_rendering_stats_view_enabled(mln_map * map, bool * out_enabled)Copies whether MapLibre’s rendering stats overlay view is enabled.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, or out_enabled is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_is_fully_loaded
Section titled “mln_map_is_fully_loaded”mln_status mln_map_is_fully_loaded(mln_map * map, bool * out_loaded)Copies whether MapLibre currently considers the map fully loaded.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, or out_loaded is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_dump_debug_logs
Section titled “mln_map_dump_debug_logs”mln_status mln_map_dump_debug_logs(mln_map * map)Dumps map debug logs through MapLibre Native logging.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_viewport_options
Section titled “mln_map_get_viewport_options”mln_status mln_map_get_viewport_options(mln_map * map, mln_map_viewport_options * out_options)Copies live map viewport and render-transform controls.
On success, *out_options is overwritten and all known fields are marked.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_options is null, or out_options->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_viewport_options
Section titled “mln_map_set_viewport_options”mln_status mln_map_set_viewport_options(mln_map * map, const mln_map_viewport_options * options)Applies selected live map viewport and render-transform controls.
Only fields indicated by options->fields affect the map.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, options is null, options->size is too small, options->fields contains unknown bits, an enum value is unknown, or an enabled frustum offset value is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_tile_options
Section titled “mln_map_get_tile_options”mln_status mln_map_get_tile_options(mln_map * map, mln_map_tile_options * out_options)Copies tile prefetch and LOD tuning controls.
On success, *out_options is overwritten and all known fields are marked.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_options is null, or out_options->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_tile_options
Section titled “mln_map_set_tile_options”mln_status mln_map_set_tile_options(mln_map * map, const mln_map_tile_options * options)Applies selected tile prefetch and LOD tuning controls.
Only fields indicated by options->fields affect the map.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, options is null, options->size is too small, options->fields contains unknown bits, prefetch_zoom_delta is greater than 255, a double field is non-finite, or lod_mode is unknown.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_camera
Section titled “mln_map_get_camera”mln_status mln_map_get_camera(mln_map * map, mln_camera_options * out_camera)Copies the current camera snapshot.
On success, *out_camera is overwritten.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_camera is null, or out_camera->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_jump_to
Section titled “mln_map_jump_to”mln_status mln_map_jump_to(mln_map * map, const mln_camera_options * camera)Applies a camera jump command.
Only fields indicated by camera->fields affect the map.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, camera is null, camera->size is too small, camera->fields contains unknown bits, or an enabled camera field is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_ease_to
Section titled “mln_map_ease_to”mln_status mln_map_ease_to(mln_map * map, const mln_camera_options * camera, const mln_animation_options * animation)Applies a camera ease transition command.
Only fields indicated by camera->fields affect the map. Passing a null animation uses MapLibre Native’s default animation options.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, camera is null, camera->size is too small, camera->fields contains unknown bits, an enabled camera field is invalid, animation->size is too small, animation->fields contains unknown bits, or an enabled animation field is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_fly_to
Section titled “mln_map_fly_to”mln_status mln_map_fly_to(mln_map * map, const mln_camera_options * camera, const mln_animation_options * animation)Applies a camera fly transition command.
Only fields indicated by camera->fields affect the map. Passing a null animation uses MapLibre Native’s default animation options.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, camera is null, camera->size is too small, camera->fields contains unknown bits, an enabled camera field is invalid, animation->size is too small, animation->fields contains unknown bits, or an enabled animation field is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_move_by
Section titled “mln_map_move_by”mln_status mln_map_move_by(mln_map * map, double delta_x, double delta_y)Applies a screen-space pan command.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, or a delta value is non-finite.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_move_by_animated
Section titled “mln_map_move_by_animated”mln_status mln_map_move_by_animated(mln_map * map, double delta_x, double delta_y, const mln_animation_options * animation)Applies an animated screen-space pan command.
Passing a null animation uses MapLibre Native’s default animation options.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, a delta value is non-finite, animation->size is too small, animation->fields contains unknown bits, or an enabled animation field is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_scale_by
Section titled “mln_map_scale_by”mln_status mln_map_scale_by(mln_map * map, double scale, const mln_screen_point * anchor)Applies a screen-space zoom command.
Passing a null anchor uses MapLibre Native’s default zoom anchor.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, scale is non-positive or non-finite, or anchor contains non-finite values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_scale_by_animated
Section titled “mln_map_scale_by_animated”mln_status mln_map_scale_by_animated(mln_map * map, double scale, const mln_screen_point * anchor, const mln_animation_options * animation)Applies an animated screen-space zoom command.
Passing a null anchor uses MapLibre Native’s default zoom anchor. Passing a null animation uses MapLibre Native’s default animation options.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, scale is non-positive or non-finite, anchor contains non-finite values, animation->size is too small, animation->fields contains unknown bits, or an enabled animation field is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_rotate_by
Section titled “mln_map_rotate_by”mln_status mln_map_rotate_by(mln_map * map, mln_screen_point first, mln_screen_point second)Applies a screen-space rotate command.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, or a point contains non-finite values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_rotate_by_animated
Section titled “mln_map_rotate_by_animated”mln_status mln_map_rotate_by_animated(mln_map * map, mln_screen_point first, mln_screen_point second, const mln_animation_options * animation)Applies an animated screen-space rotate command.
Passing a null animation uses MapLibre Native’s default animation options.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, a point contains non-finite values, animation->size is too small, animation->fields contains unknown bits, or an enabled animation field is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_pitch_by
Section titled “mln_map_pitch_by”mln_status mln_map_pitch_by(mln_map * map, double pitch)Applies a pitch delta command.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, or pitch is non-finite.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_pitch_by_animated
Section titled “mln_map_pitch_by_animated”mln_status mln_map_pitch_by_animated(mln_map * map, double pitch, const mln_animation_options * animation)Applies an animated pitch delta command.
Passing a null animation uses MapLibre Native’s default animation options.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, pitch is non-finite, animation->size is too small, animation->fields contains unknown bits, or an enabled animation field is invalid.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_cancel_transitions
Section titled “mln_map_cancel_transitions”mln_status mln_map_cancel_transitions(mln_map * map)Cancels active camera transitions.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_camera_for_lat_lng_bounds
Section titled “mln_map_camera_for_lat_lng_bounds”mln_status mln_map_camera_for_lat_lng_bounds(mln_map * map, mln_lat_lng_bounds bounds, const mln_camera_fit_options * fit_options, mln_camera_options * out_camera)Computes a camera that fits geographic bounds in the current viewport.
Passing null fit_options uses zero padding with no bearing or pitch override. On success, *out_camera is overwritten.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, bounds are invalid, fit_options is invalid, out_camera is null, or out_camera->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_camera_for_lat_lngs
Section titled “mln_map_camera_for_lat_lngs”mln_status mln_map_camera_for_lat_lngs(mln_map * map, const mln_lat_lng * coordinates, size_t coordinate_count, const mln_camera_fit_options * fit_options, mln_camera_options * out_camera)Computes a camera that fits geographic coordinates in the current viewport.
The coordinates array is borrowed for the duration of this call and is not retained. Passing null fit_options uses zero padding with no bearing or pitch override. On success, *out_camera is overwritten.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, coordinates is null, coordinate_count is 0, any coordinate is invalid, fit_options is invalid, out_camera is null, or out_camera->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_camera_for_geometry
Section titled “mln_map_camera_for_geometry”mln_status mln_map_camera_for_geometry(mln_map * map, const mln_geometry * geometry, const mln_camera_fit_options * fit_options, mln_camera_options * out_camera)Computes a camera that fits a geometry in the current viewport.
The geometry descriptor graph is borrowed for the duration of this call and is not retained. Empty geometry objects and geometry collections with no coordinates are invalid for camera fitting. Passing null fit_options uses zero padding with no bearing or pitch override. On success, *out_camera is overwritten.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, geometry is null or invalid, geometry contains no coordinates, fit_options is invalid, out_camera is null, or out_camera->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_lat_lng_bounds_for_camera
Section titled “mln_map_lat_lng_bounds_for_camera”mln_status mln_map_lat_lng_bounds_for_camera(mln_map * map, const mln_camera_options * camera, mln_lat_lng_bounds * out_bounds)Computes wrapped geographic bounds for a camera in the current viewport.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, camera is null or invalid, or out_bounds is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_lat_lng_bounds_for_camera_unwrapped
Section titled “mln_map_lat_lng_bounds_for_camera_unwrapped”mln_status mln_map_lat_lng_bounds_for_camera_unwrapped(mln_map * map, const mln_camera_options * camera, mln_lat_lng_bounds * out_bounds)Computes unwrapped geographic bounds for a camera in the current viewport.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, camera is null or invalid, or out_bounds is null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_bounds
Section titled “mln_map_get_bounds”mln_status mln_map_get_bounds(mln_map * map, mln_bound_options * out_options)Copies map camera constraint options.
On success, *out_options is overwritten and all known fields are marked.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_options is null, or out_options->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_bounds
Section titled “mln_map_set_bounds”mln_status mln_map_set_bounds(mln_map * map, const mln_bound_options * options)Applies selected map camera constraint options.
Only fields indicated by options->fields affect the map.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, options is null, options->size is too small, options->fields contains unknown bits, bounds are invalid, a numeric field is non-finite, or paired min/max fields are inconsistent.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_free_camera_options
Section titled “mln_map_get_free_camera_options”mln_status mln_map_get_free_camera_options(mln_map * map, mln_free_camera_options * out_options)Copies the current free camera position and orientation.
On success, *out_options is overwritten.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_options is null, or out_options->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_free_camera_options
Section titled “mln_map_set_free_camera_options”mln_status mln_map_set_free_camera_options(mln_map * map, const mln_free_camera_options * options)Applies selected free camera position and orientation fields.
Position uses MapLibre Native’s modified Web Mercator camera space. Orientation is a quaternion stored as x, y, z, w. Only fields indicated by options->fields affect the map.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, options is null, options->size is too small, options->fields contains unknown bits, position contains non-finite values, or orientation contains non-finite values or is zero length.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_get_projection_mode
Section titled “mln_map_get_projection_mode”mln_status mln_map_get_projection_mode(mln_map * map, mln_projection_mode * out_mode)Copies the current axonometric rendering options.
On success, *out_mode is overwritten. MapLibre currently reports all fields.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_mode is null, or out_mode->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_set_projection_mode
Section titled “mln_map_set_projection_mode”mln_status mln_map_set_projection_mode(mln_map * map, const mln_projection_mode * mode)Applies axonometric rendering option fields to a map.
Only fields indicated by mode->fields affect the map. Unspecified fields keep their current native values. These options mutate the live map render transform and do not change coordinate conversion units or formulas.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, mode is null, mode->size is too small, mode->fields contains unknown bits, or an enabled skew value is non-finite.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_pixel_for_lat_lng
Section titled “mln_map_pixel_for_lat_lng”mln_status mln_map_pixel_for_lat_lng(mln_map * map, mln_lat_lng coordinate, mln_screen_point * out_point)Converts a geographic world coordinate to a screen point for the current map.
The output point uses logical map pixels with an origin at the top-left of the map viewport.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_point is null, or coordinate contains invalid latitude or longitude values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_lat_lng_for_pixel
Section titled “mln_map_lat_lng_for_pixel”mln_status mln_map_lat_lng_for_pixel(mln_map * map, mln_screen_point point, mln_lat_lng * out_coordinate)Converts a screen point to a geographic world coordinate for the current map.
The input point uses logical map pixels with an origin at the top-left of the map viewport.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_coordinate is null, or point contains non-finite values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_pixels_for_lat_lngs
Section titled “mln_map_pixels_for_lat_lngs”mln_status mln_map_pixels_for_lat_lngs(mln_map * map, const mln_lat_lng * coordinates, size_t coordinate_count, mln_screen_point * out_points)Converts geographic world coordinates to screen points for the current map.
The caller owns both arrays. On success, out_points receives coordinate_count entries. coordinates and out_points may be null only when coordinate_count is 0.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, a required array is null, or any coordinate contains invalid latitude or longitude values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_lat_lngs_for_pixels
Section titled “mln_map_lat_lngs_for_pixels”mln_status mln_map_lat_lngs_for_pixels(mln_map * map, const mln_screen_point * points, size_t point_count, mln_lat_lng * out_coordinates)Converts screen points to geographic world coordinates for the current map.
The caller owns both arrays. On success, out_coordinates receives point_count entries. points and out_coordinates may be null only when point_count is 0.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, a required array is null, or any point contains non-finite values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_log_set_callback
Section titled “mln_log_set_callback”mln_status mln_log_set_callback(mln_log_callback callback, void * user_data)Installs a process-global MapLibre Native log callback.
Passing null clears the current callback. The callback and user_data are stored by reference and must remain valid until the callback is replaced or cleared.
The callback is a low-level native callback:
-
MapLibre may invoke it from logging or worker threads selected by the async severity mask.
-
MapLibre may invoke it while holding internal logging locks.
-
The callback must be thread-safe, return quickly, and must not call this C API or MapLibre Native APIs.
-
Language adapters for runtimes that restrict native-thread callbacks can marshal records into host-managed logging facilities before invoking user code.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_log_clear_callback
Section titled “mln_log_clear_callback”mln_status mln_log_clear_callback(void)Clears the process-global log callback.
After this call succeeds, future log dispatches no longer use the callback that was previously registered through mln_log_set_callback().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_log_set_async_severity_mask
Section titled “mln_log_set_async_severity_mask”mln_status mln_log_set_async_severity_mask(uint32_t mask)Controls which log severities MapLibre Native may dispatch asynchronously.
MLN_LOG_SEVERITY_MASK_DEFAULT restores MapLibre Native’s default behavior: info and warning records may be asynchronous, while error records remain synchronous.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when mask contains unknown bits.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_network_status_get
Section titled “mln_network_status_get”mln_status mln_network_status_get(uint32_t * out_status)Reads MapLibre Native’s process-global network status.
On success, out_status receives a mln_network_status value.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when out_status is null.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_network_status_set
Section titled “mln_network_status_set”mln_status mln_network_status_set(uint32_t status)Sets MapLibre Native’s process-global network status.
MLN_NETWORK_STATUS_ONLINE allows HTTP and HTTPS requests and wakes native subscribers when transitioning from offline. MLN_NETWORK_STATUS_OFFLINE makes MapLibre’s online source stop starting network requests until reachability returns. Runtime-scoped resource configuration is unchanged.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when status is not a mln_network_status value.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_runtime_options_default
Section titled “mln_runtime_options_default”mln_runtime_options mln_runtime_options_default(void)Returns runtime options initialized for this C API version.
mln_runtime_create
Section titled “mln_runtime_create”mln_status mln_runtime_create(const mln_runtime_options * options, mln_runtime ** out_runtime)Creates a runtime handle.
The creating thread becomes the runtime owner thread. Each owner thread may hold one live runtime.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when out_runtime is null, *out_runtime is not null, or options has an unsupported size or flags.
-
MLN_STATUS_INVALID_STATE when the current thread already owns a live runtime.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_runtime_set_resource_provider
Section titled “mln_runtime_set_resource_provider”mln_status mln_runtime_set_resource_provider(mln_runtime * runtime, const mln_resource_provider * provider)Sets a runtime-scoped network resource provider.
The provider must be set before any map is created from the runtime. It is invoked for requests that reach the C API network file source. Built-in non-network schemes such as file, asset, mbtiles, and pmtiles are handled by native MainResourceLoader before this extension point. The callback and user_data are stored by reference and must remain valid until the runtime is destroyed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, provider is null, provider->size is too small, or callback is null.
-
MLN_STATUS_INVALID_STATE when runtime already owns live maps.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_resource_request_complete
Section titled “mln_resource_request_complete”mln_status mln_resource_request_complete(mln_resource_request_handle * handle, const mln_resource_response * response)Completes a C API resource provider request.
This function may be called inline from the provider callback or later from any thread. The C API copies all response bytes and strings before returning.
Completion is one-shot. A second completion, completion after cancellation, or completion with null arguments returns a non-OK status and does not invoke MapLibre’s resource callback. Malformed response contents are converted to provider error responses and still consume the completion.
Returns:
-
MLN_STATUS_OK when the response was accepted for asynchronous delivery.
-
MLN_STATUS_INVALID_ARGUMENT when handle or response is null.
-
MLN_STATUS_INVALID_STATE when the request was cancelled, already completed, or can no longer accept a response.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_resource_request_cancelled
Section titled “mln_resource_request_cancelled”mln_status mln_resource_request_cancelled(const mln_resource_request_handle * handle, bool * out_cancelled)Reports whether MapLibre has cancelled a C API resource provider request.
This function may be called from any thread while the provider still owns the handle. A cancelled request no longer wants a response; later completion is ignored with MLN_STATUS_INVALID_STATE.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when handle or out_cancelled is null.
mln_resource_request_release
Section titled “mln_resource_request_release”void mln_resource_request_release(mln_resource_request_handle * handle)Releases the provider’s reference to a resource request handle.
Providers own a releasable handle only after returning MLN_RESOURCE_PROVIDER_DECISION_HANDLE from the callback. Release the handle exactly once after completing the request or deciding not to complete it. Passing null is a no-op. A released handle must not be used again.
mln_runtime_set_resource_transform
Section titled “mln_runtime_set_resource_transform”mln_status mln_runtime_set_resource_transform(mln_runtime * runtime, const mln_resource_transform * transform)Registers a runtime-scoped URL transform for network resources.
The transform must be registered before any map is created from the runtime. It is forwarded to MapLibre’s OnlineFileSource, so it applies wherever native OnlineFileSource applies transforms, including nested PMTiles network range requests. It does not apply to file, asset, database, MBTiles, or registered C API provider responses intercepted before OnlineFileSource.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, transform is null, transform->size is too small, or callback is null.
-
MLN_STATUS_INVALID_STATE when runtime already owns live maps.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_runtime_run_ambient_cache_operation
Section titled “mln_runtime_run_ambient_cache_operation”mln_status mln_runtime_run_ambient_cache_operation(mln_runtime * runtime, uint32_t operation)Runs a MapLibre ambient cache maintenance operation for this runtime.
When runtime options omit cache_path, this operates on MapLibre’s default in-memory database and its effects are not durable beyond the native database lifetime. Native cache operations are asynchronous internally; this call waits until MapLibre’s database callback reports completion and returns the resulting status.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, or operation is not a mln_ambient_cache_operation value.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_runtime_destroy
Section titled “mln_runtime_destroy”mln_status mln_runtime_destroy(mln_runtime * runtime)Destroys a runtime handle.
The runtime must no longer own live maps.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not a live runtime handle.
-
MLN_STATUS_INVALID_STATE when runtime still owns live maps.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the creating thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_runtime_run_once
Section titled “mln_runtime_run_once”mln_status mln_runtime_run_once(mln_runtime * runtime)Runs one pending owner-thread task for this runtime.
If no task is pending, the call returns MLN_STATUS_OK without doing work.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not a live runtime handle.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_runtime_poll_event
Section titled “mln_runtime_poll_event”mln_status mln_runtime_poll_event(mln_runtime * runtime, mln_runtime_event * out_event, bool * out_has_event)Pops the next queued runtime event.
On success, *out_event is reset and *out_has_event indicates whether an event was available. When an event is available, *out_event receives it. Map-originated events set out_event->source_type to MLN_RUNTIME_EVENT_SOURCE_MAP and out_event->source to the source map. Runtime-originated events set out_event->source_type to MLN_RUNTIME_EVENT_SOURCE_RUNTIME.
When an event is available, out_event->payload points to runtime-owned storage containing a struct selected by out_event->payload_type, or null when the payload type is MLN_RUNTIME_EVENT_PAYLOAD_NONE. String pointers inside typed payloads and out_event->message remain valid until the next mln_runtime_poll_event() call for the same runtime or until the runtime is destroyed. Copy those bytes before then when they must outlive that window. For style-image-missing and tile-action events, out_event->message contains the same ID string exposed by the typed payload.
Returns:
-
MLN_STATUS_OK when the poll completed; out_has_event indicates whether an event was written to out_event.
-
MLN_STATUS_INVALID_ARGUMENT when runtime is null or not live, out_event is null, out_has_event is null, or out_event->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the runtime owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_metal_surface_descriptor_default
Section titled “mln_metal_surface_descriptor_default”mln_metal_surface_descriptor mln_metal_surface_descriptor_default(void)Returns Metal surface descriptor defaults for this C API version.
mln_vulkan_surface_descriptor_default
Section titled “mln_vulkan_surface_descriptor_default”mln_vulkan_surface_descriptor mln_vulkan_surface_descriptor_default(void)Returns Vulkan surface descriptor defaults for this C API version.
mln_metal_surface_attach
Section titled “mln_metal_surface_attach”mln_status mln_metal_surface_attach(mln_map * map, const mln_metal_surface_descriptor * descriptor, mln_render_session ** out_session)Attaches a Metal native surface render target to a map.
The map may have at most one live render session. The session and every surface-session call are owner-thread affine to the map owner thread. The session retains descriptor->layer and optional descriptor->device. It renders into the layer and presents through it. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, descriptor is null or invalid, out_session is null, or *out_session is not null.
-
MLN_STATUS_INVALID_STATE when the map already has a render session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_UNSUPPORTED when Metal surface sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_vulkan_surface_attach
Section titled “mln_vulkan_surface_attach”mln_status mln_vulkan_surface_attach(mln_map * map, const mln_vulkan_surface_descriptor * descriptor, mln_render_session ** out_session)Attaches a Vulkan native surface render target to a map.
The map may have at most one live render session. The session and every surface-session call are owner-thread affine to the map owner thread. The session renders to descriptor->surface and presents through it. Vulkan handles are borrowed and must remain valid until the session is detached or destroyed. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, descriptor is null or invalid, out_session is null, or *out_session is not null.
-
MLN_STATUS_INVALID_STATE when the map already has a render session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_UNSUPPORTED when Vulkan surface sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_owned_texture_descriptor_default
Section titled “mln_owned_texture_descriptor_default”mln_owned_texture_descriptor mln_owned_texture_descriptor_default(void)Returns session-owned texture descriptor defaults for this C API version.
mln_metal_owned_texture_descriptor_default
Section titled “mln_metal_owned_texture_descriptor_default”mln_metal_owned_texture_descriptor mln_metal_owned_texture_descriptor_default(void)Returns Metal owned-texture descriptor defaults for this C API version.
mln_metal_borrowed_texture_descriptor_default
Section titled “mln_metal_borrowed_texture_descriptor_default”mln_metal_borrowed_texture_descriptor mln_metal_borrowed_texture_descriptor_default(void)Returns Metal borrowed-texture descriptor defaults for this C API version.
mln_vulkan_owned_texture_descriptor_default
Section titled “mln_vulkan_owned_texture_descriptor_default”mln_vulkan_owned_texture_descriptor mln_vulkan_owned_texture_descriptor_default(void)Returns Vulkan owned-texture descriptor defaults for this C API version.
mln_vulkan_borrowed_texture_descriptor_default
Section titled “mln_vulkan_borrowed_texture_descriptor_default”mln_vulkan_borrowed_texture_descriptor mln_vulkan_borrowed_texture_descriptor_default(void)Returns Vulkan borrowed-texture descriptor defaults for this C API version.
mln_texture_image_info_default
Section titled “mln_texture_image_info_default”mln_texture_image_info mln_texture_image_info_default(void)Returns texture image info defaults for this C API version.
mln_owned_texture_attach
Section titled “mln_owned_texture_attach”mln_status mln_owned_texture_attach(mln_map * map, const mln_owned_texture_descriptor * descriptor, mln_render_session ** out_session)Attaches an offscreen texture render target owned by the session to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session creates a backend-native offscreen target using the default headless backend for this build. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Use this target for still-image and CPU-readback workflows. Use backend-specific borrowed texture attach functions when a UI framework samples the rendered texture on its own graphics device.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, descriptor is null or invalid, out_session is null, or *out_session is not null.
-
MLN_STATUS_INVALID_STATE when the map already has a render session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_metal_owned_texture_attach
Section titled “mln_metal_owned_texture_attach”mln_status mln_metal_owned_texture_attach(mln_map * map, const mln_metal_owned_texture_descriptor * descriptor, mln_render_session ** out_session)Attaches a Metal texture render target owned by the session to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into a session-owned texture created on descriptor->device. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, descriptor is null or invalid, out_session is null, or *out_session is not null.
-
MLN_STATUS_INVALID_STATE when the map already has a render session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_UNSUPPORTED when Metal texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_metal_borrowed_texture_attach
Section titled “mln_metal_borrowed_texture_attach”mln_status mln_metal_borrowed_texture_attach(mln_map * map, const mln_metal_borrowed_texture_descriptor * descriptor, mln_render_session ** out_session)Attaches a Metal caller-owned texture render target to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into descriptor->texture. The caller owns the texture, keeps it valid until detach or destroy, and synchronizes any use outside this session. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, descriptor is null or invalid, out_session is null, or *out_session is not null.
-
MLN_STATUS_INVALID_STATE when the map already has a render session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_UNSUPPORTED when Metal borrowed texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_vulkan_owned_texture_attach
Section titled “mln_vulkan_owned_texture_attach”mln_status mln_vulkan_owned_texture_attach(mln_map * map, const mln_vulkan_owned_texture_descriptor * descriptor, mln_render_session ** out_session)Attaches a Vulkan texture render target owned by the session to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into a session-owned image created on descriptor->device. Vulkan handles are borrowed and must remain valid until detach or destroy. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, descriptor is null or invalid, out_session is null, or *out_session is not null.
-
MLN_STATUS_INVALID_STATE when the map already has a render session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_UNSUPPORTED when Vulkan texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_vulkan_borrowed_texture_attach
Section titled “mln_vulkan_borrowed_texture_attach”mln_status mln_vulkan_borrowed_texture_attach(mln_map * map, const mln_vulkan_borrowed_texture_descriptor * descriptor, mln_render_session ** out_session)Attaches a Vulkan caller-owned texture render target to a map.
The map may have at most one live render session. The session and every texture-session call are owner-thread affine to the map owner thread. The session renders into descriptor->image through descriptor->image_view. The caller owns the image and view, keeps them valid until detach or destroy, and handles queue-family ownership and synchronization outside this session. On success, *out_session receives a handle the caller destroys with mln_render_session_destroy().
Before each mln_render_session_render_update(), make the image available on descriptor->graphics_queue in descriptor->initial_layout and keep it out of concurrent use. The session submits rendering on that queue, waits for the submitted work to finish, and leaves the image in descriptor->final_layout before mln_render_session_render_update() returns.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, descriptor is null or invalid, out_session is null, or *out_session is not null.
-
MLN_STATUS_INVALID_STATE when the map already has a render session.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_UNSUPPORTED when Vulkan borrowed texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_texture_read_premultiplied_rgba8
Section titled “mln_texture_read_premultiplied_rgba8”mln_status mln_texture_read_premultiplied_rgba8(mln_render_session * session, uint8_t * out_data, size_t out_data_capacity, mln_texture_image_info * out_info)Reads the most recently rendered session-owned texture frame into caller-owned storage.
The copied image is premultiplied RGBA8 in physical pixels. The function fills out_info with the required byte length and image layout metadata. When out_data is null or out_data_capacity is too small, out_info is still filled and the function returns MLN_STATUS_INVALID_ARGUMENT.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when texture is null or not live, out_info is null, out_info->size is too small, out_data is null, or out_data_capacity is too small.
-
MLN_STATUS_INVALID_STATE when no rendered frame is available, the session is detached, a frame is currently acquired, or readback produces no image.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_UNSUPPORTED when session is not a texture session or when the texture session uses a caller-owned target.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_metal_owned_texture_acquire_frame
Section titled “mln_metal_owned_texture_acquire_frame”mln_status mln_metal_owned_texture_acquire_frame(mln_render_session * session, mln_metal_owned_texture_frame * out_frame)Acquires the most recently rendered Metal texture frame.
Use this function with sessions created by mln_metal_owned_texture_attach().
The returned texture and device pointers are borrowed and remain valid only until mln_metal_owned_texture_release_frame() is called for the same frame. While acquired, resize, render update, detach, destroy, and a second acquire return MLN_STATUS_INVALID_STATE.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when texture is null or not live, out_frame is null, or out_frame->size is too small.
-
MLN_STATUS_INVALID_STATE when no rendered frame is available, the session is detached, or another frame is currently acquired.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_UNSUPPORTED when texture is not a Metal owned texture session, or when Metal texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_vulkan_owned_texture_acquire_frame
Section titled “mln_vulkan_owned_texture_acquire_frame”mln_status mln_vulkan_owned_texture_acquire_frame(mln_render_session * session, mln_vulkan_owned_texture_frame * out_frame)Acquires the most recently rendered Vulkan texture frame.
Use this function with sessions created by mln_vulkan_owned_texture_attach().
The returned image, image view, and device pointers are borrowed and remain valid only until mln_vulkan_owned_texture_release_frame() is called for the same frame. While acquired, resize, render update, detach, destroy, and a second acquire return MLN_STATUS_INVALID_STATE.
On success, the image has been rendered and made available in the returned layout for shader sampling through the returned image view until release.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when texture is null or not live, out_frame is null, or out_frame->size is too small.
-
MLN_STATUS_INVALID_STATE when no rendered frame is available, the session is detached, or another frame is currently acquired.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_UNSUPPORTED when texture is not a Vulkan owned texture session, or when Vulkan texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_metal_owned_texture_release_frame
Section titled “mln_metal_owned_texture_release_frame”mln_status mln_metal_owned_texture_release_frame(mln_render_session * session, const mln_metal_owned_texture_frame * frame)Releases a previously acquired Metal texture frame.
The frame must be the active acquired frame for this session. A successful release ends the borrow of frame->texture and frame->device.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when texture is null or not live, frame is null, frame->size is too small, or the frame generation or frame_id does not match the active acquired frame.
-
MLN_STATUS_INVALID_STATE when no matching Metal frame is currently acquired.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_UNSUPPORTED when session is not a texture session or when Metal texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_vulkan_owned_texture_release_frame
Section titled “mln_vulkan_owned_texture_release_frame”mln_status mln_vulkan_owned_texture_release_frame(mln_render_session * session, const mln_vulkan_owned_texture_frame * frame)Releases a previously acquired Vulkan texture frame.
The frame must be the active acquired frame for this session. A successful release ends the borrow of frame->image, frame->image_view, and frame->device.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when texture is null or not live, frame is null, frame->size is too small, or the frame generation or frame_id does not match the active acquired frame.
-
MLN_STATUS_INVALID_STATE when no matching Vulkan frame is currently acquired.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_UNSUPPORTED when session is not a texture session or when Vulkan texture sessions are not supported by this build.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_create
Section titled “mln_map_projection_create”mln_status mln_map_projection_create(mln_map * map, mln_map_projection ** out_projection)Creates a standalone projection helper from the current map transform.
The helper owns projection and camera transform state only. It does not own style, resources, render targets, or runtime events. Use it to convert coordinates or compute camera fitting without changing the source map.
Creation snapshots the map’s transform. Later map camera or projection changes do not update the helper. The creating thread owns the helper and must call projection functions on that thread.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when map is null or not live, out_projection is null, or *out_projection is not null.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the map owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_destroy
Section titled “mln_map_projection_destroy”mln_status mln_map_projection_destroy(mln_map_projection * projection)Destroys a standalone projection helper.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when projection is null or not live.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the projection owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_get_camera
Section titled “mln_map_projection_get_camera”mln_status mln_map_projection_get_camera(mln_map_projection * projection, mln_camera_options * out_camera)Copies the current camera snapshot from a standalone projection helper.
On success, *out_camera is overwritten.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when projection is null or not live, out_camera is null, or out_camera->size is too small.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the projection owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_set_camera
Section titled “mln_map_projection_set_camera”mln_status mln_map_projection_set_camera(mln_map_projection * projection, const mln_camera_options * camera)Applies camera fields to a standalone projection helper.
Only fields indicated by camera->fields affect the helper.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when projection is null or not live, camera is null, camera->size is too small, or camera->fields contains unknown bits.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the projection owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_set_visible_coordinates
Section titled “mln_map_projection_set_visible_coordinates”mln_status mln_map_projection_set_visible_coordinates(mln_map_projection * projection, const mln_lat_lng * coordinates, size_t coordinate_count, mln_edge_insets padding)Updates a projection helper camera so coordinates are visible within padding.
The coordinates array is borrowed for the duration of this call and is not retained. Use mln_map_projection_get_camera() after this call to read the computed camera.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when projection is null or not live, coordinates is null, coordinate_count is 0, padding contains negative or non-finite values, or any coordinate contains invalid latitude or longitude values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the projection owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_set_visible_geometry
Section titled “mln_map_projection_set_visible_geometry”mln_status mln_map_projection_set_visible_geometry(mln_map_projection * projection, const mln_geometry * geometry, mln_edge_insets padding)Updates a projection helper camera so geometry coordinates are visible.
The geometry descriptor graph, including all nested pointers, is borrowed for the duration of this call and is not retained. Use mln_map_projection_get_camera() after this call to read the computed camera. Empty geometry objects and geometry collections with no coordinates are invalid for camera fitting.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when projection is null or not live, geometry is null or invalid, padding contains negative or non-finite values, or the geometry contains no coordinates.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the projection owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_pixel_for_lat_lng
Section titled “mln_map_projection_pixel_for_lat_lng”mln_status mln_map_projection_pixel_for_lat_lng(mln_map_projection * projection, mln_lat_lng coordinate, mln_screen_point * out_point)Converts a geographic world coordinate using a standalone projection helper.
The output point uses logical map pixels with an origin at the top-left of the helper viewport.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when projection is null or not live, out_point is null, or coordinate contains invalid latitude or longitude values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the projection owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_map_projection_lat_lng_for_pixel
Section titled “mln_map_projection_lat_lng_for_pixel”mln_status mln_map_projection_lat_lng_for_pixel(mln_map_projection * projection, mln_screen_point point, mln_lat_lng * out_coordinate)Converts a screen point using a standalone projection helper.
The input point uses logical map pixels with an origin at the top-left of the helper viewport.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when projection is null or not live, out_coordinate is null, or point contains non-finite values.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the projection owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_projected_meters_for_lat_lng
Section titled “mln_projected_meters_for_lat_lng”mln_status mln_projected_meters_for_lat_lng(mln_lat_lng coordinate, mln_projected_meters * out_meters)Converts a geographic coordinate to spherical Mercator projected meters.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when out_meters is null or coordinate contains invalid latitude or longitude values.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_lat_lng_for_projected_meters
Section titled “mln_lat_lng_for_projected_meters”mln_status mln_lat_lng_for_projected_meters(mln_projected_meters meters, mln_lat_lng * out_coordinate)Converts spherical Mercator projected meters to a geographic coordinate.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when out_coordinate is null or meters contains non-finite values.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_thread_last_error_message
Section titled “mln_thread_last_error_message”const char * mln_thread_last_error_message(void)Returns the last thread-local diagnostic message.
The returned string is empty when no diagnostic is available. The pointer is owned by the C API and remains valid until the next C API call on the same thread that writes a thread-local diagnostic.
mln_render_session_resize
Section titled “mln_render_session_resize”mln_status mln_render_session_resize(mln_render_session * session, uint32_t width, uint32_t height, double scale_factor)Resizes an attached render session.
Width and height are logical map dimensions. The scale_factor value maps them to physical backend pixels.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live, dimensions are zero, scale_factor is non-positive or non-finite, or scaled dimensions are too large.
-
MLN_STATUS_INVALID_STATE when the session is detached or a texture frame is currently acquired.
-
MLN_STATUS_UNSUPPORTED when resizing is not supported by the session kind or mode, such as a caller-owned borrowed texture target.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_render_update
Section titled “mln_render_session_render_update”mln_status mln_render_session_render_update(mln_render_session * session)Processes the latest map render update for an attached render session.
Surface sessions render and present through their native surface. Texture sessions render into their texture target.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live.
-
MLN_STATUS_INVALID_STATE when no render update is available or the session is detached, or a texture frame is currently acquired.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_detach
Section titled “mln_render_session_detach”mln_status mln_render_session_detach(mln_render_session * session)Detaches backend-bound render resources from the map while keeping the session handle live for destruction.
After detach, resize, render, readback, acquire, and renderer maintenance operations return MLN_STATUS_INVALID_STATE.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live.
-
MLN_STATUS_INVALID_STATE when already detached or a texture frame is acquired.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_destroy
Section titled “mln_render_session_destroy”mln_status mln_render_session_destroy(mln_render_session * session)Destroys a render session handle.
If the session is still attached, this function detaches it first.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live.
-
MLN_STATUS_INVALID_STATE when a texture frame is acquired.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_reduce_memory_use
Section titled “mln_render_session_reduce_memory_use”mln_status mln_render_session_reduce_memory_use(mln_render_session * session)Asks the session renderer to release cached resources where possible.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_clear_data
Section titled “mln_render_session_clear_data”mln_status mln_render_session_clear_data(mln_render_session * session)Clears renderer data for the session.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_dump_debug_logs
Section titled “mln_render_session_dump_debug_logs”mln_status mln_render_session_dump_debug_logs(mln_render_session * session)Dumps renderer debug logs for the session through MapLibre Native logging.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_set_feature_state
Section titled “mln_render_session_set_feature_state”mln_status mln_render_session_set_feature_state(mln_render_session * session, const mln_feature_state_selector * selector, const mln_json_value * state)Sets per-feature state on a render source for this render session.
The session renderer must already exist; call mln_render_session_render_update() once after loading style data before using feature state. selector->source_id and selector->feature_id are borrowed for the duration of the call. state must be a JSON object descriptor and is copied before return. The accepted command requests a map repaint.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live, selector is null or invalid, selector lacks MLN_FEATURE_STATE_SELECTOR_FEATURE_ID, state is null or not an object, state contains invalid descriptor data, or state contains non-finite numbers.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_get_feature_state
Section titled “mln_render_session_get_feature_state”mln_status mln_render_session_get_feature_state(mln_render_session * session, const mln_feature_state_selector * selector, mln_json_snapshot ** out_state)Copies per-feature state from a render source in this render session.
The session renderer must already exist. selector->source_id and selector->feature_id are borrowed for the duration of the call. On success, *out_state receives an owned snapshot handle. Use mln_json_snapshot_get() to borrow its root JSON object value, and destroy it with mln_json_snapshot_destroy(). Missing native source or feature state is reported as an empty object snapshot.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live, selector is null or invalid, selector lacks MLN_FEATURE_STATE_SELECTOR_FEATURE_ID, out_state is null, or *out_state is not null.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_render_session_remove_feature_state
Section titled “mln_render_session_remove_feature_state”mln_status mln_render_session_remove_feature_state(mln_render_session * session, const mln_feature_state_selector * selector)Removes per-feature state from a render source in this render session.
The session renderer must already exist. selector->source_id is required. selector->feature_id and selector->state_key are optional. Passing both removes one state key from one feature. Passing only feature_id removes all state for that feature. Passing neither removes all feature state for the source/source-layer. The accepted command requests a map repaint.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when session is null or not live, selector is null or invalid, or selector has MLN_FEATURE_STATE_SELECTOR_STATE_KEY without MLN_FEATURE_STATE_SELECTOR_FEATURE_ID.
-
MLN_STATUS_INVALID_STATE when the session is detached or no renderer has been created for the session yet.
-
MLN_STATUS_WRONG_THREAD when called from a thread other than the session owner thread.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_json_snapshot_get
Section titled “mln_json_snapshot_get”mln_status mln_json_snapshot_get(const mln_json_snapshot * snapshot, const mln_json_value ** out_value)Borrows the root JSON value from a snapshot handle.
The returned pointer and all nested pointers remain valid until the snapshot is destroyed.
Returns:
-
MLN_STATUS_OK on success.
-
MLN_STATUS_INVALID_ARGUMENT when snapshot is null or not live, or out_value is null.
-
MLN_STATUS_NATIVE_ERROR when an internal exception is converted to status.
mln_json_snapshot_destroy
Section titled “mln_json_snapshot_destroy”void mln_json_snapshot_destroy(mln_json_snapshot * snapshot)Destroys a JSON snapshot handle. Null is accepted as a no-op.
mln_vec3
Section titled “mln_vec3”#include <map.h>Three-component vector used by free camera options.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
double | x | |
double | y | |
double | z |
double xdouble ydouble zmln_feature
Section titled “mln_feature”#include <map.h>GeoJSON feature input descriptor graph.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
const mln_geometry * | geometry | Geometry descriptor. Must not be null. Use MLN_GEOMETRY_TYPE_EMPTY for an empty geometry. |
const mln_json_member * | properties | Property member views. May be null only when property_count is 0. |
size_t | property_count | |
uint32_t | identifier_type | One of mln_feature_identifier_type. |
uint64_t | uint_value | |
int64_t | int_value | |
double | double_value | |
mln_string_view | string_value | |
union mln_feature | identifier |
uint32_t sizegeometry
Section titled “geometry”const mln_geometry * geometryGeometry descriptor. Must not be null. Use MLN_GEOMETRY_TYPE_EMPTY for an empty geometry.
properties
Section titled “properties”const mln_json_member * propertiesProperty member views. May be null only when property_count is 0.
property_count
Section titled “property_count”size_t property_countidentifier_type
Section titled “identifier_type”uint32_t identifier_typeOne of mln_feature_identifier_type.
uint_value
Section titled “uint_value”uint64_t uint_valueint_value
Section titled “int_value”int64_t int_valuedouble_value
Section titled “double_value”double double_valuestring_value
Section titled “string_value”mln_string_view string_valueidentifier
Section titled “identifier”union mln_feature identifiermln_geojson
Section titled “mln_geojson”#include <map.h>GeoJSON geometry, feature, or feature collection input descriptor graph. Nested geometry and property descriptors share the 64-depth descriptor limit documented on mln_geometry and mln_json_value.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | One of mln_geojson_type. |
const mln_geometry * | geometry | Geometry descriptor selected by MLN_GEOJSON_TYPE_GEOMETRY. Must not be null. |
const mln_feature * | feature | Feature descriptor selected by MLN_GEOJSON_TYPE_FEATURE. Must not be null. |
mln_feature_collection | feature_collection | |
union mln_geojson | data |
uint32_t sizeuint32_t typeOne of mln_geojson_type.
geometry
Section titled “geometry”const mln_geometry * geometryGeometry descriptor selected by MLN_GEOJSON_TYPE_GEOMETRY. Must not be null.
feature
Section titled “feature”const mln_feature * featureFeature descriptor selected by MLN_GEOJSON_TYPE_FEATURE. Must not be null.
feature_collection
Section titled “feature_collection”mln_feature_collection feature_collectionunion mln_geojson datamln_geometry
Section titled “mln_geometry”#include <map.h>MapLibre geometry input descriptor graph.
Geometry coordinates use mln_lat_lng for consistency with the rest of the C API. They are converted to native geometry points as longitude/latitude. A root geometry descriptor starts at nesting depth 0. Status-returning functions reject geometry collection children past depth 64 with MLN_STATUS_INVALID_ARGUMENT.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | One of mln_geometry_type. |
mln_lat_lng | point | |
mln_coordinate_span | line_string | |
mln_polygon_geometry | polygon | |
mln_coordinate_span | multi_point | |
mln_multi_line_geometry | multi_line_string | |
mln_multi_polygon_geometry | multi_polygon | |
mln_geometry_collection | geometry_collection | |
union mln_geometry | data |
uint32_t sizeuint32_t typeOne of mln_geometry_type.
mln_lat_lng pointline_string
Section titled “line_string”mln_coordinate_span line_stringpolygon
Section titled “polygon”mln_polygon_geometry polygonmulti_point
Section titled “multi_point”mln_coordinate_span multi_pointmulti_line_string
Section titled “multi_line_string”mln_multi_line_geometry multi_line_stringmulti_polygon
Section titled “multi_polygon”mln_multi_polygon_geometry multi_polygongeometry_collection
Section titled “geometry_collection”mln_geometry_collection geometry_collectionunion mln_geometry datamln_lat_lng
Section titled “mln_lat_lng”#include <map.h>Geographic coordinate in degrees used by map and projection APIs.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
double | latitude | Latitude in degrees. Input latitude must be finite and within [-90, 90]. |
double | longitude | Longitude in degrees. Input longitude must be finite. |
latitude
Section titled “latitude”double latitudeLatitude in degrees. Input latitude must be finite and within [-90, 90].
longitude
Section titled “longitude”double longitudeLongitude in degrees. Input longitude must be finite.
mln_tile_id
Section titled “mln_tile_id”#include <runtime.h>Overscaled tile identity reported in tile observer events.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | overscaled_z | |
int32_t | wrap | |
uint32_t | canonical_z | |
uint32_t | canonical_x | |
uint32_t | canonical_y |
overscaled_z
Section titled “overscaled_z”uint32_t overscaled_zint32_t wrapcanonical_z
Section titled “canonical_z”uint32_t canonical_zcanonical_x
Section titled “canonical_x”uint32_t canonical_xcanonical_y
Section titled “canonical_y”uint32_t canonical_ymln_quaternion
Section titled “mln_quaternion”#include <map.h>Quaternion stored as x, y, z, w components.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
double | x | |
double | y | |
double | z | |
double | w |
double xdouble ydouble zdouble wmln_json_array
Section titled “mln_json_array”#include <map.h>JSON value array view.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_json_value * | values | Values. Null only when value_count is 0. |
size_t | value_count |
values
Section titled “values”const mln_json_value * valuesValues. Null only when value_count is 0.
value_count
Section titled “value_count”size_t value_countmln_json_value
Section titled “mln_json_value”#include <map.h>JSON-like value input descriptor graph used by feature properties/states.
Input functions reject NaN and infinities for double values because JSON and GeoJSON numbers are finite. A root JSON value descriptor starts at nesting depth 0. Status-returning functions reject array/object children past depth 64 with MLN_STATUS_INVALID_ARGUMENT.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | One of mln_json_value_type. |
bool | bool_value | |
uint64_t | uint_value | |
int64_t | int_value | |
double | double_value | |
mln_string_view | string_value | |
mln_json_array | array_value | |
mln_json_object | object_value | |
union mln_json_value | data |
uint32_t sizeuint32_t typeOne of mln_json_value_type.
bool_value
Section titled “bool_value”bool bool_valueuint_value
Section titled “uint_value”uint64_t uint_valueint_value
Section titled “int_value”int64_t int_valuedouble_value
Section titled “double_value”double double_valuestring_value
Section titled “string_value”mln_string_view string_valuearray_value
Section titled “array_value”mln_json_array array_valueobject_value
Section titled “object_value”mln_json_object object_valueunion mln_json_value datamln_screen_box
Section titled “mln_screen_box”#include <query.h>Screen-space box in logical map pixels.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
mln_screen_point | min | |
mln_screen_point | max |
mln_screen_point minmln_screen_point maxmln_edge_insets
Section titled “mln_edge_insets”#include <map.h>Screen-space inset in logical map pixels.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
double | top | |
double | left | |
double | bottom | |
double | right |
double topdouble leftbottom
Section titled “bottom”double bottomdouble rightmln_json_member
Section titled “mln_json_member”#include <map.h>JSON object member view.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
mln_string_view | key | |
const mln_json_value * | value | Value descriptor. Must not be null. |
mln_string_view keyconst mln_json_value * valueValue descriptor. Must not be null.
mln_json_object
Section titled “mln_json_object”#include <map.h>JSON object member array view.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_json_member * | members | Members. Null only when member_count is 0. |
size_t | member_count |
members
Section titled “members”const mln_json_member * membersMembers. Null only when member_count is 0.
member_count
Section titled “member_count”size_t member_countmln_map_options
Section titled “mln_map_options”#include <map.h>Options used when creating a map.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | |
uint32_t | height | |
double | scale_factor | |
uint32_t | map_mode | One of mln_map_mode. Defaults to MLN_MAP_MODE_CONTINUOUS. |
uint32_t sizeuint32_t widthheight
Section titled “height”uint32_t heightscale_factor
Section titled “scale_factor”double scale_factormap_mode
Section titled “map_mode”uint32_t map_modeOne of mln_map_mode. Defaults to MLN_MAP_MODE_CONTINUOUS.
mln_string_view
Section titled “mln_string_view”#include <map.h>UTF-8 text view. The pointer may be null only when size is 0.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const char * | data | UTF-8 bytes. Null only when size is 0. |
size_t | size |
const char * dataUTF-8 bytes. Null only when size is 0.
size_t sizemln_unit_bezier
Section titled “mln_unit_bezier”#include <map.h>Cubic easing curve for animated camera transitions.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
double | x1 | |
double | y1 | |
double | x2 | |
double | y2 |
double x1double y1double x2double y2mln_screen_point
Section titled “mln_screen_point”#include <map.h>Screen-space point in logical map pixels.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
double | x | |
double | y |
double xdouble ymln_bound_options
Section titled “mln_bound_options”#include <map.h>Optional map camera constraint fields.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
mln_lat_lng_bounds | bounds | |
double | min_zoom | |
double | max_zoom | |
double | min_pitch | |
double | max_pitch |
uint32_t sizefields
Section titled “fields”uint32_t fieldsbounds
Section titled “bounds”mln_lat_lng_bounds boundsmin_zoom
Section titled “min_zoom”double min_zoommax_zoom
Section titled “max_zoom”double max_zoommin_pitch
Section titled “min_pitch”double min_pitchmax_pitch
Section titled “max_pitch”double max_pitchmln_runtime_event
Section titled “mln_runtime_event”#include <runtime.h>Event payload returned by mln_runtime_poll_event().
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | |
uint32_t | source_type | One of mln_runtime_event_source_type. |
void * | source | Source handle for this event. For map-originated events, this is an mln_map*. For runtime-originated events, this is an mln_runtime*. Borrowed; valid while the source handle remains live. |
int32_t | code | |
uint32_t | payload_type | One of mln_runtime_event_payload_type. |
const void * | payload | Borrowed payload selected by payload_type. Null when payload_size is 0. |
size_t | payload_size | Number of bytes in payload. |
const char * | message | Borrowed event message bytes. Null when message_size is 0. |
size_t | message_size | Number of bytes in message, excluding the trailing null terminator. |
uint32_t sizeuint32_t typesource_type
Section titled “source_type”uint32_t source_typeOne of mln_runtime_event_source_type.
source
Section titled “source”void * sourceSource handle for this event. For map-originated events, this is an mln_map*. For runtime-originated events, this is an mln_runtime*. Borrowed; valid while the source handle remains live.
int32_t codepayload_type
Section titled “payload_type”uint32_t payload_typeOne of mln_runtime_event_payload_type.
payload
Section titled “payload”const void * payloadBorrowed payload selected by payload_type. Null when payload_size is 0.
payload_size
Section titled “payload_size”size_t payload_sizeNumber of bytes in payload.
message
Section titled “message”const char * messageBorrowed event message bytes. Null when message_size is 0.
message_size
Section titled “message_size”size_t message_sizeNumber of bytes in message, excluding the trailing null terminator.
mln_camera_options
Section titled “mln_camera_options”#include <map.h>Camera fields used for snapshots and camera commands.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
double | latitude | |
double | longitude | |
double | center_altitude | |
mln_edge_insets | padding | |
mln_screen_point | anchor | |
double | zoom | |
double | bearing | |
double | pitch | |
double | roll | |
double | field_of_view |
uint32_t sizefields
Section titled “fields”uint32_t fieldslatitude
Section titled “latitude”double latitudelongitude
Section titled “longitude”double longitudecenter_altitude
Section titled “center_altitude”double center_altitudepadding
Section titled “padding”mln_edge_insets paddinganchor
Section titled “anchor”mln_screen_point anchordouble zoombearing
Section titled “bearing”double bearingdouble pitchdouble rollfield_of_view
Section titled “field_of_view”double field_of_viewmln_coordinate_span
Section titled “mln_coordinate_span”#include <map.h>Coordinate array view. Coordinates are latitude/longitude pairs.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_lat_lng * | coordinates | Coordinates. Null only when coordinate_count is 0. |
size_t | coordinate_count |
coordinates
Section titled “coordinates”const mln_lat_lng * coordinatesCoordinates. Null only when coordinate_count is 0.
coordinate_count
Section titled “coordinate_count”size_t coordinate_countmln_lat_lng_bounds
Section titled “mln_lat_lng_bounds”#include <map.h>Geographic bounds in degrees.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
mln_lat_lng | southwest | |
mln_lat_lng | northeast |
southwest
Section titled “southwest”mln_lat_lng southwestnortheast
Section titled “northeast”mln_lat_lng northeastmln_projection_mode
Section titled “mln_projection_mode”#include <map.h>MapLibre axonometric rendering options used for snapshots and commands.
MapLibre Native names this native type ProjectionMode. It controls the live map render transform, not the geographic coordinate model.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
bool | axonometric | Enables a non-perspective axonometric render transform. |
double | x_skew | Native x-skew factor used by the axonometric transform. |
double | y_skew | Native y-skew factor used by the axonometric transform. |
uint32_t sizefields
Section titled “fields”uint32_t fieldsaxonometric
Section titled “axonometric”bool axonometricEnables a non-perspective axonometric render transform.
x_skew
Section titled “x_skew”double x_skewNative x-skew factor used by the axonometric transform.
y_skew
Section titled “y_skew”double y_skewNative y-skew factor used by the axonometric transform.
mln_queried_feature
Section titled “mln_queried_feature”#include <query.h>One copied query result feature.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
mln_feature | feature | GeoJSON feature descriptor. Nested pointers are result-owned. |
mln_string_view | source_id | Native render source ID when available. |
mln_string_view | source_layer_id | Native source layer ID when available. |
const mln_json_value * | state | Rendered feature state when available. |
uint32_t sizefields
Section titled “fields”uint32_t fieldsfeature
Section titled “feature”mln_feature featureGeoJSON feature descriptor. Nested pointers are result-owned.
source_id
Section titled “source_id”mln_string_view source_idNative render source ID when available.
source_layer_id
Section titled “source_layer_id”mln_string_view source_layer_idNative source layer ID when available.
const mln_json_value * stateRendered feature state when available.
mln_rendering_stats
Section titled “mln_rendering_stats”#include <runtime.h>Rendering statistics reported in MLN_RUNTIME_EVENT_PAYLOAD_RENDER_FRAME.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
double | encoding_time | Frame CPU encoding time in seconds. |
double | rendering_time | Frame CPU rendering time in seconds. |
int64_t | frame_count | Number of frames rendered by the native renderer. |
int64_t | draw_call_count | Draw calls executed during the most recent frame. |
int64_t | total_draw_call_count | Total draw calls executed by the native renderer. |
uint32_t sizeencoding_time
Section titled “encoding_time”double encoding_timeFrame CPU encoding time in seconds.
rendering_time
Section titled “rendering_time”double rendering_timeFrame CPU rendering time in seconds.
frame_count
Section titled “frame_count”int64_t frame_countNumber of frames rendered by the native renderer.
draw_call_count
Section titled “draw_call_count”int64_t draw_call_countDraw calls executed during the most recent frame.
total_draw_call_count
Section titled “total_draw_call_count”int64_t total_draw_call_countTotal draw calls executed by the native renderer.
mln_runtime_options
Section titled “mln_runtime_options”Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | flags | |
const char * | asset_path | Filesystem root for asset:// URLs. Copied during runtime creation. |
const char * | cache_path | Cache database path. Copied during runtime creation. |
uint64_t | maximum_cache_size | Maximum ambient cache size in bytes when the matching flag is set. |
uint32_t sizeuint32_t flagsasset_path
Section titled “asset_path”const char * asset_pathFilesystem root for asset:// URLs. Copied during runtime creation.
cache_path
Section titled “cache_path”const char * cache_pathCache database path. Copied during runtime creation.
maximum_cache_size
Section titled “maximum_cache_size”uint64_t maximum_cache_sizeMaximum ambient cache size in bytes when the matching flag is set.
mln_polygon_geometry
Section titled “mln_polygon_geometry”#include <map.h>Polygon ring array view. Each ring is a coordinate span.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_coordinate_span * | rings | Rings. Null only when ring_count is 0. |
size_t | ring_count |
const mln_coordinate_span * ringsRings. Null only when ring_count is 0.
ring_count
Section titled “ring_count”size_t ring_countmln_projected_meters
Section titled “mln_projected_meters”#include <map.h>Lower-level Spherical Mercator projected-meter coordinate.
Map coordinate conversion APIs use mln_lat_lng. This type is only for Mercator helper functions.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
double | northing | Distance measured northward from the equator, in meters. |
double | easting | Distance measured eastward from the prime meridian, in meters. |
northing
Section titled “northing”double northingDistance measured northward from the equator, in meters.
easting
Section titled “easting”double eastingDistance measured eastward from the prime meridian, in meters.
mln_resource_request
Section titled “mln_resource_request”Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
const char * | url | |
uint32_t | kind | |
uint32_t | loading_method | |
uint32_t | priority | |
uint32_t | usage | |
uint32_t | storage_policy | |
bool | has_range | |
uint64_t | range_start | |
uint64_t | range_end | |
bool | has_prior_modified | |
int64_t | prior_modified_unix_ms | |
bool | has_prior_expires | |
int64_t | prior_expires_unix_ms | |
const char * | prior_etag | |
const uint8_t * | prior_data | |
size_t | prior_data_size |
uint32_t sizeconst char * urluint32_t kindloading_method
Section titled “loading_method”uint32_t loading_methodpriority
Section titled “priority”uint32_t priorityuint32_t usagestorage_policy
Section titled “storage_policy”uint32_t storage_policyhas_range
Section titled “has_range”bool has_rangerange_start
Section titled “range_start”uint64_t range_startrange_end
Section titled “range_end”uint64_t range_endhas_prior_modified
Section titled “has_prior_modified”bool has_prior_modifiedprior_modified_unix_ms
Section titled “prior_modified_unix_ms”int64_t prior_modified_unix_mshas_prior_expires
Section titled “has_prior_expires”bool has_prior_expiresprior_expires_unix_ms
Section titled “prior_expires_unix_ms”int64_t prior_expires_unix_msprior_etag
Section titled “prior_etag”const char * prior_etagprior_data
Section titled “prior_data”const uint8_t * prior_dataprior_data_size
Section titled “prior_data_size”size_t prior_data_sizemln_animation_options
Section titled “mln_animation_options”#include <map.h>Optional animation controls for camera transitions.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
double | duration_ms | Duration in milliseconds. Must be finite and non-negative. Values that would overflow MapLibre Native’s internal duration are invalid. |
double | velocity | Average flyTo velocity in screenfuls per second. Must be positive. |
double | min_zoom | Peak zoom for flyTo transitions. |
mln_unit_bezier | easing |
uint32_t sizefields
Section titled “fields”uint32_t fieldsduration_ms
Section titled “duration_ms”double duration_msDuration in milliseconds. Must be finite and non-negative. Values that would overflow MapLibre Native’s internal duration are invalid.
velocity
Section titled “velocity”double velocityAverage flyTo velocity in screenfuls per second. Must be positive.
min_zoom
Section titled “min_zoom”double min_zoomPeak zoom for flyTo transitions.
easing
Section titled “easing”mln_unit_bezier easingmln_map_tile_options
Section titled “mln_map_tile_options”#include <map.h>Tile prefetch and LOD tuning controls.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
uint32_t | prefetch_zoom_delta | Native uint8_t prefetch zoom delta. |
double | lod_min_radius | |
double | lod_scale | |
double | lod_pitch_threshold | |
double | lod_zoom_shift | |
uint32_t | lod_mode | One of mln_tile_lod_mode. |
uint32_t sizefields
Section titled “fields”uint32_t fieldsprefetch_zoom_delta
Section titled “prefetch_zoom_delta”uint32_t prefetch_zoom_deltaNative uint8_t prefetch zoom delta.
lod_min_radius
Section titled “lod_min_radius”double lod_min_radiuslod_scale
Section titled “lod_scale”double lod_scalelod_pitch_threshold
Section titled “lod_pitch_threshold”double lod_pitch_thresholdlod_zoom_shift
Section titled “lod_zoom_shift”double lod_zoom_shiftlod_mode
Section titled “lod_mode”uint32_t lod_modeOne of mln_tile_lod_mode.
mln_resource_provider
Section titled “mln_resource_provider”Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
mln_resource_provider_callback | callback | |
void * | user_data |
uint32_t sizecallback
Section titled “callback”mln_resource_provider_callback callbackuser_data
Section titled “user_data”void * user_datamln_resource_response
Section titled “mln_resource_response”Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | status | |
uint32_t | error_reason | |
const uint8_t * | bytes | Response bytes. May be null only when byte_count is 0. |
size_t | byte_count | |
const char * | error_message | |
bool | must_revalidate | |
bool | has_modified | |
int64_t | modified_unix_ms | |
bool | has_expires | |
int64_t | expires_unix_ms | |
const char * | etag | |
bool | has_retry_after | |
int64_t | retry_after_unix_ms |
uint32_t sizestatus
Section titled “status”uint32_t statuserror_reason
Section titled “error_reason”uint32_t error_reasonconst uint8_t * bytesResponse bytes. May be null only when byte_count is 0.
byte_count
Section titled “byte_count”size_t byte_counterror_message
Section titled “error_message”const char * error_messagemust_revalidate
Section titled “must_revalidate”bool must_revalidatehas_modified
Section titled “has_modified”bool has_modifiedmodified_unix_ms
Section titled “modified_unix_ms”int64_t modified_unix_mshas_expires
Section titled “has_expires”bool has_expiresexpires_unix_ms
Section titled “expires_unix_ms”int64_t expires_unix_msconst char * etaghas_retry_after
Section titled “has_retry_after”bool has_retry_afterretry_after_unix_ms
Section titled “retry_after_unix_ms”int64_t retry_after_unix_msmln_style_image_info
Section titled “mln_style_image_info”#include <style.h>Fixed metadata for one runtime style image.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | |
uint32_t | height | |
uint32_t | stride | Native copied images are exposed as tightly packed premultiplied RGBA8. |
size_t | byte_length | |
float | pixel_ratio | |
bool | sdf |
uint32_t sizeuint32_t widthheight
Section titled “height”uint32_t heightstride
Section titled “stride”uint32_t strideNative copied images are exposed as tightly packed premultiplied RGBA8.
byte_length
Section titled “byte_length”size_t byte_lengthpixel_ratio
Section titled “pixel_ratio”float pixel_ratiobool sdfmln_canonical_tile_id
Section titled “mln_canonical_tile_id”#include <style.h>Canonical tile identity used by custom geometry source callbacks.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | z | |
uint32_t | x | |
uint32_t | y |
uint32_t zuint32_t xuint32_t ymln_feature_collection
Section titled “mln_feature_collection”#include <map.h>Feature collection view.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_feature * | features | Features. Null only when feature_count is 0. |
size_t | feature_count |
features
Section titled “features”const mln_feature * featuresFeatures. Null only when feature_count is 0.
feature_count
Section titled “feature_count”size_t feature_countmln_resource_transform
Section titled “mln_resource_transform”Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
mln_resource_transform_callback | callback | |
void * | user_data |
uint32_t sizecallback
Section titled “callback”mln_resource_transform_callback callbackuser_data
Section titled “user_data”void * user_datamln_style_source_info
Section titled “mln_style_source_info”#include <style.h>Fixed source metadata returned by mln_map_get_style_source_info().
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | One of mln_style_source_type. |
size_t | id_size | Source ID byte length, excluding any null terminator. |
bool | is_volatile | |
bool | has_attribution | |
size_t | attribution_size | Attribution byte length, excluding any null terminator. |
uint32_t sizeuint32_t typeOne of mln_style_source_type.
id_size
Section titled “id_size”size_t id_sizeSource ID byte length, excluding any null terminator.
is_volatile
Section titled “is_volatile”bool is_volatilehas_attribution
Section titled “has_attribution”bool has_attributionattribution_size
Section titled “attribution_size”size_t attribution_sizeAttribution byte length, excluding any null terminator.
mln_camera_fit_options
Section titled “mln_camera_fit_options”#include <map.h>Optional fitting controls for camera-for-viewport queries.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
mln_edge_insets | padding | |
double | bearing | |
double | pitch |
uint32_t sizefields
Section titled “fields”uint32_t fieldspadding
Section titled “padding”mln_edge_insets paddingbearing
Section titled “bearing”double bearingdouble pitchmln_geometry_collection
Section titled “mln_geometry_collection”#include <map.h>Geometry collection view.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_geometry * | geometries | Child geometries. Null only when geometry_count is 0. |
size_t | geometry_count |
geometries
Section titled “geometries”const mln_geometry * geometriesChild geometries. Null only when geometry_count is 0.
geometry_count
Section titled “geometry_count”size_t geometry_countmln_screen_line_string
Section titled “mln_screen_line_string”#include <query.h>Screen-space line string in logical map pixels.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_screen_point * | points | Points. Null only when point_count is 0. |
size_t | point_count |
points
Section titled “points”const mln_screen_point * pointsPoints. Null only when point_count is 0.
point_count
Section titled “point_count”size_t point_countmln_texture_image_info
Section titled “mln_texture_image_info”#include <texture.h>CPU image readback metadata for a texture session frame.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Physical image width in device pixels. |
uint32_t | height | Physical image height in device pixels. |
uint32_t | stride | Bytes per image row. |
size_t | byte_length | Required output buffer byte length. |
uint32_t sizeuint32_t widthPhysical image width in device pixels.
height
Section titled “height”uint32_t heightPhysical image height in device pixels.
stride
Section titled “stride”uint32_t strideBytes per image row.
byte_length
Section titled “byte_length”size_t byte_lengthRequired output buffer byte length.
mln_free_camera_options
Section titled “mln_free_camera_options”#include <map.h>Free camera position and orientation in MapLibre Native camera space.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
mln_vec3 | position | |
mln_quaternion | orientation |
uint32_t sizefields
Section titled “fields”uint32_t fieldsposition
Section titled “position”mln_vec3 positionorientation
Section titled “orientation”mln_quaternion orientationmln_multi_line_geometry
Section titled “mln_multi_line_geometry”#include <map.h>Multi-line geometry view. Each line is a coordinate span.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_coordinate_span * | lines | Lines. Null only when line_count is 0. |
size_t | line_count |
const mln_coordinate_span * linesLines. Null only when line_count is 0.
line_count
Section titled “line_count”size_t line_countmln_offline_region_info
Section titled “mln_offline_region_info”#include <map.h>Region data view returned from a snapshot or list handle.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
mln_offline_region_id | id | |
mln_offline_region_definition | definition | |
const uint8_t * | metadata | Metadata bytes. Valid until the owner snapshot/list is destroyed. |
size_t | metadata_size |
uint32_t sizemln_offline_region_id iddefinition
Section titled “definition”mln_offline_region_definition definitionmetadata
Section titled “metadata”const uint8_t * metadataMetadata bytes. Valid until the owner snapshot/list is destroyed.
metadata_size
Section titled “metadata_size”size_t metadata_sizemln_style_image_options
Section titled “mln_style_image_options”#include <style.h>Options for runtime style images.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
float | pixel_ratio | Sprite pixel ratio. Defaults to 1. |
bool | sdf | Whether the image is a signed distance field icon. Defaults to false. |
uint32_t sizefields
Section titled “fields”uint32_t fieldspixel_ratio
Section titled “pixel_ratio”float pixel_ratioSprite pixel ratio. Defaults to 1.
bool sdfWhether the image is a signed distance field icon. Defaults to false.
mln_map_viewport_options
Section titled “mln_map_viewport_options”#include <map.h>Live map viewport and render-transform controls.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
uint32_t | north_orientation | One of mln_north_orientation. |
uint32_t | constrain_mode | One of mln_constrain_mode. |
uint32_t | viewport_mode | One of mln_viewport_mode. |
mln_edge_insets | frustum_offset |
uint32_t sizefields
Section titled “fields”uint32_t fieldsnorth_orientation
Section titled “north_orientation”uint32_t north_orientationOne of mln_north_orientation.
constrain_mode
Section titled “constrain_mode”uint32_t constrain_modeOne of mln_constrain_mode.
viewport_mode
Section titled “viewport_mode”uint32_t viewport_modeOne of mln_viewport_mode.
frustum_offset
Section titled “frustum_offset”mln_edge_insets frustum_offsetmln_offline_region_status
Section titled “mln_offline_region_status”#include <runtime.h>Offline region status snapshot.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | download_state | One of mln_offline_region_download_state. |
uint64_t | completed_resource_count | |
uint64_t | completed_resource_size | |
uint64_t | completed_tile_count | |
uint64_t | required_tile_count | |
uint64_t | completed_tile_size | |
uint64_t | required_resource_count | |
bool | required_resource_count_is_precise | |
bool | complete |
uint32_t sizedownload_state
Section titled “download_state”uint32_t download_stateOne of mln_offline_region_download_state.
completed_resource_count
Section titled “completed_resource_count”uint64_t completed_resource_countcompleted_resource_size
Section titled “completed_resource_size”uint64_t completed_resource_sizecompleted_tile_count
Section titled “completed_tile_count”uint64_t completed_tile_countrequired_tile_count
Section titled “required_tile_count”uint64_t required_tile_countcompleted_tile_size
Section titled “completed_tile_size”uint64_t completed_tile_sizerequired_resource_count
Section titled “required_resource_count”uint64_t required_resource_countrequired_resource_count_is_precise
Section titled “required_resource_count_is_precise”bool required_resource_count_is_precisecomplete
Section titled “complete”bool completemln_feature_state_selector
Section titled “mln_feature_state_selector”#include <map.h>Feature-state source, feature, and key selector.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
mln_string_view | source_id | Source ID. Required and borrowed for the duration of the call. |
mln_string_view | source_layer_id | Optional source layer ID. Required for vector-source disambiguation. |
mln_string_view | feature_id | Optional feature ID string. Required by set/get and optional for remove. |
mln_string_view | state_key | Optional state key. Used only by remove and requires feature_id. |
uint32_t sizefields
Section titled “fields”uint32_t fieldssource_id
Section titled “source_id”mln_string_view source_idSource ID. Required and borrowed for the duration of the call.
source_layer_id
Section titled “source_layer_id”mln_string_view source_layer_idOptional source layer ID. Required for vector-source disambiguation.
feature_id
Section titled “feature_id”mln_string_view feature_idOptional feature ID string. Required by set/get and optional for remove.
state_key
Section titled “state_key”mln_string_view state_keyOptional state key. Used only by remove and requires feature_id.
mln_multi_polygon_geometry
Section titled “mln_multi_polygon_geometry”#include <map.h>Multi-polygon geometry view. Each polygon contains ring views.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
const mln_polygon_geometry * | polygons | Polygons. Null only when polygon_count is 0. |
size_t | polygon_count |
polygons
Section titled “polygons”const mln_polygon_geometry * polygonsPolygons. Null only when polygon_count is 0.
polygon_count
Section titled “polygon_count”size_t polygon_countmln_rendered_query_geometry
Section titled “mln_rendered_query_geometry”#include <query.h>Rendered feature query geometry descriptor.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | One of mln_rendered_query_geometry_type. |
mln_screen_point | point | |
mln_screen_box | box | |
mln_screen_line_string | line_string | |
union mln_rendered_query_geometry | data |
uint32_t sizeuint32_t typeOne of mln_rendered_query_geometry_type.
mln_screen_point pointmln_screen_box boxline_string
Section titled “line_string”mln_screen_line_string line_stringunion mln_rendered_query_geometry datamln_metal_surface_descriptor
Section titled “mln_metal_surface_descriptor”#include <surface.h>Metal native surface session attachment options.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Logical map width in UI pixels. |
uint32_t | height | Logical map height in UI pixels. |
double | scale_factor | UI-to-device pixel scale. Must be positive and finite. |
void * | layer | CAMetalLayer* / CA::MetalLayer* retained by the session. Required. |
void * | device | Optional id |
uint32_t sizeuint32_t widthLogical map width in UI pixels.
height
Section titled “height”uint32_t heightLogical map height in UI pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale. Must be positive and finite.
void * layerCAMetalLayer* / CA::MetalLayer* retained by the session. Required.
device
Section titled “device”void * deviceOptional id
mln_owned_texture_descriptor
Section titled “mln_owned_texture_descriptor”#include <texture.h>Default texture session attachment options for a session-owned target.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Logical map width in UI pixels. |
uint32_t | height | Logical map height in UI pixels. |
double | scale_factor | UI-to-device pixel scale. Must be positive and finite. |
uint32_t sizeuint32_t widthLogical map width in UI pixels.
height
Section titled “height”uint32_t heightLogical map height in UI pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale. Must be positive and finite.
mln_offline_region_definition
Section titled “mln_offline_region_definition”#include <map.h>Tagged offline region definition.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | One of mln_offline_region_definition_type. |
mln_offline_tile_pyramid_region_definition | tile_pyramid | |
mln_offline_geometry_region_definition | geometry | |
union mln_offline_region_definition | data |
uint32_t sizeuint32_t typeOne of mln_offline_region_definition_type.
tile_pyramid
Section titled “tile_pyramid”mln_offline_tile_pyramid_region_definition tile_pyramidgeometry
Section titled “geometry”mln_offline_geometry_region_definition geometryunion mln_offline_region_definition datamln_premultiplied_rgba8_image
Section titled “mln_premultiplied_rgba8_image”#include <style.h>Caller-owned premultiplied RGBA8 image pixels.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | |
uint32_t | height | |
uint32_t | stride | Bytes per image row. Must be at least width * 4. |
const uint8_t * | pixels | Premultiplied RGBA8 pixels. Must not be null for a non-empty image. |
size_t | byte_length | Available bytes at pixels. |
uint32_t sizeuint32_t widthheight
Section titled “height”uint32_t heightstride
Section titled “stride”uint32_t strideBytes per image row. Must be at least width * 4.
pixels
Section titled “pixels”const uint8_t * pixelsPremultiplied RGBA8 pixels. Must not be null for a non-empty image.
byte_length
Section titled “byte_length”size_t byte_lengthAvailable bytes at pixels.
mln_runtime_event_render_map
Section titled “mln_runtime_event_render_map”#include <runtime.h>Payload for MLN_RUNTIME_EVENT_MAP_RENDER_MAP_FINISHED.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | mode | One of mln_render_mode. |
uint32_t sizeuint32_t modeOne of mln_render_mode.
mln_vulkan_surface_descriptor
Section titled “mln_vulkan_surface_descriptor”#include <surface.h>Vulkan native surface session attachment options.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Logical map width in UI pixels. |
uint32_t | height | Logical map height in UI pixels. |
double | scale_factor | UI-to-device pixel scale. Must be positive and finite. |
void * | instance | Borrowed VkInstance. Required. |
void * | physical_device | Borrowed VkPhysicalDevice. Required. |
void * | device | Borrowed VkDevice with VK_KHR_swapchain enabled. Required. |
void * | graphics_queue | Borrowed graphics VkQueue. Required. |
uint32_t | graphics_queue_family_index | Queue family index for graphics_queue. Must support graphics commands and presentation to surface. |
void * | surface | Borrowed VkSurfaceKHR. Required. |
uint32_t sizeuint32_t widthLogical map width in UI pixels.
height
Section titled “height”uint32_t heightLogical map height in UI pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale. Must be positive and finite.
instance
Section titled “instance”void * instanceBorrowed VkInstance. Required.
physical_device
Section titled “physical_device”void * physical_deviceBorrowed VkPhysicalDevice. Required.
device
Section titled “device”void * deviceBorrowed VkDevice with VK_KHR_swapchain enabled. Required.
graphics_queue
Section titled “graphics_queue”void * graphics_queueBorrowed graphics VkQueue. Required.
graphics_queue_family_index
Section titled “graphics_queue_family_index”uint32_t graphics_queue_family_indexQueue family index for graphics_queue. Must support graphics commands and presentation to surface.
surface
Section titled “surface”void * surfaceBorrowed VkSurfaceKHR. Required.
mln_metal_owned_texture_frame
Section titled “mln_metal_owned_texture_frame”#include <texture.h>Metal frame acquired from a session-owned texture target.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint64_t | generation | Session generation that produced this frame. |
uint32_t | width | Physical Metal texture width in device pixels. |
uint32_t | height | Physical Metal texture height in device pixels. |
double | scale_factor | UI-to-device pixel scale used for this frame. |
uint64_t | frame_id | Opaque frame identity used to reject stale releases. |
void * | texture | Borrowed id |
void * | device | Borrowed id |
uint64_t | pixel_format | Backend-native pixel format value. Metal uses MTLPixelFormat. |
uint32_t sizegeneration
Section titled “generation”uint64_t generationSession generation that produced this frame.
uint32_t widthPhysical Metal texture width in device pixels.
height
Section titled “height”uint32_t heightPhysical Metal texture height in device pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale used for this frame.
frame_id
Section titled “frame_id”uint64_t frame_idOpaque frame identity used to reject stale releases.
texture
Section titled “texture”void * textureBorrowed id
device
Section titled “device”void * deviceBorrowed id
pixel_format
Section titled “pixel_format”uint64_t pixel_formatBackend-native pixel format value. Metal uses MTLPixelFormat.
mln_runtime_event_tile_action
Section titled “mln_runtime_event_tile_action”#include <runtime.h>Payload for MLN_RUNTIME_EVENT_MAP_TILE_ACTION.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | operation | One of mln_tile_operation. |
mln_tile_id | tile_id | |
const char * | source_id | Borrowed source ID bytes. Valid until the next poll for this runtime or until the runtime is destroyed. |
size_t | source_id_size | Number of bytes in source_id, excluding the trailing null terminator. |
uint32_t sizeoperation
Section titled “operation”uint32_t operationOne of mln_tile_operation.
tile_id
Section titled “tile_id”mln_tile_id tile_idsource_id
Section titled “source_id”const char * source_idBorrowed source ID bytes. Valid until the next poll for this runtime or until the runtime is destroyed.
source_id_size
Section titled “source_id_size”size_t source_id_sizeNumber of bytes in source_id, excluding the trailing null terminator.
mln_style_tile_source_options
Section titled “mln_style_tile_source_options”#include <style.h>Options for vector and raster tile sources.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
double | min_zoom | |
double | max_zoom | |
mln_string_view | attribution | |
uint32_t | scheme | One of mln_style_tile_scheme. Defaults to MLN_STYLE_TILE_SCHEME_XYZ. |
mln_lat_lng_bounds | bounds | |
uint32_t | tile_size | Raster tile size in pixels. Defaults to 512. |
uint32_t | vector_encoding | One of mln_style_vector_tile_encoding. Defaults to MVT. |
uint32_t | raster_encoding | One of mln_style_raster_dem_encoding. Defaults to Mapbox. |
uint32_t sizefields
Section titled “fields”uint32_t fieldsmin_zoom
Section titled “min_zoom”double min_zoommax_zoom
Section titled “max_zoom”double max_zoomattribution
Section titled “attribution”mln_string_view attributionscheme
Section titled “scheme”uint32_t schemeOne of mln_style_tile_scheme. Defaults to MLN_STYLE_TILE_SCHEME_XYZ.
bounds
Section titled “bounds”mln_lat_lng_bounds boundstile_size
Section titled “tile_size”uint32_t tile_sizeRaster tile size in pixels. Defaults to 512.
vector_encoding
Section titled “vector_encoding”uint32_t vector_encodingOne of mln_style_vector_tile_encoding. Defaults to MVT.
raster_encoding
Section titled “raster_encoding”uint32_t raster_encodingOne of mln_style_raster_dem_encoding. Defaults to Mapbox.
mln_resource_transform_response
Section titled “mln_resource_transform_response”Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
const char * | url | Replacement URL. Null or empty keeps the original URL. Copied on return. |
uint32_t sizeconst char * urlReplacement URL. Null or empty keeps the original URL. Copied on return.
mln_runtime_event_render_frame
Section titled “mln_runtime_event_render_frame”#include <runtime.h>Payload for MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_FINISHED.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | mode | One of mln_render_mode. |
bool | needs_repaint | Whether MapLibre needs another frame after this one. |
bool | placement_changed | Whether symbol placement changed during this frame. |
mln_rendering_stats | stats |
uint32_t sizeuint32_t modeOne of mln_render_mode.
needs_repaint
Section titled “needs_repaint”bool needs_repaintWhether MapLibre needs another frame after this one.
placement_changed
Section titled “placement_changed”bool placement_changedWhether symbol placement changed during this frame.
mln_rendering_stats statsmln_vulkan_owned_texture_frame
Section titled “mln_vulkan_owned_texture_frame”#include <texture.h>Vulkan frame acquired from a session-owned texture target.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint64_t | generation | Session generation that produced this frame. |
uint32_t | width | Physical Vulkan image width in device pixels. |
uint32_t | height | Physical Vulkan image height in device pixels. |
double | scale_factor | UI-to-device pixel scale used for this frame. |
uint64_t | frame_id | Opaque frame identity used to reject stale releases. |
void * | image | Borrowed VkImage. Valid until frame release. |
void * | image_view | Borrowed VkImageView. Valid until frame release. |
void * | device | Borrowed VkDevice. Valid until frame release. |
uint32_t | format | Backend-native VkFormat value. |
uint32_t | layout | Backend-native VkImageLayout value; Vulkan frames are host-sampleable. |
uint32_t sizegeneration
Section titled “generation”uint64_t generationSession generation that produced this frame.
uint32_t widthPhysical Vulkan image width in device pixels.
height
Section titled “height”uint32_t heightPhysical Vulkan image height in device pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale used for this frame.
frame_id
Section titled “frame_id”uint64_t frame_idOpaque frame identity used to reject stale releases.
void * imageBorrowed VkImage. Valid until frame release.
image_view
Section titled “image_view”void * image_viewBorrowed VkImageView. Valid until frame release.
device
Section titled “device”void * deviceBorrowed VkDevice. Valid until frame release.
format
Section titled “format”uint32_t formatBackend-native VkFormat value.
layout
Section titled “layout”uint32_t layoutBackend-native VkImageLayout value; Vulkan frames are host-sampleable.
mln_source_feature_query_options
Section titled “mln_source_feature_query_options”#include <query.h>Options for source feature queries.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
const mln_string_view * | source_layer_ids | Optional source-layer IDs. Required by vector sources; ignored by GeoJSON. |
size_t | source_layer_id_count | |
const mln_json_value * | filter | Optional MapLibre style-spec filter JSON. Null means no filter. |
uint32_t sizefields
Section titled “fields”uint32_t fieldssource_layer_ids
Section titled “source_layer_ids”const mln_string_view * source_layer_idsOptional source-layer IDs. Required by vector sources; ignored by GeoJSON.
source_layer_id_count
Section titled “source_layer_id_count”size_t source_layer_id_countfilter
Section titled “filter”const mln_json_value * filterOptional MapLibre style-spec filter JSON. Null means no filter.
mln_feature_extension_result_info
Section titled “mln_feature_extension_result_info”#include <query.h>Tagged feature extension query result view.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | type | One of mln_feature_extension_result_type. |
const mln_json_value * | value | JSON-like value view selected by MLN_FEATURE_EXTENSION_RESULT_TYPE_VALUE. |
mln_feature_collection | feature_collection | Feature collection view selected by MLN_FEATURE_EXTENSION_RESULT_TYPE_FEATURE_COLLECTION. |
union mln_feature_extension_result_info | data |
uint32_t sizeuint32_t typeOne of mln_feature_extension_result_type.
const mln_json_value * valueJSON-like value view selected by MLN_FEATURE_EXTENSION_RESULT_TYPE_VALUE.
feature_collection
Section titled “feature_collection”mln_feature_collection feature_collectionFeature collection view selected by MLN_FEATURE_EXTENSION_RESULT_TYPE_FEATURE_COLLECTION.
union mln_feature_extension_result_info datamln_custom_geometry_source_options
Section titled “mln_custom_geometry_source_options”#include <style.h>Options for custom geometry sources.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
mln_custom_geometry_source_tile_callback | fetch_tile | Required tile fetch callback. |
mln_custom_geometry_source_tile_callback | cancel_tile | Optional best-effort tile cancel callback. |
void * | user_data | Caller-owned callback context retained by pointer. |
double | min_zoom | |
double | max_zoom | |
double | tolerance | |
uint32_t | tile_size | |
uint32_t | buffer | |
bool | clip | |
bool | wrap |
uint32_t sizefields
Section titled “fields”uint32_t fieldsfetch_tile
Section titled “fetch_tile”mln_custom_geometry_source_tile_callback fetch_tileRequired tile fetch callback.
cancel_tile
Section titled “cancel_tile”mln_custom_geometry_source_tile_callback cancel_tileOptional best-effort tile cancel callback.
user_data
Section titled “user_data”void * user_dataCaller-owned callback context retained by pointer.
min_zoom
Section titled “min_zoom”double min_zoommax_zoom
Section titled “max_zoom”double max_zoomtolerance
Section titled “tolerance”double tolerancetile_size
Section titled “tile_size”uint32_t tile_sizebuffer
Section titled “buffer”uint32_t bufferbool clipbool wrapmln_metal_owned_texture_descriptor
Section titled “mln_metal_owned_texture_descriptor”#include <texture.h>Metal texture session attachment options for a session-owned target.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Logical map width in UI pixels. |
uint32_t | height | Logical map height in UI pixels. |
double | scale_factor | UI-to-device pixel scale. Must be positive and finite. |
void * | device | id |
uint32_t sizeuint32_t widthLogical map width in UI pixels.
height
Section titled “height”uint32_t heightLogical map height in UI pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale. Must be positive and finite.
device
Section titled “device”void * deviceid
mln_rendered_feature_query_options
Section titled “mln_rendered_feature_query_options”#include <query.h>Options for rendered feature queries.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | fields | |
const mln_string_view * | layer_ids | Optional style layer IDs. When absent, all rendered layers are queried. |
size_t | layer_id_count | |
const mln_json_value * | filter | Optional MapLibre style-spec filter JSON. Null means no filter. |
uint32_t sizefields
Section titled “fields”uint32_t fieldslayer_ids
Section titled “layer_ids”const mln_string_view * layer_idsOptional style layer IDs. When absent, all rendered layers are queried.
layer_id_count
Section titled “layer_id_count”size_t layer_id_countfilter
Section titled “filter”const mln_json_value * filterOptional MapLibre style-spec filter JSON. Null means no filter.
mln_vulkan_owned_texture_descriptor
Section titled “mln_vulkan_owned_texture_descriptor”#include <texture.h>Vulkan texture session attachment options for a session-owned target.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Logical map width in UI pixels. |
uint32_t | height | Logical map height in UI pixels. |
double | scale_factor | UI-to-device pixel scale. Must be positive and finite. |
void * | instance | Borrowed VkInstance. Required. |
void * | physical_device | Borrowed VkPhysicalDevice. Required. |
void * | device | Borrowed VkDevice. Required. |
void * | graphics_queue | Borrowed graphics VkQueue. Required. |
uint32_t | graphics_queue_family_index | Queue family index for graphics_queue. Must support graphics commands. |
uint32_t sizeuint32_t widthLogical map width in UI pixels.
height
Section titled “height”uint32_t heightLogical map height in UI pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale. Must be positive and finite.
instance
Section titled “instance”void * instanceBorrowed VkInstance. Required.
physical_device
Section titled “physical_device”void * physical_deviceBorrowed VkPhysicalDevice. Required.
device
Section titled “device”void * deviceBorrowed VkDevice. Required.
graphics_queue
Section titled “graphics_queue”void * graphics_queueBorrowed graphics VkQueue. Required.
graphics_queue_family_index
Section titled “graphics_queue_family_index”uint32_t graphics_queue_family_indexQueue family index for graphics_queue. Must support graphics commands.
mln_metal_borrowed_texture_descriptor
Section titled “mln_metal_borrowed_texture_descriptor”#include <texture.h>Metal caller-owned texture session attachment options.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Logical map width in UI pixels. |
uint32_t | height | Logical map height in UI pixels. |
double | scale_factor | UI-to-device pixel scale. Must be positive and finite. |
void * | texture | Borrowed id |
uint32_t sizeuint32_t widthLogical map width in UI pixels.
height
Section titled “height”uint32_t heightLogical map height in UI pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale. Must be positive and finite.
texture
Section titled “texture”void * textureBorrowed id
The texture’s physical pixel dimensions must match width, height, and scale_factor, and the texture must allow render-target usage. The caller owns the texture and must keep it valid until detach or destroy.
mln_offline_geometry_region_definition
Section titled “mln_offline_geometry_region_definition”#include <map.h>Geometry offline region definition.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
const char * | style_url | Style URL. Copied during region creation. |
const mln_geometry * | geometry | Geometry descriptor. Borrowed for the duration of region creation. |
double | min_zoom | |
double | max_zoom | Maximum zoom. Positive infinity follows MapLibre Native behavior and lets each tile source use its own maximum zoom. |
float | pixel_ratio | |
bool | include_ideographs |
uint32_t sizestyle_url
Section titled “style_url”const char * style_urlStyle URL. Copied during region creation.
geometry
Section titled “geometry”const mln_geometry * geometryGeometry descriptor. Borrowed for the duration of region creation.
min_zoom
Section titled “min_zoom”double min_zoommax_zoom
Section titled “max_zoom”double max_zoomMaximum zoom. Positive infinity follows MapLibre Native behavior and lets each tile source use its own maximum zoom.
pixel_ratio
Section titled “pixel_ratio”float pixel_ratioinclude_ideographs
Section titled “include_ideographs”bool include_ideographsmln_runtime_event_style_image_missing
Section titled “mln_runtime_event_style_image_missing”#include <runtime.h>Payload for MLN_RUNTIME_EVENT_MAP_STYLE_IMAGE_MISSING.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
const char * | image_id | Borrowed image ID bytes. Valid until the next poll for this runtime or until the runtime is destroyed. |
size_t | image_id_size | Number of bytes in image_id, excluding the trailing null terminator. |
uint32_t sizeimage_id
Section titled “image_id”const char * image_idBorrowed image ID bytes. Valid until the next poll for this runtime or until the runtime is destroyed.
image_id_size
Section titled “image_id_size”size_t image_id_sizeNumber of bytes in image_id, excluding the trailing null terminator.
mln_vulkan_borrowed_texture_descriptor
Section titled “mln_vulkan_borrowed_texture_descriptor”#include <texture.h>Vulkan caller-owned texture session attachment options.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
uint32_t | width | Logical map width in UI pixels. |
uint32_t | height | Logical map height in UI pixels. |
double | scale_factor | UI-to-device pixel scale. Must be positive and finite. |
void * | instance | Borrowed VkInstance. Required. |
void * | physical_device | Borrowed VkPhysicalDevice. Required. |
void * | device | Borrowed VkDevice. Required. |
void * | graphics_queue | Borrowed graphics VkQueue. Required. |
uint32_t | graphics_queue_family_index | Queue family index for graphics_queue. Must support graphics commands. |
void * | image | Borrowed VkImage. Required. |
void * | image_view | Borrowed VkImageView for image. Required. |
uint32_t | format | Backend-native VkFormat value for image. VK_FORMAT_UNDEFINED is invalid. |
uint32_t | initial_layout | Backend-native VkImageLayout value expected at render-pass begin. |
uint32_t | final_layout | Backend-native VkImageLayout value left after rendering succeeds. |
uint32_t sizeuint32_t widthLogical map width in UI pixels.
height
Section titled “height”uint32_t heightLogical map height in UI pixels.
scale_factor
Section titled “scale_factor”double scale_factorUI-to-device pixel scale. Must be positive and finite.
instance
Section titled “instance”void * instanceBorrowed VkInstance. Required.
physical_device
Section titled “physical_device”void * physical_deviceBorrowed VkPhysicalDevice. Required.
device
Section titled “device”void * deviceBorrowed VkDevice. Required.
graphics_queue
Section titled “graphics_queue”void * graphics_queueBorrowed graphics VkQueue. Required.
graphics_queue_family_index
Section titled “graphics_queue_family_index”uint32_t graphics_queue_family_indexQueue family index for graphics_queue. Must support graphics commands.
void * imageBorrowed VkImage. Required.
The image must be a 2D, single-sample color image with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT. Its physical dimensions must match width, height, and scale_factor. Include VK_IMAGE_USAGE_SAMPLED_BIT when the host will sample from the image after rendering.
image_view
Section titled “image_view”void * image_viewBorrowed VkImageView for image. Required.
The view must be a 2D color view that matches image and format.
format
Section titled “format”uint32_t formatBackend-native VkFormat value for image. VK_FORMAT_UNDEFINED is invalid.
initial_layout
Section titled “initial_layout”uint32_t initial_layoutBackend-native VkImageLayout value expected at render-pass begin.
Use VK_IMAGE_LAYOUT_UNDEFINED when the previous image contents may be discarded.
final_layout
Section titled “final_layout”uint32_t final_layoutBackend-native VkImageLayout value left after rendering succeeds.
mln_runtime_event_offline_region_status
Section titled “mln_runtime_event_offline_region_status”#include <runtime.h>Payload for MLN_RUNTIME_EVENT_OFFLINE_REGION_STATUS_CHANGED.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
mln_offline_region_id | region_id | |
mln_offline_region_status | status |
uint32_t sizeregion_id
Section titled “region_id”mln_offline_region_id region_idstatus
Section titled “status”mln_offline_region_status statusmln_offline_tile_pyramid_region_definition
Section titled “mln_offline_tile_pyramid_region_definition”#include <map.h>Tile-pyramid offline region definition.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
const char * | style_url | Style URL. Copied during region creation. |
mln_lat_lng_bounds | bounds | |
double | min_zoom | |
double | max_zoom | Maximum zoom. Positive infinity follows MapLibre Native behavior and lets each tile source use its own maximum zoom. |
float | pixel_ratio | |
bool | include_ideographs |
uint32_t sizestyle_url
Section titled “style_url”const char * style_urlStyle URL. Copied during region creation.
bounds
Section titled “bounds”mln_lat_lng_bounds boundsmin_zoom
Section titled “min_zoom”double min_zoommax_zoom
Section titled “max_zoom”double max_zoomMaximum zoom. Positive infinity follows MapLibre Native behavior and lets each tile source use its own maximum zoom.
pixel_ratio
Section titled “pixel_ratio”float pixel_ratioinclude_ideographs
Section titled “include_ideographs”bool include_ideographsmln_runtime_event_offline_region_response_error
Section titled “mln_runtime_event_offline_region_response_error”#include <runtime.h>Payload for MLN_RUNTIME_EVENT_OFFLINE_REGION_RESPONSE_ERROR.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
mln_offline_region_id | region_id | |
uint32_t | reason | One of mln_resource_error_reason. |
uint32_t sizeregion_id
Section titled “region_id”mln_offline_region_id region_idreason
Section titled “reason”uint32_t reasonOne of mln_resource_error_reason.
mln_runtime_event_offline_region_tile_count_limit
Section titled “mln_runtime_event_offline_region_tile_count_limit”#include <runtime.h>Payload for MLN_RUNTIME_EVENT_OFFLINE_REGION_TILE_COUNT_LIMIT_EXCEEDED.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
uint32_t | size | |
mln_offline_region_id | region_id | |
uint64_t | limit |
uint32_t sizeregion_id
Section titled “region_id”mln_offline_region_id region_iduint64_t limitGenerated by Moxygen