|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
#include <style.h>
Data Fields | |
| double | min_zoom |
| double | max_zoom |
| double | tolerance |
| double | cluster_max_zoom |
| mln_buffer_view | cluster_properties |
| uint32_t | tile_size |
| uint32_t | buffer |
| uint32_t | cluster_radius |
| uint32_t | cluster_min_points |
| bool | line_metrics |
| bool | cluster |
| bool | synchronous_tiling |
Options for GeoJSON sources.
MapLibre Native fixes these options when the source is created, so mln_map_set_geojson_source_url() keeps the options the source was added with, and mln_map_set_geojson_source_data() requires data prepared with matching options.
| uint32_t mln_geojson_source_options::buffer |
Tile buffer in pixels. Defaults to 128.
| bool mln_geojson_source_options::cluster |
Clusters point features. Defaults to false.
Clustering applies to feature collections whose every feature carries point geometry. MapLibre Native clusters feature collections only, so mln_geojson_source_data_create() rejects a bare geometry or a single feature, along with a feature collection that mixes in other geometry. An empty feature collection stays accepted and carries nothing to cluster.
| double mln_geojson_source_options::cluster_max_zoom |
Highest zoom that clusters points. Defaults to 17.
| uint32_t mln_geojson_source_options::cluster_min_points |
Points required to form a cluster. Defaults to 2.
| mln_buffer_view mln_geojson_source_options::cluster_properties |
Cluster aggregation expressions keyed by property name, as a JSON object whose members follow the MapLibre Style Spec clusterProperties form. The UTF-8 bytes are borrowed for the call.
| uint32_t mln_geojson_source_options::cluster_radius |
Cluster radius in pixels. Defaults to 50.
| bool mln_geojson_source_options::line_metrics |
Adds line distance metrics to line features. Defaults to false.
| double mln_geojson_source_options::max_zoom |
Maximum tiling zoom. Defaults to 18.
| double mln_geojson_source_options::min_zoom |
Minimum tiling zoom. Defaults to 0.
| bool mln_geojson_source_options::synchronous_tiling |
Slices requested tiles inline during the update pass. Defaults to false.
MapLibre Native normally slices tiles out of the prepared data index on a worker and shows them in a later frame. When this is set, slicing runs inline, so data installed through mln_map_set_geojson_source_data() reaches the next rendered frame at the cost of that work running on the update thread. mln_map_set_geojson_source_synchronous_tiling() overrides this at runtime.
| uint32_t mln_geojson_source_options::tile_size |
Tile extent in pixels. Defaults to 512.
| double mln_geojson_source_options::tolerance |
Douglas-Peucker simplification tolerance. Defaults to 0.375.