|
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 projection helpers.
| 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 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 mln_map_projection_destroy | ( | mln_map_projection * | projection | ) |
Destroys a standalone projection helper.
Returns:
| 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 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 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 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 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 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 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: