Skip to content

C API

NameDescription
mln_vec3Three-component vector used by free camera options.
mln_featureGeoJSON feature input descriptor graph.
mln_geojsonGeoJSON 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_geometryMapLibre geometry input descriptor graph.
mln_lat_lngGeographic coordinate in degrees used by map and projection APIs.
mln_tile_idOverscaled tile identity reported in tile observer events.
mln_quaternionQuaternion stored as x, y, z, w components.
mln_json_arrayJSON value array view.
mln_json_valueJSON-like value input descriptor graph used by feature properties/states.
mln_screen_boxScreen-space box in logical map pixels.
mln_edge_insetsScreen-space inset in logical map pixels.
mln_json_memberJSON object member view.
mln_json_objectJSON object member array view.
mln_map_optionsOptions used when creating a map.
mln_string_viewUTF-8 text view. The pointer may be null only when size is 0.
mln_unit_bezierCubic easing curve for animated camera transitions.
mln_screen_pointScreen-space point in logical map pixels.
mln_bound_optionsOptional map camera constraint fields.
mln_runtime_eventEvent payload returned by mln_runtime_poll_event().
mln_camera_optionsCamera fields used for snapshots and camera commands.
mln_coordinate_spanCoordinate array view. Coordinates are latitude/longitude pairs.
mln_lat_lng_boundsGeographic bounds in degrees.
mln_projection_modeMapLibre axonometric rendering options used for snapshots and commands.
mln_queried_featureOne copied query result feature.
mln_rendering_statsRendering statistics reported in MLN_RUNTIME_EVENT_PAYLOAD_RENDER_FRAME.
mln_runtime_options
mln_polygon_geometryPolygon ring array view. Each ring is a coordinate span.
mln_projected_metersLower-level Spherical Mercator projected-meter coordinate.
mln_resource_request
mln_animation_optionsOptional animation controls for camera transitions.
mln_map_tile_optionsTile prefetch and LOD tuning controls.
mln_resource_provider
mln_resource_response
mln_style_image_infoFixed metadata for one runtime style image.
mln_canonical_tile_idCanonical tile identity used by custom geometry source callbacks.
mln_feature_collectionFeature collection view.
mln_resource_transform
mln_style_source_infoFixed source metadata returned by mln_map_get_style_source_info().
mln_camera_fit_optionsOptional fitting controls for camera-for-viewport queries.
mln_geometry_collectionGeometry collection view.
mln_screen_line_stringScreen-space line string in logical map pixels.
mln_texture_image_infoCPU image readback metadata for a texture session frame.
mln_free_camera_optionsFree camera position and orientation in MapLibre Native camera space.
mln_multi_line_geometryMulti-line geometry view. Each line is a coordinate span.
mln_offline_region_infoRegion data view returned from a snapshot or list handle.
mln_style_image_optionsOptions for runtime style images.
mln_map_viewport_optionsLive map viewport and render-transform controls.
mln_offline_region_statusOffline region status snapshot.
mln_feature_state_selectorFeature-state source, feature, and key selector.
mln_multi_polygon_geometryMulti-polygon geometry view. Each polygon contains ring views.
mln_rendered_query_geometryRendered feature query geometry descriptor.
mln_metal_surface_descriptorMetal native surface session attachment options.
mln_owned_texture_descriptorDefault texture session attachment options for a session-owned target.
mln_offline_region_definitionTagged offline region definition.
mln_premultiplied_rgba8_imageCaller-owned premultiplied RGBA8 image pixels.
mln_runtime_event_render_mapPayload for MLN_RUNTIME_EVENT_MAP_RENDER_MAP_FINISHED.
mln_vulkan_surface_descriptorVulkan native surface session attachment options.
mln_metal_owned_texture_frameMetal frame acquired from a session-owned texture target.
mln_runtime_event_tile_actionPayload for MLN_RUNTIME_EVENT_MAP_TILE_ACTION.
mln_style_tile_source_optionsOptions for vector and raster tile sources.
mln_resource_transform_response
mln_runtime_event_render_framePayload for MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_FINISHED.
mln_vulkan_owned_texture_frameVulkan frame acquired from a session-owned texture target.
mln_source_feature_query_optionsOptions for source feature queries.
mln_feature_extension_result_infoTagged feature extension query result view.
mln_custom_geometry_source_optionsOptions for custom geometry sources.
mln_metal_owned_texture_descriptorMetal texture session attachment options for a session-owned target.
mln_rendered_feature_query_optionsOptions for rendered feature queries.
mln_vulkan_owned_texture_descriptorVulkan texture session attachment options for a session-owned target.
mln_metal_borrowed_texture_descriptorMetal caller-owned texture session attachment options.
mln_offline_geometry_region_definitionGeometry offline region definition.
mln_runtime_event_style_image_missingPayload for MLN_RUNTIME_EVENT_MAP_STYLE_IMAGE_MISSING.
mln_vulkan_borrowed_texture_descriptorVulkan caller-owned texture session attachment options.
mln_runtime_event_offline_region_statusPayload for MLN_RUNTIME_EVENT_OFFLINE_REGION_STATUS_CHANGED.
mln_offline_tile_pyramid_region_definitionTile-pyramid offline region definition.
mln_runtime_event_offline_region_response_errorPayload for MLN_RUNTIME_EVENT_OFFLINE_REGION_RESPONSE_ERROR.
mln_runtime_event_offline_region_tile_count_limitPayload for MLN_RUNTIME_EVENT_OFFLINE_REGION_TILE_COUNT_LIMIT_EXCEEDED.

enum mln_camera_option_field
ValueDescription
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.

enum mln_animation_option_field
ValueDescription
MLN_ANIMATION_OPTION_DURATION
MLN_ANIMATION_OPTION_VELOCITY
MLN_ANIMATION_OPTION_MIN_ZOOM
MLN_ANIMATION_OPTION_EASING

Field mask values for mln_animation_options.

enum mln_camera_fit_option_field
ValueDescription
MLN_CAMERA_FIT_OPTION_PADDING
MLN_CAMERA_FIT_OPTION_BEARING
MLN_CAMERA_FIT_OPTION_PITCH

Field mask values for mln_camera_fit_options.

enum mln_bound_option_field
ValueDescription
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.

enum mln_free_camera_option_field
ValueDescription
MLN_FREE_CAMERA_OPTION_POSITION
MLN_FREE_CAMERA_OPTION_ORIENTATION

Field mask values for mln_free_camera_options.

enum mln_projection_mode_field
ValueDescription
MLN_PROJECTION_MODE_AXONOMETRIC
MLN_PROJECTION_MODE_X_SKEW
MLN_PROJECTION_MODE_Y_SKEW

Field mask values for MapLibre axonometric rendering options.

enum mln_map_debug_option
ValueDescription
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().

enum mln_north_orientation
ValueDescription
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.

enum mln_constrain_mode
ValueDescription
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.

enum mln_viewport_mode
ValueDescription
MLN_VIEWPORT_MODE_DEFAULT
MLN_VIEWPORT_MODE_FLIPPED_Y

Viewport orientation modes used by mln_map_viewport_options.

enum mln_map_viewport_option_field
ValueDescription
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.

enum mln_tile_lod_mode
ValueDescription
MLN_TILE_LOD_MODE_DEFAULT
MLN_TILE_LOD_MODE_DISTANCE

Tile LOD algorithms used by mln_map_tile_options.

enum mln_map_tile_option_field
ValueDescription
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.

enum mln_map_mode
ValueDescription
MLN_MAP_MODE_CONTINUOUSContinuously updates as data arrives and map state changes.
MLN_MAP_MODE_STATICProduces one-off still images of an arbitrary viewport.
MLN_MAP_MODE_TILEProduces one-off still images for a single tile.

Map rendering modes used when creating a map.

enum mln_geometry_type
ValueDescription
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.

enum mln_json_value_type
ValueDescription
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.

enum mln_feature_state_selector_field
ValueDescription
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.

enum mln_feature_identifier_type
ValueDescription
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.

enum mln_geojson_type
ValueDescription
MLN_GEOJSON_TYPE_GEOMETRY
MLN_GEOJSON_TYPE_FEATURE
MLN_GEOJSON_TYPE_FEATURE_COLLECTION

GeoJSON variant tags used by mln_geojson.

enum mln_status
ValueDescription
MLN_STATUS_OK
MLN_STATUS_INVALID_ARGUMENTA pointer, size field, mask, or handle argument was invalid.
MLN_STATUS_INVALID_STATEThe object is valid but not currently in a state that permits the call.
MLN_STATUS_WRONG_THREADThe handle is thread-affine and the call was made from the wrong thread.
MLN_STATUS_UNSUPPORTEDThe entry point or requested behavior is unavailable in this build.
MLN_STATUS_NATIVE_ERRORA native MapLibre error or C++ exception was converted to status.

Status values returned by status-returning functions.

enum mln_render_backend_flag
ValueDescription
MLN_RENDER_BACKEND_FLAG_METAL
MLN_RENDER_BACKEND_FLAG_VULKAN

Render backend support flags reported by this native library build.

enum mln_rendered_query_geometry_type
ValueDescription
MLN_RENDERED_QUERY_GEOMETRY_TYPE_POINT
MLN_RENDERED_QUERY_GEOMETRY_TYPE_BOX
MLN_RENDERED_QUERY_GEOMETRY_TYPE_LINE_STRING

Rendered feature query geometry variants.

enum mln_rendered_feature_query_option_field
ValueDescription
MLN_RENDERED_FEATURE_QUERY_OPTION_LAYER_IDS

Optional fields for mln_rendered_feature_query_options.

enum mln_source_feature_query_option_field
ValueDescription
MLN_SOURCE_FEATURE_QUERY_OPTION_SOURCE_LAYER_IDS

Optional fields for mln_source_feature_query_options.

enum mln_queried_feature_field
ValueDescription
MLN_QUERIED_FEATURE_SOURCE_ID
MLN_QUERIED_FEATURE_SOURCE_LAYER_ID
MLN_QUERIED_FEATURE_STATE

Optional fields returned by mln_queried_feature.

enum mln_feature_extension_result_type
ValueDescription
MLN_FEATURE_EXTENSION_RESULT_TYPE_VALUE
MLN_FEATURE_EXTENSION_RESULT_TYPE_FEATURE_COLLECTION

Feature extension query result variants.

enum mln_style_source_type
ValueDescription
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().

enum mln_style_tile_source_option_field
ValueDescription
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.

enum mln_style_tile_scheme
ValueDescription
MLN_STYLE_TILE_SCHEME_XYZ
MLN_STYLE_TILE_SCHEME_TMS

Tile URL coordinate scheme values used by mln_style_tile_source_options.

enum mln_style_vector_tile_encoding
ValueDescription
MLN_STYLE_VECTOR_TILE_ENCODING_MVT
MLN_STYLE_VECTOR_TILE_ENCODING_MLT

Vector tile encoding values used by mln_style_tile_source_options.

enum mln_style_raster_dem_encoding
ValueDescription
MLN_STYLE_RASTER_DEM_ENCODING_MAPBOX
MLN_STYLE_RASTER_DEM_ENCODING_TERRARIUM

DEM raster encoding values used by mln_style_tile_source_options.

enum mln_custom_geometry_source_option_field
ValueDescription
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.

enum mln_style_image_option_field
ValueDescription
MLN_STYLE_IMAGE_OPTION_PIXEL_RATIO
MLN_STYLE_IMAGE_OPTION_SDF

Field mask values for mln_style_image_options.

enum mln_location_indicator_image_kind
ValueDescription
MLN_LOCATION_INDICATOR_IMAGE_KIND_TOP
MLN_LOCATION_INDICATOR_IMAGE_KIND_BEARING
MLN_LOCATION_INDICATOR_IMAGE_KIND_SHADOW

Location indicator image-name properties.

enum mln_log_severity
ValueDescription
MLN_LOG_SEVERITY_INFO
MLN_LOG_SEVERITY_WARNING
MLN_LOG_SEVERITY_ERROR

Log severity values emitted by MapLibre Native.

enum mln_log_severity_mask
ValueDescription
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.

enum mln_log_event
ValueDescription
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.

enum mln_network_status
ValueDescription
MLN_NETWORK_STATUS_ONLINE
MLN_NETWORK_STATUS_OFFLINE

enum mln_runtime_option_flag
ValueDescription
MLN_RUNTIME_OPTION_MAXIMUM_CACHE_SIZE

enum mln_ambient_cache_operation
ValueDescription
MLN_AMBIENT_CACHE_OPERATION_RESET_DATABASE
MLN_AMBIENT_CACHE_OPERATION_PACK_DATABASE
MLN_AMBIENT_CACHE_OPERATION_INVALIDATE
MLN_AMBIENT_CACHE_OPERATION_CLEAR

enum mln_offline_region_definition_type
ValueDescription
MLN_OFFLINE_REGION_DEFINITION_TILE_PYRAMID
MLN_OFFLINE_REGION_DEFINITION_GEOMETRY

enum mln_offline_region_download_state
ValueDescription
MLN_OFFLINE_REGION_DOWNLOAD_INACTIVE
MLN_OFFLINE_REGION_DOWNLOAD_ACTIVE

enum mln_runtime_event_type
ValueDescription
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().

enum mln_runtime_event_source_type
ValueDescription
MLN_RUNTIME_EVENT_SOURCE_RUNTIME
MLN_RUNTIME_EVENT_SOURCE_MAP

Source kinds used by mln_runtime_event.source_type.

enum mln_runtime_event_payload_type
ValueDescription
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.

enum mln_render_mode
ValueDescription
MLN_RENDER_MODE_PARTIAL
MLN_RENDER_MODE_FULL

Render modes reported by render observer events.

enum mln_tile_operation
ValueDescription
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.

enum mln_resource_kind
ValueDescription
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

enum mln_resource_loading_method
ValueDescription
MLN_RESOURCE_LOADING_METHOD_ALL
MLN_RESOURCE_LOADING_METHOD_CACHE_ONLY
MLN_RESOURCE_LOADING_METHOD_NETWORK_ONLY

enum mln_resource_priority
ValueDescription
MLN_RESOURCE_PRIORITY_REGULAR
MLN_RESOURCE_PRIORITY_LOW

enum mln_resource_usage
ValueDescription
MLN_RESOURCE_USAGE_ONLINE
MLN_RESOURCE_USAGE_OFFLINE

enum mln_resource_storage_policy
ValueDescription
MLN_RESOURCE_STORAGE_POLICY_PERMANENT
MLN_RESOURCE_STORAGE_POLICY_VOLATILE

enum mln_resource_response_status
ValueDescription
MLN_RESOURCE_RESPONSE_STATUS_OK
MLN_RESOURCE_RESPONSE_STATUS_ERROR
MLN_RESOURCE_RESPONSE_STATUS_NO_CONTENT
MLN_RESOURCE_RESPONSE_STATUS_NOT_MODIFIED

enum mln_resource_error_reason
ValueDescription
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

enum mln_resource_provider_decision
ValueDescription
MLN_RESOURCE_PROVIDER_DECISION_PASS_THROUGH
MLN_RESOURCE_PROVIDER_DECISION_HANDLE

struct mln_runtime mln_runtime()

struct mln_map mln_map()

struct mln_map_projection mln_map_projection()

struct mln_offline_region_snapshot mln_offline_region_snapshot()

struct mln_offline_region_list mln_offline_region_list()

struct mln_json_snapshot mln_json_snapshot()

struct mln_resource_request_handle mln_resource_request_handle()

struct mln_render_session mln_render_session()

struct mln_feature_query_result mln_feature_query_result()

struct mln_feature_extension_result mln_feature_extension_result()

struct mln_style_id_list mln_style_id_list()

void(* mln_custom_geometry_source_tile_callback()

Callback invoked for custom geometry source tile requests and cancels.

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.

int64_t mln_offline_region_id()

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.

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.

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_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_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_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_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_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_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_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.

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_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_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.

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 mln_map_options_default(void)

Returns map options initialized for this C API version.

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_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_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_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_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_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.

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.

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 mln_source_feature_query_options_default(void)

Returns default source feature query options.

mln_rendered_query_geometry mln_rendered_query_geometry_point(mln_screen_point point)

Returns a rendered point query geometry descriptor.

mln_rendered_query_geometry mln_rendered_query_geometry_box(mln_screen_box box)

Returns a rendered box query geometry descriptor.

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_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_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_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.

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_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.

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 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 mln_premultiplied_rgba8_image_default(void)

Returns a default premultiplied RGBA8 image descriptor.

mln_style_image_options mln_style_image_options_default(void)

Returns default runtime style image options.

mln_style_image_info mln_style_image_info_default(void)

Returns default runtime style image metadata.

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_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.

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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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 mln_camera_options_default(void)

Returns empty camera options initialized for this C API version.

mln_animation_options mln_animation_options_default(void)

Returns empty animation options initialized for this C API version.

mln_camera_fit_options mln_camera_fit_options_default(void)

Returns empty camera fitting options initialized for this C API version.

mln_bound_options mln_bound_options_default(void)

Returns empty map bound options initialized for this C API version.

mln_free_camera_options mln_free_camera_options_default(void)

Returns empty free camera options initialized for this C API version.

mln_projection_mode mln_projection_mode_default(void)

Returns empty axonometric rendering options initialized for this C API version.

mln_map_viewport_options mln_map_viewport_options_default(void)

Returns empty viewport options initialized for this C API version.

mln_map_tile_options mln_map_tile_options_default(void)

Returns empty tile tuning options initialized for this C API version.

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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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 mln_runtime_options_default(void)

Returns runtime options initialized for this C API version.

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_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_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_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.

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_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_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_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_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_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 mln_metal_surface_descriptor_default(void)

Returns Metal surface descriptor defaults for this C API version.

mln_vulkan_surface_descriptor mln_vulkan_surface_descriptor_default(void)

Returns Vulkan surface descriptor defaults for this C API version.

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_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 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 mln_texture_image_info_default(void)

Returns texture image info defaults for this C API version.

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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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.

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_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_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_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_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_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_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_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_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_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_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_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.

void mln_json_snapshot_destroy(mln_json_snapshot * snapshot)

Destroys a JSON snapshot handle. Null is accepted as a no-op.

#include <map.h>

Three-component vector used by free camera options.

ReturnNameDescription
doublex
doubley
doublez

double x

double y

double z

#include <map.h>

GeoJSON feature input descriptor graph.

ReturnNameDescription
uint32_tsize
const mln_geometry *geometryGeometry descriptor. Must not be null. Use MLN_GEOMETRY_TYPE_EMPTY for an empty geometry.
const mln_json_member *propertiesProperty member views. May be null only when property_count is 0.
size_tproperty_count
uint32_tidentifier_typeOne of mln_feature_identifier_type.
uint64_tuint_value
int64_tint_value
doubledouble_value
mln_string_viewstring_value
union mln_featureidentifier

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

#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.

ReturnNameDescription
uint32_tsize
uint32_ttypeOne of mln_geojson_type.
const mln_geometry *geometryGeometry descriptor selected by MLN_GEOJSON_TYPE_GEOMETRY. Must not be null.
const mln_feature *featureFeature descriptor selected by MLN_GEOJSON_TYPE_FEATURE. Must not be null.
mln_feature_collectionfeature_collection
union mln_geojsondata

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

#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.

ReturnNameDescription
uint32_tsize
uint32_ttypeOne of mln_geometry_type.
mln_lat_lngpoint
mln_coordinate_spanline_string
mln_polygon_geometrypolygon
mln_coordinate_spanmulti_point
mln_multi_line_geometrymulti_line_string
mln_multi_polygon_geometrymulti_polygon
mln_geometry_collectiongeometry_collection
union mln_geometrydata

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

#include <map.h>

Geographic coordinate in degrees used by map and projection APIs.

ReturnNameDescription
doublelatitudeLatitude in degrees. Input latitude must be finite and within [-90, 90].
doublelongitudeLongitude in degrees. Input longitude must be finite.

double latitude

Latitude in degrees. Input latitude must be finite and within [-90, 90].


double longitude

Longitude in degrees. Input longitude must be finite.

#include <runtime.h>

Overscaled tile identity reported in tile observer events.

ReturnNameDescription
uint32_toverscaled_z
int32_twrap
uint32_tcanonical_z
uint32_tcanonical_x
uint32_tcanonical_y

uint32_t overscaled_z

int32_t wrap

uint32_t canonical_z

uint32_t canonical_x

uint32_t canonical_y

#include <map.h>

Quaternion stored as x, y, z, w components.

ReturnNameDescription
doublex
doubley
doublez
doublew

double x

double y

double z

double w

#include <map.h>

JSON value array view.

ReturnNameDescription
const mln_json_value *valuesValues. Null only when value_count is 0.
size_tvalue_count

const mln_json_value * values

Values. Null only when value_count is 0.


size_t value_count

#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.

ReturnNameDescription
uint32_tsize
uint32_ttypeOne of mln_json_value_type.
boolbool_value
uint64_tuint_value
int64_tint_value
doubledouble_value
mln_string_viewstring_value
mln_json_arrayarray_value
mln_json_objectobject_value
union mln_json_valuedata

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

#include <query.h>

Screen-space box in logical map pixels.

ReturnNameDescription
mln_screen_pointmin
mln_screen_pointmax

mln_screen_point min

mln_screen_point max

#include <map.h>

Screen-space inset in logical map pixels.

ReturnNameDescription
doubletop
doubleleft
doublebottom
doubleright

double top

double left

double bottom

double right

#include <map.h>

JSON object member view.

ReturnNameDescription
mln_string_viewkey
const mln_json_value *valueValue descriptor. Must not be null.

mln_string_view key

const mln_json_value * value

Value descriptor. Must not be null.

#include <map.h>

JSON object member array view.

ReturnNameDescription
const mln_json_member *membersMembers. Null only when member_count is 0.
size_tmember_count

const mln_json_member * members

Members. Null only when member_count is 0.


size_t member_count

#include <map.h>

Options used when creating a map.

ReturnNameDescription
uint32_tsize
uint32_twidth
uint32_theight
doublescale_factor
uint32_tmap_modeOne of mln_map_mode. Defaults to MLN_MAP_MODE_CONTINUOUS.

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.

#include <map.h>

UTF-8 text view. The pointer may be null only when size is 0.

ReturnNameDescription
const char *dataUTF-8 bytes. Null only when size is 0.
size_tsize

const char * data

UTF-8 bytes. Null only when size is 0.


size_t size

#include <map.h>

Cubic easing curve for animated camera transitions.

ReturnNameDescription
doublex1
doubley1
doublex2
doubley2

double x1

double y1

double x2

double y2

#include <map.h>

Screen-space point in logical map pixels.

ReturnNameDescription
doublex
doubley

double x

double y

#include <map.h>

Optional map camera constraint fields.

ReturnNameDescription
uint32_tsize
uint32_tfields
mln_lat_lng_boundsbounds
doublemin_zoom
doublemax_zoom
doublemin_pitch
doublemax_pitch

uint32_t size

uint32_t fields

mln_lat_lng_bounds bounds

double min_zoom

double max_zoom

double min_pitch

double max_pitch

#include <runtime.h>

Event payload returned by mln_runtime_poll_event().

ReturnNameDescription
uint32_tsize
uint32_ttype
uint32_tsource_typeOne of mln_runtime_event_source_type.
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_tcode
uint32_tpayload_typeOne of mln_runtime_event_payload_type.
const void *payloadBorrowed payload selected by payload_type. Null when payload_size is 0.
size_tpayload_sizeNumber of bytes in payload.
const char *messageBorrowed event message bytes. Null when message_size is 0.
size_tmessage_sizeNumber of bytes in message, excluding the trailing null terminator.

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.

#include <map.h>

Camera fields used for snapshots and camera commands.

ReturnNameDescription
uint32_tsize
uint32_tfields
doublelatitude
doublelongitude
doublecenter_altitude
mln_edge_insetspadding
mln_screen_pointanchor
doublezoom
doublebearing
doublepitch
doubleroll
doublefield_of_view

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

#include <map.h>

Coordinate array view. Coordinates are latitude/longitude pairs.

ReturnNameDescription
const mln_lat_lng *coordinatesCoordinates. Null only when coordinate_count is 0.
size_tcoordinate_count

const mln_lat_lng * coordinates

Coordinates. Null only when coordinate_count is 0.


size_t coordinate_count

#include <map.h>

Geographic bounds in degrees.

ReturnNameDescription
mln_lat_lngsouthwest
mln_lat_lngnortheast

mln_lat_lng southwest

mln_lat_lng northeast

#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.

ReturnNameDescription
uint32_tsize
uint32_tfields
boolaxonometricEnables a non-perspective axonometric render transform.
doublex_skewNative x-skew factor used by the axonometric transform.
doubley_skewNative y-skew factor used by the axonometric transform.

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.

#include <query.h>

One copied query result feature.

ReturnNameDescription
uint32_tsize
uint32_tfields
mln_featurefeatureGeoJSON feature descriptor. Nested pointers are result-owned.
mln_string_viewsource_idNative render source ID when available.
mln_string_viewsource_layer_idNative source layer ID when available.
const mln_json_value *stateRendered feature state when available.

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.

#include <runtime.h>

Rendering statistics reported in MLN_RUNTIME_EVENT_PAYLOAD_RENDER_FRAME.

ReturnNameDescription
uint32_tsize
doubleencoding_timeFrame CPU encoding time in seconds.
doublerendering_timeFrame CPU rendering time in seconds.
int64_tframe_countNumber of frames rendered by the native renderer.
int64_tdraw_call_countDraw calls executed during the most recent frame.
int64_ttotal_draw_call_countTotal draw calls executed by the native renderer.

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.

ReturnNameDescription
uint32_tsize
uint32_tflags
const char *asset_pathFilesystem root for asset:// URLs. Copied during runtime creation.
const char *cache_pathCache database path. Copied during runtime creation.
uint64_tmaximum_cache_sizeMaximum ambient cache size in bytes when the matching flag is set.

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.

#include <map.h>

Polygon ring array view. Each ring is a coordinate span.

ReturnNameDescription
const mln_coordinate_span *ringsRings. Null only when ring_count is 0.
size_tring_count

const mln_coordinate_span * rings

Rings. Null only when ring_count is 0.


size_t ring_count

#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.

ReturnNameDescription
doublenorthingDistance measured northward from the equator, in meters.
doubleeastingDistance measured eastward from the prime meridian, in meters.

double northing

Distance measured northward from the equator, in meters.


double easting

Distance measured eastward from the prime meridian, in meters.

ReturnNameDescription
uint32_tsize
const char *url
uint32_tkind
uint32_tloading_method
uint32_tpriority
uint32_tusage
uint32_tstorage_policy
boolhas_range
uint64_trange_start
uint64_trange_end
boolhas_prior_modified
int64_tprior_modified_unix_ms
boolhas_prior_expires
int64_tprior_expires_unix_ms
const char *prior_etag
const uint8_t *prior_data
size_tprior_data_size

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

#include <map.h>

Optional animation controls for camera transitions.

ReturnNameDescription
uint32_tsize
uint32_tfields
doubleduration_msDuration in milliseconds. Must be finite and non-negative. Values that would overflow MapLibre Native’s internal duration are invalid.
doublevelocityAverage flyTo velocity in screenfuls per second. Must be positive.
doublemin_zoomPeak zoom for flyTo transitions.
mln_unit_beziereasing

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

#include <map.h>

Tile prefetch and LOD tuning controls.

ReturnNameDescription
uint32_tsize
uint32_tfields
uint32_tprefetch_zoom_deltaNative uint8_t prefetch zoom delta.
doublelod_min_radius
doublelod_scale
doublelod_pitch_threshold
doublelod_zoom_shift
uint32_tlod_modeOne of mln_tile_lod_mode.

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.

ReturnNameDescription
uint32_tsize
mln_resource_provider_callbackcallback
void *user_data

uint32_t size

mln_resource_provider_callback callback

void * user_data

ReturnNameDescription
uint32_tsize
uint32_tstatus
uint32_terror_reason
const uint8_t *bytesResponse bytes. May be null only when byte_count is 0.
size_tbyte_count
const char *error_message
boolmust_revalidate
boolhas_modified
int64_tmodified_unix_ms
boolhas_expires
int64_texpires_unix_ms
const char *etag
boolhas_retry_after
int64_tretry_after_unix_ms

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

#include <style.h>

Fixed metadata for one runtime style image.

ReturnNameDescription
uint32_tsize
uint32_twidth
uint32_theight
uint32_tstrideNative copied images are exposed as tightly packed premultiplied RGBA8.
size_tbyte_length
floatpixel_ratio
boolsdf

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

#include <style.h>

Canonical tile identity used by custom geometry source callbacks.

ReturnNameDescription
uint32_tz
uint32_tx
uint32_ty

uint32_t z

uint32_t x

uint32_t y

#include <map.h>

Feature collection view.

ReturnNameDescription
const mln_feature *featuresFeatures. Null only when feature_count is 0.
size_tfeature_count

const mln_feature * features

Features. Null only when feature_count is 0.


size_t feature_count

ReturnNameDescription
uint32_tsize
mln_resource_transform_callbackcallback
void *user_data

uint32_t size

mln_resource_transform_callback callback

void * user_data

#include <style.h>

Fixed source metadata returned by mln_map_get_style_source_info().

ReturnNameDescription
uint32_tsize
uint32_ttypeOne of mln_style_source_type.
size_tid_sizeSource ID byte length, excluding any null terminator.
boolis_volatile
boolhas_attribution
size_tattribution_sizeAttribution byte length, excluding any null terminator.

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.

#include <map.h>

Optional fitting controls for camera-for-viewport queries.

ReturnNameDescription
uint32_tsize
uint32_tfields
mln_edge_insetspadding
doublebearing
doublepitch

uint32_t size

uint32_t fields

mln_edge_insets padding

double bearing

double pitch

#include <map.h>

Geometry collection view.

ReturnNameDescription
const mln_geometry *geometriesChild geometries. Null only when geometry_count is 0.
size_tgeometry_count

const mln_geometry * geometries

Child geometries. Null only when geometry_count is 0.


size_t geometry_count

#include <query.h>

Screen-space line string in logical map pixels.

ReturnNameDescription
const mln_screen_point *pointsPoints. Null only when point_count is 0.
size_tpoint_count

const mln_screen_point * points

Points. Null only when point_count is 0.


size_t point_count

#include <texture.h>

CPU image readback metadata for a texture session frame.

ReturnNameDescription
uint32_tsize
uint32_twidthPhysical image width in device pixels.
uint32_theightPhysical image height in device pixels.
uint32_tstrideBytes per image row.
size_tbyte_lengthRequired output buffer byte length.

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.

#include <map.h>

Free camera position and orientation in MapLibre Native camera space.

ReturnNameDescription
uint32_tsize
uint32_tfields
mln_vec3position
mln_quaternionorientation

uint32_t size

uint32_t fields

mln_vec3 position

mln_quaternion orientation

#include <map.h>

Multi-line geometry view. Each line is a coordinate span.

ReturnNameDescription
const mln_coordinate_span *linesLines. Null only when line_count is 0.
size_tline_count

const mln_coordinate_span * lines

Lines. Null only when line_count is 0.


size_t line_count

#include <map.h>

Region data view returned from a snapshot or list handle.

ReturnNameDescription
uint32_tsize
mln_offline_region_idid
mln_offline_region_definitiondefinition
const uint8_t *metadataMetadata bytes. Valid until the owner snapshot/list is destroyed.
size_tmetadata_size

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

#include <style.h>

Options for runtime style images.

ReturnNameDescription
uint32_tsize
uint32_tfields
floatpixel_ratioSprite pixel ratio. Defaults to 1.
boolsdfWhether the image is a signed distance field icon. Defaults to false.

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.

#include <map.h>

Live map viewport and render-transform controls.

ReturnNameDescription
uint32_tsize
uint32_tfields
uint32_tnorth_orientationOne of mln_north_orientation.
uint32_tconstrain_modeOne of mln_constrain_mode.
uint32_tviewport_modeOne of mln_viewport_mode.
mln_edge_insetsfrustum_offset

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

#include <runtime.h>

Offline region status snapshot.

ReturnNameDescription
uint32_tsize
uint32_tdownload_stateOne of mln_offline_region_download_state.
uint64_tcompleted_resource_count
uint64_tcompleted_resource_size
uint64_tcompleted_tile_count
uint64_trequired_tile_count
uint64_tcompleted_tile_size
uint64_trequired_resource_count
boolrequired_resource_count_is_precise
boolcomplete

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

#include <map.h>

Feature-state source, feature, and key selector.

ReturnNameDescription
uint32_tsize
uint32_tfields
mln_string_viewsource_idSource ID. Required and borrowed for the duration of the call.
mln_string_viewsource_layer_idOptional source layer ID. Required for vector-source disambiguation.
mln_string_viewfeature_idOptional feature ID string. Required by set/get and optional for remove.
mln_string_viewstate_keyOptional state key. Used only by remove and requires feature_id.

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.

#include <map.h>

Multi-polygon geometry view. Each polygon contains ring views.

ReturnNameDescription
const mln_polygon_geometry *polygonsPolygons. Null only when polygon_count is 0.
size_tpolygon_count

const mln_polygon_geometry * polygons

Polygons. Null only when polygon_count is 0.


size_t polygon_count

#include <query.h>

Rendered feature query geometry descriptor.

ReturnNameDescription
uint32_tsize
uint32_ttypeOne of mln_rendered_query_geometry_type.
mln_screen_pointpoint
mln_screen_boxbox
mln_screen_line_stringline_string
union mln_rendered_query_geometrydata

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

#include <surface.h>

Metal native surface session attachment options.

ReturnNameDescription
uint32_tsize
uint32_twidthLogical map width in UI pixels.
uint32_theightLogical map height in UI pixels.
doublescale_factorUI-to-device pixel scale. Must be positive and finite.
void *layerCAMetalLayer* / CA::MetalLayer* retained by the session. Required.
void *deviceOptional id / MTL::Device* retained by the session.

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 / MTL::Device* retained by the session.

#include <texture.h>

Default texture session attachment options for a session-owned target.

ReturnNameDescription
uint32_tsize
uint32_twidthLogical map width in UI pixels.
uint32_theightLogical map height in UI pixels.
doublescale_factorUI-to-device pixel scale. Must be positive and finite.

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.

#include <map.h>

Tagged offline region definition.

ReturnNameDescription
uint32_tsize
uint32_ttypeOne of mln_offline_region_definition_type.
mln_offline_tile_pyramid_region_definitiontile_pyramid
mln_offline_geometry_region_definitiongeometry
union mln_offline_region_definitiondata

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

#include <style.h>

Caller-owned premultiplied RGBA8 image pixels.

ReturnNameDescription
uint32_tsize
uint32_twidth
uint32_theight
uint32_tstrideBytes per image row. Must be at least width * 4.
const uint8_t *pixelsPremultiplied RGBA8 pixels. Must not be null for a non-empty image.
size_tbyte_lengthAvailable bytes at pixels.

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.

#include <runtime.h>

Payload for MLN_RUNTIME_EVENT_MAP_RENDER_MAP_FINISHED.

ReturnNameDescription
uint32_tsize
uint32_tmodeOne of mln_render_mode.

uint32_t size

uint32_t mode

One of mln_render_mode.

#include <surface.h>

Vulkan native surface session attachment options.

ReturnNameDescription
uint32_tsize
uint32_twidthLogical map width in UI pixels.
uint32_theightLogical map height in UI pixels.
doublescale_factorUI-to-device pixel scale. Must be positive and finite.
void *instanceBorrowed VkInstance. Required.
void *physical_deviceBorrowed VkPhysicalDevice. Required.
void *deviceBorrowed VkDevice with VK_KHR_swapchain enabled. Required.
void *graphics_queueBorrowed graphics VkQueue. Required.
uint32_tgraphics_queue_family_indexQueue family index for graphics_queue. Must support graphics commands and presentation to surface.
void *surfaceBorrowed VkSurfaceKHR. Required.

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.

#include <texture.h>

Metal frame acquired from a session-owned texture target.

ReturnNameDescription
uint32_tsize
uint64_tgenerationSession generation that produced this frame.
uint32_twidthPhysical Metal texture width in device pixels.
uint32_theightPhysical Metal texture height in device pixels.
doublescale_factorUI-to-device pixel scale used for this frame.
uint64_tframe_idOpaque frame identity used to reject stale releases.
void *textureBorrowed id / MTL::Texture*. Valid until frame release.
void *deviceBorrowed id / MTL::Device*. Valid until frame release.
uint64_tpixel_formatBackend-native pixel format value. Metal uses MTLPixelFormat.

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 / MTL::Texture*. Valid until frame release.


void * device

Borrowed id / MTL::Device*. Valid until frame release.


uint64_t pixel_format

Backend-native pixel format value. Metal uses MTLPixelFormat.

#include <runtime.h>

Payload for MLN_RUNTIME_EVENT_MAP_TILE_ACTION.

ReturnNameDescription
uint32_tsize
uint32_toperationOne of mln_tile_operation.
mln_tile_idtile_id
const char *source_idBorrowed source ID bytes. Valid until the next poll for this runtime or until the runtime is destroyed.
size_tsource_id_sizeNumber of bytes in source_id, excluding the trailing null terminator.

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.

#include <style.h>

Options for vector and raster tile sources.

ReturnNameDescription
uint32_tsize
uint32_tfields
doublemin_zoom
doublemax_zoom
mln_string_viewattribution
uint32_tschemeOne of mln_style_tile_scheme. Defaults to MLN_STYLE_TILE_SCHEME_XYZ.
mln_lat_lng_boundsbounds
uint32_ttile_sizeRaster tile size in pixels. Defaults to 512.
uint32_tvector_encodingOne of mln_style_vector_tile_encoding. Defaults to MVT.
uint32_traster_encodingOne of mln_style_raster_dem_encoding. Defaults to Mapbox.

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.

ReturnNameDescription
uint32_tsize
const char *urlReplacement URL. Null or empty keeps the original URL. Copied on return.

uint32_t size

const char * url

Replacement URL. Null or empty keeps the original URL. Copied on return.

#include <runtime.h>

Payload for MLN_RUNTIME_EVENT_MAP_RENDER_FRAME_FINISHED.

ReturnNameDescription
uint32_tsize
uint32_tmodeOne of mln_render_mode.
boolneeds_repaintWhether MapLibre needs another frame after this one.
boolplacement_changedWhether symbol placement changed during this frame.
mln_rendering_statsstats

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

#include <texture.h>

Vulkan frame acquired from a session-owned texture target.

ReturnNameDescription
uint32_tsize
uint64_tgenerationSession generation that produced this frame.
uint32_twidthPhysical Vulkan image width in device pixels.
uint32_theightPhysical Vulkan image height in device pixels.
doublescale_factorUI-to-device pixel scale used for this frame.
uint64_tframe_idOpaque frame identity used to reject stale releases.
void *imageBorrowed VkImage. Valid until frame release.
void *image_viewBorrowed VkImageView. Valid until frame release.
void *deviceBorrowed VkDevice. Valid until frame release.
uint32_tformatBackend-native VkFormat value.
uint32_tlayoutBackend-native VkImageLayout value; Vulkan frames are host-sampleable.

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.

#include <query.h>

Options for source feature queries.

ReturnNameDescription
uint32_tsize
uint32_tfields
const mln_string_view *source_layer_idsOptional source-layer IDs. Required by vector sources; ignored by GeoJSON.
size_tsource_layer_id_count
const mln_json_value *filterOptional MapLibre style-spec filter JSON. Null means no filter.

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.

#include <query.h>

Tagged feature extension query result view.

ReturnNameDescription
uint32_tsize
uint32_ttypeOne of mln_feature_extension_result_type.
const mln_json_value *valueJSON-like value view selected by MLN_FEATURE_EXTENSION_RESULT_TYPE_VALUE.
mln_feature_collectionfeature_collectionFeature collection view selected by MLN_FEATURE_EXTENSION_RESULT_TYPE_FEATURE_COLLECTION.
union mln_feature_extension_result_infodata

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

#include <style.h>

Options for custom geometry sources.

ReturnNameDescription
uint32_tsize
uint32_tfields
mln_custom_geometry_source_tile_callbackfetch_tileRequired tile fetch callback.
mln_custom_geometry_source_tile_callbackcancel_tileOptional best-effort tile cancel callback.
void *user_dataCaller-owned callback context retained by pointer.
doublemin_zoom
doublemax_zoom
doubletolerance
uint32_ttile_size
uint32_tbuffer
boolclip
boolwrap

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

#include <texture.h>

Metal texture session attachment options for a session-owned target.

ReturnNameDescription
uint32_tsize
uint32_twidthLogical map width in UI pixels.
uint32_theightLogical map height in UI pixels.
doublescale_factorUI-to-device pixel scale. Must be positive and finite.
void *deviceid / MTL::Device* retained by the session. Required.

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 / MTL::Device* retained by the session. Required.

#include <query.h>

Options for rendered feature queries.

ReturnNameDescription
uint32_tsize
uint32_tfields
const mln_string_view *layer_idsOptional style layer IDs. When absent, all rendered layers are queried.
size_tlayer_id_count
const mln_json_value *filterOptional MapLibre style-spec filter JSON. Null means no filter.

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.

#include <texture.h>

Vulkan texture session attachment options for a session-owned target.

ReturnNameDescription
uint32_tsize
uint32_twidthLogical map width in UI pixels.
uint32_theightLogical map height in UI pixels.
doublescale_factorUI-to-device pixel scale. Must be positive and finite.
void *instanceBorrowed VkInstance. Required.
void *physical_deviceBorrowed VkPhysicalDevice. Required.
void *deviceBorrowed VkDevice. Required.
void *graphics_queueBorrowed graphics VkQueue. Required.
uint32_tgraphics_queue_family_indexQueue family index for graphics_queue. Must support graphics commands.

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.

#include <texture.h>

Metal caller-owned texture session attachment options.

ReturnNameDescription
uint32_tsize
uint32_twidthLogical map width in UI pixels.
uint32_theightLogical map height in UI pixels.
doublescale_factorUI-to-device pixel scale. Must be positive and finite.
void *textureBorrowed id / MTL::Texture*. Required.

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 / MTL::Texture*. Required.

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.

#include <map.h>

Geometry offline region definition.

ReturnNameDescription
uint32_tsize
const char *style_urlStyle URL. Copied during region creation.
const mln_geometry *geometryGeometry descriptor. Borrowed for the duration of region creation.
doublemin_zoom
doublemax_zoomMaximum zoom. Positive infinity follows MapLibre Native behavior and lets each tile source use its own maximum zoom.
floatpixel_ratio
boolinclude_ideographs

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

#include <runtime.h>

Payload for MLN_RUNTIME_EVENT_MAP_STYLE_IMAGE_MISSING.

ReturnNameDescription
uint32_tsize
const char *image_idBorrowed image ID bytes. Valid until the next poll for this runtime or until the runtime is destroyed.
size_timage_id_sizeNumber of bytes in image_id, excluding the trailing null terminator.

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.

#include <texture.h>

Vulkan caller-owned texture session attachment options.

ReturnNameDescription
uint32_tsize
uint32_twidthLogical map width in UI pixels.
uint32_theightLogical map height in UI pixels.
doublescale_factorUI-to-device pixel scale. Must be positive and finite.
void *instanceBorrowed VkInstance. Required.
void *physical_deviceBorrowed VkPhysicalDevice. Required.
void *deviceBorrowed VkDevice. Required.
void *graphics_queueBorrowed graphics VkQueue. Required.
uint32_tgraphics_queue_family_indexQueue family index for graphics_queue. Must support graphics commands.
void *imageBorrowed VkImage. Required.
void *image_viewBorrowed VkImageView for image. Required.
uint32_tformatBackend-native VkFormat value for image. VK_FORMAT_UNDEFINED is invalid.
uint32_tinitial_layoutBackend-native VkImageLayout value expected at render-pass begin.
uint32_tfinal_layoutBackend-native VkImageLayout value left after rendering succeeds.

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.

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.


void * image_view

Borrowed VkImageView for image. Required.

The view must be a 2D color view that matches image and format.


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.

Use VK_IMAGE_LAYOUT_UNDEFINED when the previous image contents may be discarded.


uint32_t final_layout

Backend-native VkImageLayout value left after rendering succeeds.

#include <runtime.h>

Payload for MLN_RUNTIME_EVENT_OFFLINE_REGION_STATUS_CHANGED.

ReturnNameDescription
uint32_tsize
mln_offline_region_idregion_id
mln_offline_region_statusstatus

uint32_t size

mln_offline_region_id region_id

mln_offline_region_status status

mln_offline_tile_pyramid_region_definition

Section titled “mln_offline_tile_pyramid_region_definition”
#include <map.h>

Tile-pyramid offline region definition.

ReturnNameDescription
uint32_tsize
const char *style_urlStyle URL. Copied during region creation.
mln_lat_lng_boundsbounds
doublemin_zoom
doublemax_zoomMaximum zoom. Positive infinity follows MapLibre Native behavior and lets each tile source use its own maximum zoom.
floatpixel_ratio
boolinclude_ideographs

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

mln_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.

ReturnNameDescription
uint32_tsize
mln_offline_region_idregion_id
uint32_treasonOne of mln_resource_error_reason.

uint32_t size

mln_offline_region_id region_id

uint32_t reason

One 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.

ReturnNameDescription
uint32_tsize
mln_offline_region_idregion_id
uint64_tlimit

uint32_t size

mln_offline_region_id region_id

uint64_t limit

Generated by Moxygen