MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
style.h File Reference

Go to the source code of this file.

Data Structures

struct  mln_image_stretch
struct  mln_image_content
struct  mln_style_source_tile_info
struct  mln_geo_json_source_options
struct  mln_style_source_info
struct  mln_style_layer_info
struct  mln_canonical_tile_id
struct  mln_custom_geometry_source_options
struct  mln_custom_vector_source_options
struct  mln_premultiplied_rgba8_image
struct  mln_style_image_options
struct  mln_style_image_info
struct  mln_style_transition_options

Typedefs

typedef enum mln_style_source_type mln_style_source_type
typedef enum mln_style_source_info_field mln_style_source_info_field
typedef uint32_t mln_style_source_info_fields
typedef enum mln_style_tile_scheme mln_style_tile_scheme
typedef enum mln_style_vector_tile_encoding mln_style_vector_tile_encoding
typedef enum mln_style_raster_dem_encoding mln_style_raster_dem_encoding
typedef struct mln_image_stretch mln_image_stretch
typedef struct mln_image_content mln_image_content
typedef enum mln_style_image_text_fit mln_style_image_text_fit
typedef enum mln_style_layer_visibility mln_style_layer_visibility
typedef enum mln_geo_json_source_option_field mln_geo_json_source_option_field
typedef uint32_t mln_geo_json_source_option_fields
typedef enum mln_custom_geometry_source_option_field mln_custom_geometry_source_option_field
typedef uint32_t mln_custom_geometry_source_option_fields
typedef enum mln_custom_vector_source_option_field mln_custom_vector_source_option_field
typedef uint32_t mln_custom_vector_source_option_fields
typedef enum mln_style_image_option_field mln_style_image_option_field
typedef uint32_t mln_style_image_option_fields
typedef enum mln_style_image_info_field mln_style_image_info_field
typedef uint32_t mln_style_image_info_fields
typedef enum mln_style_transition_option_field mln_style_transition_option_field
typedef uint32_t mln_style_transition_option_fields
typedef struct mln_style_source_tile_info mln_style_source_tile_info
typedef struct mln_geo_json_source_options mln_geo_json_source_options
typedef struct mln_style_source_info mln_style_source_info
typedef struct mln_style_layer_info mln_style_layer_info
typedef struct mln_canonical_tile_id mln_canonical_tile_id
typedef void(*) mln_custom_source_fetch_tile_callback(void *user_data, mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id)
typedef void(*) mln_custom_source_cancel_tile_callback(void *user_data, mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id)
typedef struct mln_custom_geometry_source_options mln_custom_geometry_source_options
typedef struct mln_custom_vector_source_options mln_custom_vector_source_options
typedef struct mln_premultiplied_rgba8_image mln_premultiplied_rgba8_image
typedef struct mln_style_image_options mln_style_image_options
typedef struct mln_style_image_info mln_style_image_info
typedef struct mln_style_transition_options mln_style_transition_options

Enumerations

enum  mln_style_source_type : uint32_t {
  MLN_STYLE_SOURCE_TYPE_UNKNOWN = 0 , MLN_STYLE_SOURCE_TYPE_VECTOR = 1 , MLN_STYLE_SOURCE_TYPE_RASTER = 2 , MLN_STYLE_SOURCE_TYPE_RASTER_DEM = 3 ,
  MLN_STYLE_SOURCE_TYPE_GEO_JSON = 4 , MLN_STYLE_SOURCE_TYPE_IMAGE = 5 , MLN_STYLE_SOURCE_TYPE_VIDEO = 6 , MLN_STYLE_SOURCE_TYPE_ANNOTATIONS = 7 ,
  MLN_STYLE_SOURCE_TYPE_CUSTOM_GEOMETRY = 8 , MLN_STYLE_SOURCE_TYPE_CUSTOM_VECTOR = 9
}
enum  mln_style_source_info_field : uint32_t {
  MLN_STYLE_SOURCE_INFO_TILE_JSON = 1U << 0U , MLN_STYLE_SOURCE_INFO_BOUNDS = 1U << 1U , MLN_STYLE_SOURCE_INFO_TILE_SIZE = 1U << 2U , MLN_STYLE_SOURCE_INFO_VECTOR_ENCODING = 1U << 3U ,
  MLN_STYLE_SOURCE_INFO_RASTER_ENCODING = 1U << 4U , MLN_STYLE_SOURCE_INFO_GEO_JSON = 1U << 5U
}
enum  mln_style_tile_scheme : uint32_t { MLN_STYLE_TILE_SCHEME_XYZ = 0 , MLN_STYLE_TILE_SCHEME_TMS = 1 }
enum  mln_style_vector_tile_encoding : uint32_t { MLN_STYLE_VECTOR_TILE_ENCODING_MVT = 0 , MLN_STYLE_VECTOR_TILE_ENCODING_MLT = 1 }
enum  mln_style_raster_dem_encoding : uint32_t { MLN_STYLE_RASTER_DEM_ENCODING_MAPBOX = 0 , MLN_STYLE_RASTER_DEM_ENCODING_TERRARIUM = 1 }
enum  mln_style_image_text_fit : uint32_t { MLN_STYLE_IMAGE_TEXT_FIT_STRETCH_OR_SHRINK = 0 , MLN_STYLE_IMAGE_TEXT_FIT_STRETCH_ONLY = 1 , MLN_STYLE_IMAGE_TEXT_FIT_PROPORTIONAL = 2 }
enum  mln_style_layer_visibility : uint32_t { MLN_STYLE_LAYER_VISIBILITY_VISIBLE = 0 , MLN_STYLE_LAYER_VISIBILITY_NONE = 1 }
enum  mln_geo_json_source_option_field : uint32_t {
  MLN_GEO_JSON_SOURCE_OPTION_MIN_ZOOM = 1U << 0U , MLN_GEO_JSON_SOURCE_OPTION_MAX_ZOOM = 1U << 1U , MLN_GEO_JSON_SOURCE_OPTION_TOLERANCE = 1U << 2U , MLN_GEO_JSON_SOURCE_OPTION_CLUSTER_MAX_ZOOM = 1U << 3U ,
  MLN_GEO_JSON_SOURCE_OPTION_BUFFER = 1U << 4U , MLN_GEO_JSON_SOURCE_OPTION_CLUSTER_RADIUS = 1U << 5U , MLN_GEO_JSON_SOURCE_OPTION_CLUSTER_MIN_POINTS = 1U << 6U , MLN_GEO_JSON_SOURCE_OPTION_LINE_METRICS = 1U << 7U ,
  MLN_GEO_JSON_SOURCE_OPTION_CLUSTER = 1U << 8U
}
enum  mln_custom_geometry_source_option_field : uint32_t {
  MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_MIN_ZOOM = 1U << 0U , MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_MAX_ZOOM = 1U << 1U , MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_TOLERANCE = 1U << 2U , MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_TILE_SIZE = 1U << 3U ,
  MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_BUFFER = 1U << 4U , MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_CLIP = 1U << 5U , MLN_CUSTOM_GEOMETRY_SOURCE_OPTION_WRAP = 1U << 6U
}
enum  mln_custom_vector_source_option_field : uint32_t { MLN_CUSTOM_VECTOR_SOURCE_OPTION_MIN_ZOOM = 1U << 0U , MLN_CUSTOM_VECTOR_SOURCE_OPTION_MAX_ZOOM = 1U << 1U }
enum  mln_style_image_option_field : uint32_t {
  MLN_STYLE_IMAGE_OPTION_PIXEL_RATIO = 1U << 0U , MLN_STYLE_IMAGE_OPTION_SDF = 1U << 1U , MLN_STYLE_IMAGE_OPTION_STRETCH_X = 1U << 2U , MLN_STYLE_IMAGE_OPTION_STRETCH_Y = 1U << 3U ,
  MLN_STYLE_IMAGE_OPTION_CONTENT = 1U << 4U , MLN_STYLE_IMAGE_OPTION_TEXT_FIT_WIDTH = 1U << 5U , MLN_STYLE_IMAGE_OPTION_TEXT_FIT_HEIGHT = 1U << 6U , MLN_STYLE_IMAGE_OPTION_KEEP_UNUSED = 1U << 7U
}
enum  mln_style_image_info_field : uint32_t { MLN_STYLE_IMAGE_INFO_CONTENT = 1U << 0U , MLN_STYLE_IMAGE_INFO_TEXT_FIT_WIDTH = 1U << 1U , MLN_STYLE_IMAGE_INFO_TEXT_FIT_HEIGHT = 1U << 2U }
enum  mln_style_transition_option_field : uint32_t { MLN_STYLE_TRANSITION_OPTION_DURATION = 1U << 0U , MLN_STYLE_TRANSITION_OPTION_DELAY = 1U << 1U , MLN_STYLE_TRANSITION_OPTION_ENABLE_PLACEMENT_TRANSITIONS = 1U << 2U }

Functions

mln_status mln_map_set_global_state_property (mln_map map, mln_buffer_view property_name, mln_buffer_view value, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_global_state (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_add_style_source_json (mln_map map, mln_buffer_view source_id, mln_buffer_view source_json, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_remove_style_source (mln_map map, mln_buffer_view source_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_source (mln_map map, mln_buffer_view source_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_source_volatile (mln_map map, mln_buffer_view source_id, bool is_volatile, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_list_style_sources (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_add_geo_json_source (mln_map map, mln_buffer_view source_id, const mln_geo_json_source_options *options, mln_buffer_view attribution, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_geo_json_source_url (mln_map map, mln_buffer_view source_id, mln_buffer_view url, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_geo_json_source_data (mln_map map, mln_buffer_view source_id, mln_buffer_view data, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_geo_json_source_synchronous_tiling (mln_map map, mln_buffer_view source_id, bool enabled, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_add_custom_geometry_source (mln_map map, mln_buffer_view source_id, const mln_custom_geometry_source_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_custom_geometry_source_tile_data (mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id, mln_buffer_view data, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_custom_geometry_source_tile_error (mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id, mln_buffer_view message, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_invalidate_custom_geometry_source_tile (mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_invalidate_custom_geometry_source_region (mln_map map, mln_buffer_view source_id, mln_lat_lng_bounds bounds, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_add_custom_vector_source (mln_map map, mln_buffer_view source_id, const mln_custom_vector_source_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_custom_vector_source_tile_data (mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id, mln_style_vector_tile_encoding encoding, mln_buffer_view data, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_custom_vector_source_tile_error (mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id, mln_buffer_view message, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_invalidate_custom_vector_source_tile (mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_invalidate_custom_vector_source_region (mln_map map, mln_buffer_view source_id, mln_lat_lng_bounds bounds, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_image (mln_map map, mln_buffer_view image_id, const mln_premultiplied_rgba8_image *image, const mln_style_image_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_remove_style_image (mln_map map, mln_buffer_view image_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_image (mln_map map, mln_buffer_view image_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_add_image_source_image (mln_map map, mln_buffer_view source_id, const mln_lat_lng *coordinates, size_t coordinate_count, const mln_premultiplied_rgba8_image *image, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_image_source_url (mln_map map, mln_buffer_view source_id, mln_buffer_view url, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_image_source_image (mln_map map, mln_buffer_view source_id, const mln_premultiplied_rgba8_image *image, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_image_source_coordinates (mln_map map, mln_buffer_view source_id, const mln_lat_lng *coordinates, size_t coordinate_count, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_image_source_coordinates (mln_map map, mln_buffer_view source_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_add_style_layer_json (mln_map map, mln_buffer_view layer_json, mln_buffer_view before_layer_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_remove_style_layer (mln_map map, mln_buffer_view layer_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_layer (mln_map map, mln_buffer_view layer_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_list_style_layers (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_move_style_layer (mln_map map, mln_buffer_view layer_id, mln_buffer_view before_layer_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_layer_json (mln_map map, mln_buffer_view layer_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_light_json (mln_map map, mln_buffer_view light_json, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_light_property (mln_map map, mln_buffer_view property_name, mln_buffer_view value, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_light_property (mln_map map, mln_buffer_view property_name, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_transition_options (mln_map map, const mln_style_transition_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_transition_options (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_layer_property (mln_map map, mln_buffer_view layer_id, mln_buffer_view property_name, mln_buffer_view value, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_layer_property (mln_map map, mln_buffer_view layer_id, mln_buffer_view property_name, const mln_completion *completion, mln_diagnostic *out_diagnostic)

Detailed Description

Read and change the sources, layers, and images of a map's style.

Typedef Documentation

◆ mln_canonical_tile_id

typedef struct mln_canonical_tile_id mln_canonical_tile_id

A tile's zoom level z, column x, and row y, with row 0 at the north.

◆ mln_custom_geometry_source_option_field

◆ mln_custom_geometry_source_option_fields

◆ mln_custom_geometry_source_options

typedef struct mln_custom_geometry_source_options mln_custom_geometry_source_options

The callbacks and options of a custom geometry source.

Zoom levels are whole numbers from 0 to 32.

◆ mln_custom_source_cancel_tile_callback

typedef void(*) mln_custom_source_cancel_tile_callback(void *user_data, mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id)

Reports that a custom source no longer needs a tile.

map and source_id name the source.

Lifetimes: source_id stays valid until the callback returns. The callback borrows map, so it must not release it.

◆ mln_custom_source_fetch_tile_callback

typedef void(*) mln_custom_source_fetch_tile_callback(void *user_data, mln_map map, mln_buffer_view source_id, mln_canonical_tile_id tile_id)

Asks for the data of a tile in a custom source.

map and source_id name the source that asks. Return quickly. Once the data is ready, pass it to mln_map_set_custom_geometry_source_tile_data() or mln_map_set_custom_vector_source_tile_data(). If it fails to load, report that with mln_map_set_custom_geometry_source_tile_error() or mln_map_set_custom_vector_source_tile_error().

Lifetimes: source_id stays valid until the callback returns. The callback borrows map, so it must not release it.

◆ mln_custom_vector_source_option_field

◆ mln_custom_vector_source_option_fields

◆ mln_custom_vector_source_options

typedef struct mln_custom_vector_source_options mln_custom_vector_source_options

The callbacks and options of a custom vector source.

Zoom levels are whole numbers from 0 to 32.

◆ mln_geo_json_source_option_field

◆ mln_geo_json_source_option_fields

◆ mln_geo_json_source_options

typedef struct mln_geo_json_source_options mln_geo_json_source_options

Options for a GeoJSON source.

Zoom levels are whole numbers.

◆ mln_image_content

typedef struct mln_image_content mln_image_content

The area of an image, in image pixels, that text fits inside.

◆ mln_image_stretch

typedef struct mln_image_stretch mln_image_stretch

A range of image pixels, from from to to, that stretches to fit text.

◆ mln_premultiplied_rgba8_image

typedef struct mln_premultiplied_rgba8_image mln_premultiplied_rgba8_image

An image of 8-bit RGBA pixels whose colors are multiplied by their alpha.

◆ mln_style_image_info

typedef struct mln_style_image_info mln_style_image_info

An image in the map's style.

◆ mln_style_image_info_field

◆ mln_style_image_info_fields

◆ mln_style_image_option_field

◆ mln_style_image_option_fields

◆ mln_style_image_options

typedef struct mln_style_image_options mln_style_image_options

Options for a style image, as the sprite spec describes them.

◆ mln_style_image_text_fit

How an image stretches to fit text along one axis.

◆ mln_style_layer_info

typedef struct mln_style_layer_info mln_style_layer_info

A layer in the map's style.

◆ mln_style_layer_visibility

Whether a layer shows.

◆ mln_style_raster_dem_encoding

How a raster DEM tile encodes elevation in its colors.

◆ mln_style_source_info

typedef struct mln_style_source_info mln_style_source_info

A source in the map's style.

◆ mln_style_source_info_field

◆ mln_style_source_info_fields

◆ mln_style_source_tile_info

typedef struct mln_style_source_tile_info mln_style_source_tile_info

The tiles of a source, as the style lists them.

◆ mln_style_source_type

The type of a style source.

◆ mln_style_tile_scheme

Whether a tileset counts tile rows from the north (XYZ) or the south (TMS).

◆ mln_style_transition_option_field

◆ mln_style_transition_option_fields

◆ mln_style_transition_options

typedef struct mln_style_transition_options mln_style_transition_options

The default transition for changes to a style's paint properties.

◆ mln_style_vector_tile_encoding

The format of vector tiles.

Enumeration Type Documentation

◆ mln_custom_geometry_source_option_field

The fields that mln_custom_geometry_source_options sets.

Enumerator
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 

◆ mln_custom_vector_source_option_field

The fields that mln_custom_vector_source_options sets.

Enumerator
MLN_CUSTOM_VECTOR_SOURCE_OPTION_MIN_ZOOM 
MLN_CUSTOM_VECTOR_SOURCE_OPTION_MAX_ZOOM 

◆ mln_geo_json_source_option_field

The fields that mln_geo_json_source_options sets.

Enumerator
MLN_GEO_JSON_SOURCE_OPTION_MIN_ZOOM 
MLN_GEO_JSON_SOURCE_OPTION_MAX_ZOOM 
MLN_GEO_JSON_SOURCE_OPTION_TOLERANCE 
MLN_GEO_JSON_SOURCE_OPTION_CLUSTER_MAX_ZOOM 
MLN_GEO_JSON_SOURCE_OPTION_BUFFER 
MLN_GEO_JSON_SOURCE_OPTION_CLUSTER_RADIUS 
MLN_GEO_JSON_SOURCE_OPTION_CLUSTER_MIN_POINTS 
MLN_GEO_JSON_SOURCE_OPTION_LINE_METRICS 
MLN_GEO_JSON_SOURCE_OPTION_CLUSTER 

◆ mln_style_image_info_field

enum mln_style_image_info_field : uint32_t

The fields that mln_style_image_info sets.

Enumerator
MLN_STYLE_IMAGE_INFO_CONTENT 
MLN_STYLE_IMAGE_INFO_TEXT_FIT_WIDTH 
MLN_STYLE_IMAGE_INFO_TEXT_FIT_HEIGHT 

◆ mln_style_image_option_field

The fields that mln_style_image_options sets.

Enumerator
MLN_STYLE_IMAGE_OPTION_PIXEL_RATIO 
MLN_STYLE_IMAGE_OPTION_SDF 
MLN_STYLE_IMAGE_OPTION_STRETCH_X 
MLN_STYLE_IMAGE_OPTION_STRETCH_Y 
MLN_STYLE_IMAGE_OPTION_CONTENT 
MLN_STYLE_IMAGE_OPTION_TEXT_FIT_WIDTH 
MLN_STYLE_IMAGE_OPTION_TEXT_FIT_HEIGHT 
MLN_STYLE_IMAGE_OPTION_KEEP_UNUSED 

◆ mln_style_image_text_fit

enum mln_style_image_text_fit : uint32_t

How an image stretches to fit text along one axis.

Enumerator
MLN_STYLE_IMAGE_TEXT_FIT_STRETCH_OR_SHRINK 
MLN_STYLE_IMAGE_TEXT_FIT_STRETCH_ONLY 
MLN_STYLE_IMAGE_TEXT_FIT_PROPORTIONAL 

◆ mln_style_layer_visibility

enum mln_style_layer_visibility : uint32_t

Whether a layer shows.

Enumerator
MLN_STYLE_LAYER_VISIBILITY_VISIBLE 
MLN_STYLE_LAYER_VISIBILITY_NONE 

◆ mln_style_raster_dem_encoding

How a raster DEM tile encodes elevation in its colors.

Enumerator
MLN_STYLE_RASTER_DEM_ENCODING_MAPBOX 
MLN_STYLE_RASTER_DEM_ENCODING_TERRARIUM 

◆ mln_style_source_info_field

enum mln_style_source_info_field : uint32_t

The fields that mln_style_source_info sets.

Enumerator
MLN_STYLE_SOURCE_INFO_TILE_JSON 
MLN_STYLE_SOURCE_INFO_BOUNDS 
MLN_STYLE_SOURCE_INFO_TILE_SIZE 
MLN_STYLE_SOURCE_INFO_VECTOR_ENCODING 
MLN_STYLE_SOURCE_INFO_RASTER_ENCODING 
MLN_STYLE_SOURCE_INFO_GEO_JSON 

◆ mln_style_source_type

enum mln_style_source_type : uint32_t

The type of a style source.

Enumerator
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_GEO_JSON 
MLN_STYLE_SOURCE_TYPE_IMAGE 
MLN_STYLE_SOURCE_TYPE_VIDEO 
MLN_STYLE_SOURCE_TYPE_ANNOTATIONS 
MLN_STYLE_SOURCE_TYPE_CUSTOM_GEOMETRY 
MLN_STYLE_SOURCE_TYPE_CUSTOM_VECTOR 

◆ mln_style_tile_scheme

enum mln_style_tile_scheme : uint32_t

Whether a tileset counts tile rows from the north (XYZ) or the south (TMS).

Enumerator
MLN_STYLE_TILE_SCHEME_XYZ 
MLN_STYLE_TILE_SCHEME_TMS 

◆ mln_style_transition_option_field

The fields that mln_style_transition_options sets.

Enumerator
MLN_STYLE_TRANSITION_OPTION_DURATION 
MLN_STYLE_TRANSITION_OPTION_DELAY 
MLN_STYLE_TRANSITION_OPTION_ENABLE_PLACEMENT_TRANSITIONS 

◆ mln_style_vector_tile_encoding

The format of vector tiles.

Enumerator
MLN_STYLE_VECTOR_TILE_ENCODING_MVT 
MLN_STYLE_VECTOR_TILE_ENCODING_MLT 

Function Documentation

◆ mln_map_add_custom_geometry_source()

mln_status mln_map_add_custom_geometry_source ( mln_map map,
mln_buffer_view source_id,
const mln_custom_geometry_source_options * options,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Adds a source whose GeoJSON tiles come from callbacks.

Completes with:

  • MLN_STATUS_ALREADY_EXISTS when the style already has a source named source_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

Lifetimes: When this function returns an error, the caller keeps user_data and the library doesn't call release_user_data.

◆ mln_map_add_custom_vector_source()

mln_status mln_map_add_custom_vector_source ( mln_map map,
mln_buffer_view source_id,
const mln_custom_vector_source_options * options,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Adds a source whose vector tiles come from callbacks.

Completes with:

  • MLN_STATUS_ALREADY_EXISTS when the style already has a source named source_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

Lifetimes: When this function returns an error, the caller keeps user_data and the library doesn't call release_user_data.

◆ mln_map_add_geo_json_source()

mln_status mln_map_add_geo_json_source ( mln_map map,
mln_buffer_view source_id,
const mln_geo_json_source_options * options,
mln_buffer_view attribution,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Adds a GeoJSON source with no data.

Give it data with mln_map_set_geo_json_source_data() or mln_map_set_geo_json_source_url(). Its options stay fixed for as long as the style holds it.

attribution is the source's attribution, or empty for none.

Returns:

  • MLN_STATUS_INVALID_ARGUMENT when an option in options is out of range.

Completes with:

  • MLN_STATUS_ALREADY_EXISTS when the style already has a source named source_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_add_image_source_image()

mln_status mln_map_add_image_source_image ( mln_map map,
mln_buffer_view source_id,
const mln_lat_lng * coordinates,
size_t coordinate_count,
const mln_premultiplied_rgba8_image * image,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Adds an image source that shows image.

coordinates are the image's four corners, clockwise from the top left.

Completes with:

  • MLN_STATUS_ALREADY_EXISTS when the style already has a source named source_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_add_style_layer_json()

mln_status mln_map_add_style_layer_json ( mln_map map,
mln_buffer_view layer_json,
mln_buffer_view before_layer_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Adds a layer to the map's style.

layer_json is a layer object. The layer goes below the layer named before_layer_id, or above every layer when before_layer_id is empty.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no layer named before_layer_id, or no source with the ID that the layer uses.
  • MLN_STATUS_ALREADY_EXISTS when the style already has a layer with the new layer's ID.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_add_style_source_json()

mln_status mln_map_add_style_source_json ( mln_map map,
mln_buffer_view source_id,
mln_buffer_view source_json,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Adds a source to the map's style.

source_json is a source object.

Completes with:

  • MLN_STATUS_ALREADY_EXISTS when the style already has a source named source_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_get_global_state()

mln_status mln_map_get_global_state ( mln_map map,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads the global state of the map's style as a JSON object.

◆ mln_map_get_image_source_coordinates()

mln_status mln_map_get_image_source_coordinates ( mln_map map,
mln_buffer_view source_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads the corners of an image source's image, clockwise from the top left.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't an image source.

◆ mln_map_get_style_image()

mln_status mln_map_get_style_image ( mln_map map,
mln_buffer_view image_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads an image of the map's style.

Completes with no value when the style has no image named image_id.

◆ mln_map_get_style_layer()

mln_status mln_map_get_style_layer ( mln_map map,
mln_buffer_view layer_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads a layer of the map's style.

Completes with no value when the style has no layer named layer_id.

◆ mln_map_get_style_layer_json()

mln_status mln_map_get_style_layer_json ( mln_map map,
mln_buffer_view layer_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads a layer of the map's style as a layer object.

Completes with no value when the style has no layer named layer_id.

◆ mln_map_get_style_layer_property()

mln_status mln_map_get_style_layer_property ( mln_map map,
mln_buffer_view layer_id,
mln_buffer_view property_name,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads a property of a layer in the map's style.

The value can differ in form from the value that was set: a color set as "#ff0000" reads back as ["rgba", 255, 0, 0, 1].

Completes with no value when the layer doesn't set the property.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no layer named layer_id.

◆ mln_map_get_style_light_property()

mln_status mln_map_get_style_light_property ( mln_map map,
mln_buffer_view property_name,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads a property of the light of the map's style.

The value can differ in form from the value that was set: a color set as "#ff0000" reads back as ["rgba", 255, 0, 0, 1].

Completes with no value when the light doesn't set the property.

◆ mln_map_get_style_source()

mln_status mln_map_get_style_source ( mln_map map,
mln_buffer_view source_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads a source of the map's style.

A tile source with a url has an empty attribution until its TileJSON loads, which raises MLN_RUNTIME_EVENT_MAP_SOURCE_CHANGED.

Completes with no value when the style has no source named source_id.

◆ mln_map_get_style_transition_options()

mln_status mln_map_get_style_transition_options ( mln_map map,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads the default transition of the map's style.

◆ mln_map_invalidate_custom_geometry_source_region()

mln_status mln_map_invalidate_custom_geometry_source_region ( mln_map map,
mln_buffer_view source_id,
mln_lat_lng_bounds bounds,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Makes a custom geometry source ask again for the tiles in bounds that the map still needs.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom geometry source.

◆ mln_map_invalidate_custom_geometry_source_tile()

mln_status mln_map_invalidate_custom_geometry_source_tile ( mln_map map,
mln_buffer_view source_id,
mln_canonical_tile_id tile_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Makes a custom geometry source ask for a tile again when the map needs it.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom geometry source.

◆ mln_map_invalidate_custom_vector_source_region()

mln_status mln_map_invalidate_custom_vector_source_region ( mln_map map,
mln_buffer_view source_id,
mln_lat_lng_bounds bounds,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Makes a custom vector source ask again for the tiles in bounds that the map still needs.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom vector source.

◆ mln_map_invalidate_custom_vector_source_tile()

mln_status mln_map_invalidate_custom_vector_source_tile ( mln_map map,
mln_buffer_view source_id,
mln_canonical_tile_id tile_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Makes a custom vector source ask for a tile again when the map needs it.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom vector source.

◆ mln_map_list_style_layers()

mln_status mln_map_list_style_layers ( mln_map map,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Lists the layers of the map's style, from bottom to top.

◆ mln_map_list_style_sources()

mln_status mln_map_list_style_sources ( mln_map map,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Lists the sources of the map's style.

◆ mln_map_move_style_layer()

mln_status mln_map_move_style_layer ( mln_map map,
mln_buffer_view layer_id,
mln_buffer_view before_layer_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Moves a layer of the map's style below the layer named before_layer_id, or above every layer when before_layer_id is empty.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no layer named layer_id or before_layer_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_remove_style_image()

mln_status mln_map_remove_style_image ( mln_map map,
mln_buffer_view image_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Removes an image from the map's style.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no image named image_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_remove_style_layer()

mln_status mln_map_remove_style_layer ( mln_map map,
mln_buffer_view layer_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Removes a layer from the map's style.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no layer named layer_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_remove_style_source()

mln_status mln_map_remove_style_source ( mln_map map,
mln_buffer_view source_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Removes a source from the map's style.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_STATE when a layer still uses the source, or while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_custom_geometry_source_tile_data()

mln_status mln_map_set_custom_geometry_source_tile_data ( mln_map map,
mln_buffer_view source_id,
mln_canonical_tile_id tile_id,
mln_buffer_view data,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets the data of a tile in a custom geometry source.

data is a GeoJSON feature collection, feature, or geometry. The source ignores data for a tile that it hasn't asked for, or has since cancelled.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom geometry source.

◆ mln_map_set_custom_geometry_source_tile_error()

mln_status mln_map_set_custom_geometry_source_tile_error ( mln_map map,
mln_buffer_view source_id,
mln_canonical_tile_id tile_id,
mln_buffer_view message,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reports that a tile of a custom geometry source failed to load.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom geometry source.

◆ mln_map_set_custom_vector_source_tile_data()

mln_status mln_map_set_custom_vector_source_tile_data ( mln_map map,
mln_buffer_view source_id,
mln_canonical_tile_id tile_id,
mln_style_vector_tile_encoding encoding,
mln_buffer_view data,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets the data of a tile in a custom vector source.

data is the tile, encoded as encoding. The source ignores data for a tile that it hasn't asked for, or has since cancelled.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom vector source.

◆ mln_map_set_custom_vector_source_tile_error()

mln_status mln_map_set_custom_vector_source_tile_error ( mln_map map,
mln_buffer_view source_id,
mln_canonical_tile_id tile_id,
mln_buffer_view message,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reports that a tile of a custom vector source failed to load.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a custom vector source.

◆ mln_map_set_geo_json_source_data()

mln_status mln_map_set_geo_json_source_data ( mln_map map,
mln_buffer_view source_id,
mln_buffer_view data,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Replaces the data of a GeoJSON source.

data is a GeoJSON feature collection, feature, or geometry. The library prepares it for the source with the source's options, off the threads that the caller and the runtime use, and the command completes once the source holds it. Later commands don't wait for it. While the source is still preparing earlier data, only the newest data waits to follow it.

With synchronous tiling on, as mln_map_set_geo_json_source_synchronous_tiling() describes, the command prepares data before later commands run, so the data shows in the next frame.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a GeoJSON source, when data isn't valid GeoJSON, or when the source clusters and data isn't a feature collection of points. The source keeps its data.
  • MLN_STATUS_CANCELLED when newer data for the source replaces data while it waits, or when the source's URL, its removal, a style load, or the map's release replaces the source's data before data is ready.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_geo_json_source_synchronous_tiling()

mln_status mln_map_set_geo_json_source_synchronous_tiling ( mln_map map,
mln_buffer_view source_id,
bool enabled,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets whether a GeoJSON source builds its tiles while the map renders.

Building tiles while the map renders, instead of in the background, makes new data show in the next frame. The setting replaces the synchronousUpdate member of the source's JSON, which defaults to false.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a GeoJSON source.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_geo_json_source_url()

mln_status mln_map_set_geo_json_source_url ( mln_map map,
mln_buffer_view source_id,
mln_buffer_view url,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Makes a GeoJSON source load its data from url.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't a GeoJSON source.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_global_state_property()

mln_status mln_map_set_global_state_property ( mln_map map,
mln_buffer_view property_name,
mln_buffer_view value,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets a value that the style's global-state expressions read.

Completes with:

◆ mln_map_set_image_source_coordinates()

mln_status mln_map_set_image_source_coordinates ( mln_map map,
mln_buffer_view source_id,
const mln_lat_lng * coordinates,
size_t coordinate_count,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Moves the image of an image source.

coordinates are the image's four corners, clockwise from the top left.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't an image source.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_image_source_image()

mln_status mln_map_set_image_source_image ( mln_map map,
mln_buffer_view source_id,
const mln_premultiplied_rgba8_image * image,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Replaces the image of an image source.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't an image source.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_image_source_url()

mln_status mln_map_set_image_source_url ( mln_map map,
mln_buffer_view source_id,
mln_buffer_view url,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Makes an image source load its image from url.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_ARGUMENT when the source named source_id isn't an image source.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_style_image()

mln_status mln_map_set_style_image ( mln_map map,
mln_buffer_view image_id,
const mln_premultiplied_rgba8_image * image,
const mln_style_image_options * options,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Adds an image to the map's style, or replaces the image named image_id.

Completes with:

◆ mln_map_set_style_layer_property()

mln_status mln_map_set_style_layer_property ( mln_map map,
mln_buffer_view layer_id,
mln_buffer_view property_name,
mln_buffer_view value,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets a property of a layer in the map's style.

property_name is one of the layer's layout or paint properties, or filter, minzoom, maxzoom, source, or source-layer. A null value resets any of these but source and source-layer to its default.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no layer named layer_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_style_light_json()

mln_status mln_map_set_style_light_json ( mln_map map,
mln_buffer_view light_json,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Replaces the light of the map's style.

Completes with:

◆ mln_map_set_style_light_property()

mln_status mln_map_set_style_light_property ( mln_map map,
mln_buffer_view property_name,
mln_buffer_view value,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets a property of the light of the map's style.

Completes with:

◆ mln_map_set_style_source_volatile()

mln_status mln_map_set_style_source_volatile ( mln_map map,
mln_buffer_view source_id,
bool is_volatile,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets whether a source is volatile.

The map doesn't store the tiles of a volatile source in the persistent cache.

Completes with:

  • MLN_STATUS_NOT_FOUND when the style has no source named source_id.
  • MLN_STATUS_INVALID_STATE while the style isn't loaded, as mln_map_set_style_url() describes.

◆ mln_map_set_style_transition_options()

mln_status mln_map_set_style_transition_options ( mln_map map,
const mln_style_transition_options * options,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets the default transition of the map's style.

Completes with: