|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Public C API declarations for map camera and coordinate conversion.
| mln_animation_options mln_animation_options_default | ( | void | ) |
Returns empty animation 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_camera_delta mln_camera_delta_default | ( | void | ) |
Returns an empty relative camera update initialized for this API version.
| mln_camera_fit_options mln_camera_fit_options_default | ( | void | ) |
Returns empty camera fitting options initialized for this C API version.
| mln_camera_options mln_camera_options_default | ( | void | ) |
Returns empty camera options initialized for this C API version.
| mln_camera_update mln_camera_update_default | ( | void | ) |
Returns an empty atomic camera update initialized for this API version.
| mln_free_camera_options mln_free_camera_options_default | ( | void | ) |
Returns empty free camera options initialized for this C API version.
| mln_status mln_map_apply_camera_delta | ( | mln_map | map, |
| const mln_camera_delta * | delta, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits one atomic relative camera update.
The delta is copied before return. Its components and gesture phase apply in one command: render sessions receive one render update for the whole delta, and the completion reports its terminal disposition and the one snapshot generation that the delta published. The command completion reports application of the delta, and delta->animation.end_handler reports the end of all its transitions once.
Validation reads only the fields that delta->fields selects.
Returns:
Completes with:
| mln_status mln_map_camera_for_geometry | ( | mln_map | map, |
| mln_buffer_view | geometry, | ||
| const mln_camera_fit_options * | fit_options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered query for a camera that fits a GeoJSON geometry.
The query owns a copy of the geometry bytes and fit_options. The completion borrows one mln_camera_options.
Returns:
Completes with:
| mln_status mln_map_camera_for_lat_lng_bounds | ( | mln_map | map, |
| mln_lat_lng_bounds | bounds, | ||
| const mln_camera_fit_options * | fit_options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered query for a camera that fits geographic bounds.
Inputs are copied before this function returns. The query observes every map command accepted before it. Pass null fit_options for default fitting controls. The completion borrows one mln_camera_options.
Returns:
Completes with:
| 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, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered query for a camera that fits geographic coordinates.
The query owns a copy of coordinates and fit_options. The completion borrows one mln_camera_options.
Returns:
Completes with:
| mln_status mln_map_cancel_camera_transition | ( | mln_map | map, |
| uint64_t | transition_id, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Cancels the camera transitions of the commands whose animation carried transition_id, and leaves every other transition running.
The command matches the commands running when it commits whose mln_animation_options selected MLN_ANIMATION_OPTION_TRANSITION_ID with this value. The transitions stop where they stand, and each matched command's end handler runs with MLN_CAMERA_TRANSITION_OUTCOME_CANCELLED. Cancelling an identity that no running command carries commits and changes nothing.
Returns:
Completes with:
| mln_status mln_map_cancel_transitions | ( | mln_map | map, |
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Cancels the camera transitions running when this command commits.
Each cancelled command's end handler runs with MLN_CAMERA_TRANSITION_OUTCOME_CANCELLED. Cancelling with no transition running commits and changes nothing.
Returns:
Completes with:
| mln_status mln_map_dump_debug_logs | ( | mln_map | map, |
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits an ordered debug-log command.
Returns:
Completes with:
| mln_status mln_map_get_camera | ( | mln_map | map, |
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered camera read.
The query observes every command accepted before it. The completion borrows one mln_camera_query_result.
Returns:
Completes with:
| mln_status mln_map_lat_lng_bounds_for_camera | ( | mln_map | map, |
| const mln_camera_options * | camera, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered wrapped-bounds query for a copied camera.
The result is the hull of the top-left and bottom-right screen corners for that camera in the current viewport. When bearing and pitch are zero, the box equals the visible area. Those corners are the northwest and southeast of the viewport. Longitudes stay in -180 to 180. The completion borrows one mln_lat_lng_bounds.
Returns:
Completes with:
| mln_status mln_map_lat_lng_bounds_for_camera_unwrapped | ( | mln_map | map, |
| const mln_camera_options * | camera, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Starts an ordered unwrapped-bounds query for a copied camera.
The result is the axis-aligned hull of all four screen corners and the center, which encompasses the projected viewport. Longitudes unwrap onto the shortest path through the center. A viewport that crosses the antimeridian reports values outside -180 to 180. A center exactly on the antimeridian may resolve to 180 or -180 from floating-point rounding, so its hull may extend past either end of that range. The completion borrows one mln_lat_lng_bounds.
Returns:
Completes with:
| mln_status mln_map_set_bounds | ( | mln_map | map, |
| const mln_bound_options * | options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits a copied camera-constraint command.
The committed constraints are visible through mln_map_get_snapshot as snapshot.bounds.
Returns:
Completes with:
| mln_status mln_map_set_debug_options | ( | mln_map | map, |
| uint32_t | options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits a debug-overlay command.
The committed mask is visible through mln_map_get_snapshot as snapshot.debug_options.
Returns:
Completes with:
| mln_status mln_map_set_free_camera_options | ( | mln_map | map, |
| const mln_free_camera_options * | options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits a copied free-camera command.
The committed options are visible through mln_map_get_snapshot as snapshot.free_camera.
Returns:
Completes with:
| mln_status mln_map_set_projection_mode | ( | mln_map | map, |
| const mln_projection_mode * | mode, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits copied axonometric rendering option fields.
Only fields selected by mode->fields affect the map. Unspecified fields keep their current native values. The completion reports the terminal disposition and published snapshot generation.
Returns:
Completes with:
| mln_status mln_map_set_rendering_stats_view_enabled | ( | mln_map | map, |
| bool | enabled, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits a rendering-stats visibility command.
The committed value is visible through mln_map_get_snapshot as snapshot.rendering_stats_view_enabled.
Returns:
Completes with:
| mln_status mln_map_set_tile_options | ( | mln_map | map, |
| const mln_map_tile_options * | options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits a copied tile-options command.
The committed options are visible through mln_map_get_snapshot as snapshot.tile.
Returns:
Completes with:
| mln_status mln_map_set_viewport_options | ( | mln_map | map, |
| const mln_map_viewport_options * | options, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits a copied viewport-options command.
The committed options are visible through mln_map_get_snapshot as snapshot.view.viewport.
Returns:
Completes with:
| 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_update_camera | ( | mln_map | map, |
| const mln_camera_update * | update, | ||
| const mln_completion * | completion, | ||
| mln_diagnostic * | out_diagnostic ) |
Submits one atomic camera update.
The update is copied before return. The completion reports its terminal disposition, the snapshot generation that the update published, and the render update generation that includes it. update->gesture_phase is applied around the camera write; see mln_gesture_phase.
Each selected camera field replaces that field's animation. Omitted fields retain their animations and timing. A flight couples center and zoom; replacing either stops both. An anchor couples center with all fields in its update; replacing any of them stops that anchored update. Explicit center takes precedence over anchor. Constraints apply to the combined camera.
Ease duration defaults to zero. Fly duration is derived from flight distance and velocity when omitted. The command completion reports application of the update, and update->animation.end_handler reports the end of its transitions, including for a jump.
Returns:
Completes with:
| mln_map_viewport_options mln_map_viewport_options_default | ( | void | ) |
Returns empty viewport 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.