|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
#include <map.h>
Data Fields | |
| uint32_t | width |
| uint32_t | height |
| double | scale_factor |
| uint32_t | map_mode |
| bool | fast_pfor_enabled |
| uint64_t | event_mask |
Options used when creating a map.
| uint64_t mln_map_options::event_mask |
Map-originated event types this map queues, as a bitwise OR of mln_runtime_event_mask values.
This field is always read, so set it explicitly. MLN_RUNTIME_EVENT_MASK_ALL selects every event type this library reports and is the value mln_map_options_default() populates. MLN_RUNTIME_EVENT_MASK_NONE queues none.
The mask applies throughout construction, including the camera events that MapLibre reports while it initializes the map's size.
| bool mln_map_options::fast_pfor_enabled |
Decodes MapLibre Tile (MLT) tiles whose integer streams use FastPFOR encodings. Defaults to false.
Enable this on maps that read vector sources created with MLN_STYLE_VECTOR_TILE_ENCODING_MLT from a tile set that uses FastPFOR. It is fixed for the lifetime of the map and applies to every MLT source the map loads. A map created with this false decodes every other MLT encoding and logs a tile parse warning for the FastPFOR ones.
| uint32_t mln_map_options::height |
Initial logical map height in UI pixels. See width.
| uint32_t mln_map_options::map_mode |
One of mln_map_mode. Defaults to MLN_MAP_MODE_CONTINUOUS.
| double mln_map_options::scale_factor |
UI-to-device pixel scale. Must be positive and finite.
Unlike width and height, this is fixed for the lifetime of the map and selects sprites, glyphs, and raster tiles for every frame the map renders. Render targets carry their own scale factor for geometry and shaders, so create the map with the scale factor you intend to render at. A render session attached or resized with a different scale factor logs a warning and renders styled imagery chosen for the map's density.
| uint32_t mln_map_options::width |
Initial logical map width in UI pixels. Must be positive.
Attaching a render session replaces this with the render target extent, and mln_render_session_resize() replaces it again. Until the first attach it is the viewport that camera and projection queries such as mln_map_camera_for_lat_lng_bounds() and mln_map_pixel_for_lat_lng() are answered against.