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

Go to the source code of this file.

Data Structures

struct  mln_logical_extent
struct  mln_logical_size
struct  mln_map_options
struct  mln_screen_point
struct  mln_edge_insets
struct  mln_lat_lng
struct  mln_camera_options
struct  mln_camera
struct  mln_unit_bezier
struct  mln_camera_velocity
struct  mln_camera_transition_end
struct  mln_camera_transition_handler
struct  mln_animation_options
struct  mln_momentum_decay
struct  mln_pan_momentum
struct  mln_momentum_snap
struct  mln_anchored_momentum
struct  mln_gesture_momentum
struct  mln_camera_delta
struct  mln_camera_update
struct  mln_camera_fit_options
struct  mln_camera_fit_update
struct  mln_vec3
struct  mln_quaternion
struct  mln_free_camera_options
struct  mln_free_camera
union  mln_feature_id_data
struct  mln_feature_id
struct  mln_feature_state_selector
struct  mln_lat_lng_bounds
struct  mln_bound_options
struct  mln_camera_bounds
struct  mln_offline_tile_pyramid_region_definition
struct  mln_offline_geometry_region_definition
union  mln_offline_region_definition_data
struct  mln_offline_region_definition
struct  mln_offline_region_info
struct  mln_projected_meters
struct  mln_projection_mode_options
struct  mln_projection_mode
struct  mln_map_viewport_options
struct  mln_map_viewport
struct  mln_map_view
struct  mln_map_tile_options
struct  mln_map_tile_settings
struct  mln_map_snapshot
struct  mln_camera_query_result

Typedefs

typedef enum mln_camera_option_field mln_camera_option_field
typedef uint32_t mln_camera_option_fields
typedef enum mln_animation_option_field mln_animation_option_field
typedef uint32_t mln_animation_option_fields
typedef enum mln_camera_fit_option_field mln_camera_fit_option_field
typedef uint32_t mln_camera_fit_option_fields
typedef enum mln_bound_option_field mln_bound_option_field
typedef uint32_t mln_bound_option_fields
typedef enum mln_free_camera_option_field mln_free_camera_option_field
typedef uint32_t mln_free_camera_option_fields
typedef enum mln_projection_mode_option_field mln_projection_mode_option_field
typedef uint32_t mln_projection_mode_option_fields
typedef enum mln_map_debug_flag mln_map_debug_flag
typedef uint32_t mln_map_debug_flags
typedef enum mln_north_orientation mln_north_orientation
typedef enum mln_constrain_mode mln_constrain_mode
typedef enum mln_viewport_mode mln_viewport_mode
typedef enum mln_map_viewport_option_field mln_map_viewport_option_field
typedef uint32_t mln_map_viewport_option_fields
typedef enum mln_tile_lod_mode mln_tile_lod_mode
typedef enum mln_map_tile_option_field mln_map_tile_option_field
typedef uint32_t mln_map_tile_option_fields
typedef enum mln_map_mode mln_map_mode
typedef struct mln_logical_extent mln_logical_extent
typedef struct mln_logical_size mln_logical_size
typedef enum mln_map_option_field mln_map_option_field
typedef uint32_t mln_map_option_fields
typedef struct mln_map_options mln_map_options
typedef struct mln_screen_point mln_screen_point
typedef struct mln_edge_insets mln_edge_insets
typedef struct mln_lat_lng mln_lat_lng
typedef struct mln_camera_options mln_camera_options
typedef struct mln_camera mln_camera
typedef struct mln_unit_bezier mln_unit_bezier
typedef enum mln_camera_transition_outcome mln_camera_transition_outcome
typedef struct mln_camera_velocity mln_camera_velocity
typedef struct mln_camera_transition_end mln_camera_transition_end
typedef void(*) mln_camera_transition_end_callback(void *user_data, const mln_camera_transition_end *end)
typedef struct mln_camera_transition_handler mln_camera_transition_handler
typedef struct mln_animation_options mln_animation_options
typedef enum mln_camera_update_mode mln_camera_update_mode
typedef enum mln_gesture_phase mln_gesture_phase
typedef enum mln_momentum_decay_model mln_momentum_decay_model
typedef enum mln_momentum_decay_field mln_momentum_decay_field
typedef uint32_t mln_momentum_decay_fields
typedef struct mln_momentum_decay mln_momentum_decay
typedef enum mln_pan_momentum_field mln_pan_momentum_field
typedef uint32_t mln_pan_momentum_fields
typedef struct mln_pan_momentum mln_pan_momentum
typedef enum mln_momentum_snap_field mln_momentum_snap_field
typedef uint32_t mln_momentum_snap_fields
typedef struct mln_momentum_snap mln_momentum_snap
typedef enum mln_anchored_momentum_field mln_anchored_momentum_field
typedef uint32_t mln_anchored_momentum_fields
typedef struct mln_anchored_momentum mln_anchored_momentum
typedef struct mln_gesture_momentum mln_gesture_momentum
typedef enum mln_camera_delta_field mln_camera_delta_field
typedef uint32_t mln_camera_delta_fields
typedef struct mln_camera_delta mln_camera_delta
typedef struct mln_camera_update mln_camera_update
typedef struct mln_camera_fit_options mln_camera_fit_options
typedef struct mln_camera_fit_update mln_camera_fit_update
typedef struct mln_vec3 mln_vec3
typedef struct mln_quaternion mln_quaternion
typedef struct mln_free_camera_options mln_free_camera_options
typedef struct mln_free_camera mln_free_camera
typedef enum mln_feature_id_type mln_feature_id_type
typedef union mln_feature_id_data mln_feature_id_data
typedef struct mln_feature_id mln_feature_id
typedef enum mln_feature_state_selector_field mln_feature_state_selector_field
typedef uint32_t mln_feature_state_selector_fields
typedef struct mln_feature_state_selector mln_feature_state_selector
typedef struct mln_lat_lng_bounds mln_lat_lng_bounds
typedef struct mln_bound_options mln_bound_options
typedef struct mln_camera_bounds mln_camera_bounds
typedef struct mln_offline_tile_pyramid_region_definition mln_offline_tile_pyramid_region_definition
typedef struct mln_offline_geometry_region_definition mln_offline_geometry_region_definition
typedef union mln_offline_region_definition_data mln_offline_region_definition_data
typedef struct mln_offline_region_definition mln_offline_region_definition
typedef struct mln_offline_region_info mln_offline_region_info
typedef struct mln_projected_meters mln_projected_meters
typedef struct mln_projection_mode_options mln_projection_mode_options
typedef struct mln_projection_mode mln_projection_mode
typedef struct mln_map_viewport_options mln_map_viewport_options
typedef struct mln_map_viewport mln_map_viewport
typedef struct mln_map_view mln_map_view
typedef struct mln_map_tile_options mln_map_tile_options
typedef struct mln_map_tile_settings mln_map_tile_settings
typedef struct mln_map_snapshot mln_map_snapshot
typedef struct mln_camera_query_result mln_camera_query_result

Enumerations

enum  mln_camera_option_field : uint32_t {
  MLN_CAMERA_OPTION_CENTER = 1U << 0U , MLN_CAMERA_OPTION_ZOOM = 1U << 1U , MLN_CAMERA_OPTION_BEARING = 1U << 2U , MLN_CAMERA_OPTION_PITCH = 1U << 3U ,
  MLN_CAMERA_OPTION_CENTER_ALTITUDE = 1U << 4U , MLN_CAMERA_OPTION_PADDING = 1U << 5U , MLN_CAMERA_OPTION_ANCHOR = 1U << 6U , MLN_CAMERA_OPTION_ROLL = 1U << 7U ,
  MLN_CAMERA_OPTION_FOV = 1U << 8U
}
enum  mln_animation_option_field : uint32_t {
  MLN_ANIMATION_OPTION_DURATION = 1U << 0U , MLN_ANIMATION_OPTION_VELOCITY = 1U << 1U , MLN_ANIMATION_OPTION_MIN_ZOOM = 1U << 2U , MLN_ANIMATION_OPTION_EASING = 1U << 3U ,
  MLN_ANIMATION_OPTION_TRANSITION_ID = 1U << 4U
}
enum  mln_camera_fit_option_field : uint32_t { MLN_CAMERA_FIT_OPTION_PADDING = 1U << 0U , MLN_CAMERA_FIT_OPTION_BEARING = 1U << 1U , MLN_CAMERA_FIT_OPTION_PITCH = 1U << 2U }
enum  mln_bound_option_field : uint32_t {
  MLN_BOUND_OPTION_BOUNDS = 1U << 0U , MLN_BOUND_OPTION_MIN_ZOOM = 1U << 1U , MLN_BOUND_OPTION_MAX_ZOOM = 1U << 2U , MLN_BOUND_OPTION_MIN_PITCH = 1U << 3U ,
  MLN_BOUND_OPTION_MAX_PITCH = 1U << 4U , MLN_BOUND_OPTION_UNBOUNDED = 1U << 5U
}
enum  mln_free_camera_option_field : uint32_t { MLN_FREE_CAMERA_OPTION_POSITION = 1U << 0U , MLN_FREE_CAMERA_OPTION_ORIENTATION = 1U << 1U }
enum  mln_projection_mode_option_field : uint32_t { MLN_PROJECTION_MODE_OPTION_AXONOMETRIC = 1U << 0U , MLN_PROJECTION_MODE_OPTION_X_SKEW = 1U << 1U , MLN_PROJECTION_MODE_OPTION_Y_SKEW = 1U << 2U }
enum  mln_map_debug_flag : uint32_t {
  MLN_MAP_DEBUG_TILE_BORDERS = 1U << 1U , MLN_MAP_DEBUG_PARSE_STATUS = 1U << 2U , MLN_MAP_DEBUG_TIMESTAMPS = 1U << 3U , MLN_MAP_DEBUG_COLLISION = 1U << 4U ,
  MLN_MAP_DEBUG_OVERDRAW = 1U << 5U , MLN_MAP_DEBUG_STENCIL_CLIP = 1U << 6U , MLN_MAP_DEBUG_DEPTH_BUFFER = 1U << 7U
}
enum  mln_north_orientation : uint32_t { MLN_NORTH_ORIENTATION_UP = 0 , MLN_NORTH_ORIENTATION_RIGHT = 1 , MLN_NORTH_ORIENTATION_DOWN = 2 , MLN_NORTH_ORIENTATION_LEFT = 3 }
enum  mln_constrain_mode : uint32_t { MLN_CONSTRAIN_MODE_NONE = 0 , MLN_CONSTRAIN_MODE_HEIGHT_ONLY = 1 , MLN_CONSTRAIN_MODE_WIDTH_AND_HEIGHT = 2 , MLN_CONSTRAIN_MODE_SCREEN = 3 }
enum  mln_viewport_mode : uint32_t { MLN_VIEWPORT_MODE_DEFAULT = 0 , MLN_VIEWPORT_MODE_FLIPPED_Y = 1 }
enum  mln_map_viewport_option_field : uint32_t { MLN_MAP_VIEWPORT_OPTION_NORTH_ORIENTATION = 1U << 0U , MLN_MAP_VIEWPORT_OPTION_CONSTRAIN_MODE = 1U << 1U , MLN_MAP_VIEWPORT_OPTION_VIEWPORT_MODE = 1U << 2U , MLN_MAP_VIEWPORT_OPTION_FRUSTUM_OFFSET = 1U << 3U }
enum  mln_tile_lod_mode : uint32_t { MLN_TILE_LOD_MODE_DEFAULT = 0 , MLN_TILE_LOD_MODE_DISTANCE = 1 }
enum  mln_map_tile_option_field : uint32_t {
  MLN_MAP_TILE_OPTION_PREFETCH_ZOOM_DELTA = 1U << 0U , MLN_MAP_TILE_OPTION_LOD_MIN_RADIUS = 1U << 1U , MLN_MAP_TILE_OPTION_LOD_SCALE = 1U << 2U , MLN_MAP_TILE_OPTION_LOD_PITCH_THRESHOLD = 1U << 3U ,
  MLN_MAP_TILE_OPTION_LOD_ZOOM_SHIFT = 1U << 4U , MLN_MAP_TILE_OPTION_LOD_MODE = 1U << 5U
}
enum  mln_map_mode : uint32_t { MLN_MAP_MODE_CONTINUOUS = 0 , MLN_MAP_MODE_STATIC = 1 , MLN_MAP_MODE_TILE = 2 }
enum  mln_map_option_field : uint32_t { MLN_MAP_OPTION_EVENT_MASK = 1U << 0U , MLN_MAP_OPTION_TILE_CACHE_ENABLED = 1U << 1U }
enum  mln_camera_transition_outcome : uint32_t { MLN_CAMERA_TRANSITION_OUTCOME_COMPLETED = 0 , MLN_CAMERA_TRANSITION_OUTCOME_CANCELLED = 1 , MLN_CAMERA_TRANSITION_OUTCOME_CLOSED = 2 , MLN_CAMERA_TRANSITION_OUTCOME_REPLACED = 3 }
enum  mln_camera_update_mode : uint32_t { MLN_CAMERA_UPDATE_MODE_JUMP = 0 , MLN_CAMERA_UPDATE_MODE_EASE = 1 , MLN_CAMERA_UPDATE_MODE_FLY = 2 }
enum  mln_gesture_phase : uint32_t {
  MLN_GESTURE_PHASE_NONE = 0 , MLN_GESTURE_PHASE_BEGIN = 1 , MLN_GESTURE_PHASE_UPDATE = 2 , MLN_GESTURE_PHASE_END = 3 ,
  MLN_GESTURE_PHASE_CANCEL = 4
}
enum  mln_momentum_decay_model : uint32_t { MLN_MOMENTUM_DECAY_MODEL_FRICTION = 0 , MLN_MOMENTUM_DECAY_MODEL_EASE = 1 }
enum  mln_momentum_decay_field : uint32_t {
  MLN_MOMENTUM_DECAY_MODEL = 1U << 0U , MLN_MOMENTUM_DECAY_HALF_LIFE_MS = 1U << 1U , MLN_MOMENTUM_DECAY_STOP_SPEED = 1U << 2U , MLN_MOMENTUM_DECAY_DISTANCE = 1U << 3U ,
  MLN_MOMENTUM_DECAY_DURATION_MS = 1U << 4U , MLN_MOMENTUM_DECAY_EASING = 1U << 5U , MLN_MOMENTUM_DECAY_MIN_SPEED = 1U << 6U , MLN_MOMENTUM_DECAY_MAX_SPEED = 1U << 7U ,
  MLN_MOMENTUM_DECAY_MAX_DISTANCE = 1U << 8U
}
enum  mln_pan_momentum_field : uint32_t { MLN_PAN_MOMENTUM_VELOCITY = 1U << 0U }
enum  mln_momentum_snap_field : uint32_t { MLN_MOMENTUM_SNAP_SPACING = 1U << 0U , MLN_MOMENTUM_SNAP_OFFSET = 1U << 1U , MLN_MOMENTUM_SNAP_TOLERANCE = 1U << 2U , MLN_MOMENTUM_SNAP_DURATION_MS = 1U << 3U }
enum  mln_anchored_momentum_field : uint32_t { MLN_ANCHORED_MOMENTUM_VELOCITY = 1U << 0U , MLN_ANCHORED_MOMENTUM_ANCHOR = 1U << 1U , MLN_ANCHORED_MOMENTUM_SNAP = 1U << 2U }
enum  mln_camera_delta_field : uint32_t {
  MLN_CAMERA_DELTA_OFFSET = 1U << 0U , MLN_CAMERA_DELTA_SCALE = 1U << 1U , MLN_CAMERA_DELTA_BEARING = 1U << 2U , MLN_CAMERA_DELTA_PITCH = 1U << 3U ,
  MLN_CAMERA_DELTA_ANCHOR = 1U << 4U , MLN_CAMERA_DELTA_MOMENTUM = 1U << 5U
}
enum  mln_feature_id_type : uint32_t { MLN_FEATURE_ID_TYPE_STRING = 1 , MLN_FEATURE_ID_TYPE_UINT = 2 , MLN_FEATURE_ID_TYPE_INT = 3 , MLN_FEATURE_ID_TYPE_DOUBLE = 4 }
enum  mln_feature_state_selector_field : uint32_t { MLN_FEATURE_STATE_SELECTOR_FEATURE_ID = 1U << 0U }

Functions

mln_status mln_runtime_create_offline_region (mln_runtime runtime, const mln_offline_region_definition *definition, const uint8_t *metadata, size_t metadata_size, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_get_offline_region (mln_runtime runtime, mln_offline_region_id region_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_list_offline_regions (mln_runtime runtime, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_merge_offline_regions (mln_runtime runtime, mln_buffer_view side_database_path, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_update_offline_region_metadata (mln_runtime runtime, mln_offline_region_id region_id, const uint8_t *metadata, size_t metadata_size, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_get_offline_region_status (mln_runtime runtime, mln_offline_region_id region_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_set_offline_region_observed (mln_runtime runtime, mln_offline_region_id region_id, mln_runtime_event_flags events, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_set_offline_region_download_state (mln_runtime runtime, mln_offline_region_id region_id, mln_offline_region_download_state state, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_invalidate_offline_region (mln_runtime runtime, mln_offline_region_id region_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_delete_offline_region (mln_runtime runtime, mln_offline_region_id region_id, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_runtime_create_map (mln_runtime runtime, const mln_map_options *options, mln_map *out_map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_snapshot (mln_map map, mln_map_snapshot *out_snapshot, mln_diagnostic *out_diagnostic)
mln_status mln_map_resize (mln_map map, mln_logical_size logical_size, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_request_repaint (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_begin_command_group (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_end_command_group (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_feature_state (mln_map map, const mln_feature_state_selector *selector, mln_buffer_view state, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_feature_state (mln_map map, const mln_feature_state_selector *selector, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_remove_feature_state (mln_map map, const mln_feature_state_selector *selector, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_request_still_image (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_release (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_dispose (mln_map map, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_url (mln_map map, mln_buffer_view url, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_style_json (mln_map map, mln_buffer_view json, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_loaded_style_json (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_get_style_url (mln_map map, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_status mln_map_set_event_mask (mln_map map, mln_runtime_event_flags mask, const mln_completion *completion, mln_diagnostic *out_diagnostic)

Detailed Description

Maps, the types that describe their camera and view, and offline regions.

Typedef Documentation

◆ mln_anchored_momentum

typedef struct mln_anchored_momentum mln_anchored_momentum

How a gesture's zoom, bearing, or pitch keeps changing after release.

◆ mln_anchored_momentum_field

◆ mln_anchored_momentum_fields

◆ mln_animation_option_field

◆ mln_animation_option_fields

◆ mln_animation_options

typedef struct mln_animation_options mln_animation_options

How a camera change animates.

◆ mln_bound_option_field

◆ mln_bound_option_fields

typedef uint32_t mln_bound_option_fields

A set of mln_bound_option_field bits.

◆ mln_bound_options

typedef struct mln_bound_options mln_bound_options

Limits on the camera, for mln_map_set_bounds().

◆ mln_camera

typedef struct mln_camera mln_camera

A map's whole camera.

◆ mln_camera_bounds

typedef struct mln_camera_bounds mln_camera_bounds

All the limits on a map's camera.

Its members mean the same as those of mln_bound_options.

◆ mln_camera_delta

typedef struct mln_camera_delta mln_camera_delta

A change to the camera from where it is now, for gestures.

◆ mln_camera_delta_field

◆ mln_camera_delta_fields

typedef uint32_t mln_camera_delta_fields

A set of mln_camera_delta_field bits.

◆ mln_camera_fit_option_field

◆ mln_camera_fit_option_fields

◆ mln_camera_fit_options

typedef struct mln_camera_fit_options mln_camera_fit_options

Options for finding the camera that fits an area.

◆ mln_camera_fit_update

typedef struct mln_camera_fit_update mln_camera_fit_update

A camera change that fits an area, for mln_map_fit_camera_to_lat_lng_bounds() and the other fit commands.

A jump uses only the end handler of animation, as in mln_camera_update.

◆ mln_camera_option_field

◆ mln_camera_option_fields

typedef uint32_t mln_camera_option_fields

A set of mln_camera_option_field bits.

◆ mln_camera_options

typedef struct mln_camera_options mln_camera_options

A camera, with only the members that fields selects.

◆ mln_camera_query_result

typedef struct mln_camera_query_result mln_camera_query_result

A map's camera, with the snapshot generation that it matches.

◆ mln_camera_transition_end

typedef struct mln_camera_transition_end mln_camera_transition_end

The end of a camera change.

◆ mln_camera_transition_end_callback

typedef void(*) mln_camera_transition_end_callback(void *user_data, const mln_camera_transition_end *end)

Receives the end of a camera change.

Lifetimes: end stays valid until the callback returns.

◆ mln_camera_transition_handler

typedef struct mln_camera_transition_handler mln_camera_transition_handler

A callback for the end of a camera change, for mln_animation_options.

The callback runs once for each camera command, after every part of the change that the command started has ended.

◆ mln_camera_transition_outcome

How a camera change ended.

A change that ends in more than one way reports MLN_CAMERA_TRANSITION_OUTCOME_CANCELLED if any of it was cancelled, and otherwise MLN_CAMERA_TRANSITION_OUTCOME_REPLACED if any of it was replaced.

◆ mln_camera_update

typedef struct mln_camera_update mln_camera_update

A camera change for mln_map_update_camera().

A jump uses only the end handler of animation, and the handler runs as soon as the camera moves.

◆ mln_camera_update_mode

How a camera command moves the camera.

◆ mln_camera_velocity

typedef struct mln_camera_velocity mln_camera_velocity

How fast each part of a camera change moves.

◆ mln_constrain_mode

How the map keeps the camera within the world or within its bounds.

◆ mln_edge_insets

typedef struct mln_edge_insets mln_edge_insets

Distances in logical pixels from each edge of the map.

◆ mln_feature_id

typedef struct mln_feature_id mln_feature_id

The ID of a feature in a source, as the source's data gives it.

The map compares feature IDs as text. A number names the same feature as the string of its shortest decimal form, so 7, 7.0, and "7" name one feature.

◆ mln_feature_id_data

typedef union mln_feature_id_data mln_feature_id_data

The string or number of an mln_feature_id.

◆ mln_feature_id_type

◆ mln_feature_state_selector

typedef struct mln_feature_state_selector mln_feature_state_selector

The features whose state to set, read, or remove.

◆ mln_feature_state_selector_field

◆ mln_feature_state_selector_fields

◆ mln_free_camera

typedef struct mln_free_camera mln_free_camera

A map camera's whole position and orientation in three dimensions.

Its members mean the same as those of mln_free_camera_options.

◆ mln_free_camera_option_field

◆ mln_free_camera_option_fields

◆ mln_free_camera_options

typedef struct mln_free_camera_options mln_free_camera_options

The camera's position and orientation in three dimensions.

◆ mln_gesture_momentum

typedef struct mln_gesture_momentum mln_gesture_momentum

How a gesture keeps moving the camera after the user lets go.

A part moves only when its velocity is set, and each part slows on its own. Every part defaults to MLN_MOMENTUM_DECAY_MODEL_FRICTION with a half-life of 140 ms, and these other defaults:

  • Pan stops at 10 logical pixels per second, needs a release of at least 200, and counts a release faster than 10000 as 10000.
  • Zoom stops at 0.01 levels per second and moves at most 2.5 levels. Its snap settles on the nearest whole level.
  • Bearing stops at 1 degree per second and needs a release of at least 60. Its snap settles on north within 7 degrees.
  • Pitch stops at 1 degree per second and needs a release of at least 5. Its snap settles flat within 7 degrees.

◆ mln_gesture_phase

Where a camera change falls in a gesture that the user makes.

MLN_GESTURE_PHASE_BEGIN and MLN_GESTURE_PHASE_UPDATE mark a gesture in progress, and MLN_GESTURE_PHASE_END and MLN_GESTURE_PHASE_CANCEL end it.

◆ mln_lat_lng

typedef struct mln_lat_lng mln_lat_lng

A geographic coordinate, in degrees.

◆ mln_lat_lng_bounds

typedef struct mln_lat_lng_bounds mln_lat_lng_bounds

A rectangle of coordinates, from its southwest to its northeast corner.

◆ mln_logical_extent

typedef struct mln_logical_extent mln_logical_extent

A size in logical pixels, and the physical pixels in each logical pixel.

◆ mln_logical_size

typedef struct mln_logical_size mln_logical_size

A size in logical pixels, which the map's scale factor turns into pixels.

◆ mln_map_debug_flag

A debug overlay that the map draws.

◆ mln_map_debug_flags

typedef uint32_t mln_map_debug_flags

A set of mln_map_debug_flag bits.

◆ mln_map_mode

typedef enum mln_map_mode mln_map_mode

When a map renders.

◆ mln_map_option_field

The fields that mln_map_options sets.

◆ mln_map_option_fields

typedef uint32_t mln_map_option_fields

A set of mln_map_option_field bits.

◆ mln_map_options

typedef struct mln_map_options mln_map_options

◆ mln_map_snapshot

typedef struct mln_map_snapshot mln_map_snapshot

A map's state, as mln_map_get_snapshot() reads it.

◆ mln_map_tile_option_field

◆ mln_map_tile_option_fields

typedef uint32_t mln_map_tile_option_fields

A set of mln_map_tile_option_field bits.

◆ mln_map_tile_options

typedef struct mln_map_tile_options mln_map_tile_options

How the map picks the tiles to load.

The lod_ members lower the level of detail away from the camera, so the map loads fewer tiles when the pitch is high.

◆ mln_map_tile_settings

typedef struct mln_map_tile_settings mln_map_tile_settings

All the settings for how a map picks the tiles to load.

Its members mean the same as those of mln_map_tile_options.

◆ mln_map_view

typedef struct mln_map_view mln_map_view

One view of a map: its camera, size, and projection.

◆ mln_map_viewport

typedef struct mln_map_viewport mln_map_viewport

A map's whole viewport.

Its members mean the same as those of mln_map_viewport_options.

◆ mln_map_viewport_option_field

◆ mln_map_viewport_option_fields

◆ mln_map_viewport_options

typedef struct mln_map_viewport_options mln_map_viewport_options

How the map orients and constrains its view.

◆ mln_momentum_decay

typedef struct mln_momentum_decay mln_momentum_decay

How one part of a gesture's momentum slows from its release speed.

Speeds and distances are in the part's unit: logical pixels for pan, zoom levels for zoom, and degrees for bearing and pitch. A setting whose bit isn't set takes the part's default, which mln_gesture_momentum lists. min_speed is finite and not negative, and every other number is finite and positive. A friction decay can serve every release, as a preset that matches a platform's scrolling. An eased glide takes its direction from the part's velocity, and its distance and duration from the caller's plan.

◆ mln_momentum_decay_field

◆ mln_momentum_decay_fields

typedef uint32_t mln_momentum_decay_fields

A set of mln_momentum_decay_field bits.

◆ mln_momentum_decay_model

How a part of a gesture's momentum slows from its release speed.

◆ mln_momentum_snap

typedef struct mln_momentum_snap mln_momentum_snap

Where a part settles after a gesture that changed it.

The targets are every spacing from offset, in the part's unit. Bearing targets wrap around the circle. Once the part's glide ends, or right away when it doesn't move, the part eases to the nearest target if it is within tolerance of it, and otherwise stays where it is. A setting whose bit isn't set takes the part's default, which mln_gesture_momentum lists.

◆ mln_momentum_snap_field

◆ mln_momentum_snap_fields

typedef uint32_t mln_momentum_snap_fields

A set of mln_momentum_snap_field bits.

◆ mln_north_orientation

The screen direction that north points to when the bearing is 0.

◆ mln_offline_geometry_region_definition

typedef struct mln_offline_geometry_region_definition mln_offline_geometry_region_definition

An offline region that covers a GeoJSON geometry.

The members other than geometry mean the same as those of mln_offline_tile_pyramid_region_definition.

◆ mln_offline_region_definition

typedef struct mln_offline_region_definition mln_offline_region_definition

The area, zoom range, and style that an offline region covers.

◆ mln_offline_region_definition_data

typedef union mln_offline_region_definition_data mln_offline_region_definition_data

The rectangle or geometry of an offline region definition.

◆ mln_offline_region_info

typedef struct mln_offline_region_info mln_offline_region_info

An offline region in the runtime's cache file.

◆ mln_offline_tile_pyramid_region_definition

typedef struct mln_offline_tile_pyramid_region_definition mln_offline_tile_pyramid_region_definition

An offline region that covers a rectangle of the map.

◆ mln_pan_momentum

typedef struct mln_pan_momentum mln_pan_momentum

How a gesture's pan keeps moving the map's content after release.

◆ mln_pan_momentum_field

◆ mln_pan_momentum_fields

typedef uint32_t mln_pan_momentum_fields

A set of mln_pan_momentum_field bits.

◆ mln_projected_meters

typedef struct mln_projected_meters mln_projected_meters

A point in the Web Mercator projection, in meters.

◆ mln_projection_mode

typedef struct mln_projection_mode mln_projection_mode

A map's whole projection mode.

Its members mean the same as those of mln_projection_mode_options.

◆ mln_projection_mode_option_field

◆ mln_projection_mode_option_fields

◆ mln_projection_mode_options

typedef struct mln_projection_mode_options mln_projection_mode_options

Settings that skew the map or draw it without perspective.

◆ mln_quaternion

typedef struct mln_quaternion mln_quaternion

A rotation, as a quaternion.

◆ mln_screen_point

typedef struct mln_screen_point mln_screen_point

A point on the screen, in logical pixels from the map's top-left corner.

◆ mln_tile_lod_mode

How the map picks the level of detail of its tiles.

◆ mln_unit_bezier

typedef struct mln_unit_bezier mln_unit_bezier

A timing curve from (0, 0) to (1, 1), with the control points (x1, y1) and (x2, y2).

x1 and x2 are between 0 and 1.

◆ mln_vec3

typedef struct mln_vec3 mln_vec3

A vector in three dimensions.

◆ mln_viewport_mode

The vertical direction of the image that the map renders.

Enumeration Type Documentation

◆ mln_anchored_momentum_field

enum mln_anchored_momentum_field : uint32_t

The fields that mln_anchored_momentum sets.

Enumerator
MLN_ANCHORED_MOMENTUM_VELOCITY 
MLN_ANCHORED_MOMENTUM_ANCHOR 
MLN_ANCHORED_MOMENTUM_SNAP 

◆ mln_animation_option_field

enum mln_animation_option_field : uint32_t

The fields that mln_animation_options sets.

Enumerator
MLN_ANIMATION_OPTION_DURATION 
MLN_ANIMATION_OPTION_VELOCITY 
MLN_ANIMATION_OPTION_MIN_ZOOM 
MLN_ANIMATION_OPTION_EASING 
MLN_ANIMATION_OPTION_TRANSITION_ID 

◆ mln_bound_option_field

enum mln_bound_option_field : uint32_t

The fields that mln_bound_options sets.

Enumerator
MLN_BOUND_OPTION_BOUNDS 
MLN_BOUND_OPTION_MIN_ZOOM 
MLN_BOUND_OPTION_MAX_ZOOM 
MLN_BOUND_OPTION_MIN_PITCH 
MLN_BOUND_OPTION_MAX_PITCH 
MLN_BOUND_OPTION_UNBOUNDED 

Removes the area that limits the camera's center. It can't be combined with MLN_BOUND_OPTION_BOUNDS.

◆ mln_camera_delta_field

enum mln_camera_delta_field : uint32_t

The fields that mln_camera_delta sets.

Enumerator
MLN_CAMERA_DELTA_OFFSET 
MLN_CAMERA_DELTA_SCALE 
MLN_CAMERA_DELTA_BEARING 
MLN_CAMERA_DELTA_PITCH 
MLN_CAMERA_DELTA_ANCHOR 
MLN_CAMERA_DELTA_MOMENTUM 

◆ mln_camera_fit_option_field

enum mln_camera_fit_option_field : uint32_t

The fields that mln_camera_fit_options sets.

Enumerator
MLN_CAMERA_FIT_OPTION_PADDING 
MLN_CAMERA_FIT_OPTION_BEARING 
MLN_CAMERA_FIT_OPTION_PITCH 

◆ mln_camera_option_field

enum mln_camera_option_field : uint32_t

The fields that mln_camera_options sets.

Enumerator
MLN_CAMERA_OPTION_CENTER 
MLN_CAMERA_OPTION_ZOOM 
MLN_CAMERA_OPTION_BEARING 
MLN_CAMERA_OPTION_PITCH 
MLN_CAMERA_OPTION_CENTER_ALTITUDE 
MLN_CAMERA_OPTION_PADDING 
MLN_CAMERA_OPTION_ANCHOR 
MLN_CAMERA_OPTION_ROLL 
MLN_CAMERA_OPTION_FOV 

◆ mln_camera_transition_outcome

How a camera change ended.

A change that ends in more than one way reports MLN_CAMERA_TRANSITION_OUTCOME_CANCELLED if any of it was cancelled, and otherwise MLN_CAMERA_TRANSITION_OUTCOME_REPLACED if any of it was replaced.

Enumerator
MLN_CAMERA_TRANSITION_OUTCOME_COMPLETED 

The camera finished the change.

MLN_CAMERA_TRANSITION_OUTCOME_CANCELLED 

mln_map_cancel_camera_transitions(), mln_map_cancel_camera_transitions_with_id(), a gesture's MLN_GESTURE_PHASE_BEGIN or MLN_GESTURE_PHASE_CANCEL, mln_map_set_free_camera_options(), or a resize that moved the camera back inside its bounds stopped the change. A command that fails before it moves the camera also reports this.

MLN_CAMERA_TRANSITION_OUTCOME_CLOSED 

The map closed before the change ended.

MLN_CAMERA_TRANSITION_OUTCOME_REPLACED 

A later camera change set every field that a part of the change was still animating, so that part stopped. Its other parts keep animating, and the change reports this outcome when they end, unless one was cancelled.

A later change that sets only some of those fields leaves the change animating the rest. A fly's center and zoom count as one field, and so do an anchored change's center and the fields that the anchor holds in place.

◆ mln_camera_update_mode

enum mln_camera_update_mode : uint32_t

How a camera command moves the camera.

Enumerator
MLN_CAMERA_UPDATE_MODE_JUMP 

Moves the camera at once.

MLN_CAMERA_UPDATE_MODE_EASE 

Animates the camera straight to the target.

MLN_CAMERA_UPDATE_MODE_FLY 

Zooms out, travels to the target, and zooms back in.

◆ mln_constrain_mode

enum mln_constrain_mode : uint32_t

How the map keeps the camera within the world or within its bounds.

Enumerator
MLN_CONSTRAIN_MODE_NONE 
MLN_CONSTRAIN_MODE_HEIGHT_ONLY 

Keeps the world filling the view from top to bottom.

MLN_CONSTRAIN_MODE_WIDTH_AND_HEIGHT 

Keeps the world filling the view in both directions.

MLN_CONSTRAIN_MODE_SCREEN 

Keeps the whole view inside the bounds from mln_map_set_bounds().

◆ mln_feature_id_type

enum mln_feature_id_type : uint32_t

The type of an mln_feature_id.

Enumerator
MLN_FEATURE_ID_TYPE_STRING 
MLN_FEATURE_ID_TYPE_UINT 
MLN_FEATURE_ID_TYPE_INT 
MLN_FEATURE_ID_TYPE_DOUBLE 

◆ mln_feature_state_selector_field

The fields that mln_feature_state_selector sets.

Enumerator
MLN_FEATURE_STATE_SELECTOR_FEATURE_ID 

◆ mln_free_camera_option_field

The fields that mln_free_camera_options sets.

Enumerator
MLN_FREE_CAMERA_OPTION_POSITION 
MLN_FREE_CAMERA_OPTION_ORIENTATION 

◆ mln_gesture_phase

enum mln_gesture_phase : uint32_t

Where a camera change falls in a gesture that the user makes.

MLN_GESTURE_PHASE_BEGIN and MLN_GESTURE_PHASE_UPDATE mark a gesture in progress, and MLN_GESTURE_PHASE_END and MLN_GESTURE_PHASE_CANCEL end it.

Enumerator
MLN_GESTURE_PHASE_NONE 

The change isn't part of a gesture.

MLN_GESTURE_PHASE_BEGIN 

The gesture starts. This cancels every running camera animation before the change applies.

MLN_GESTURE_PHASE_UPDATE 

The gesture continues. To start a gesture that keeps the running camera animations, start it with this phase instead of MLN_GESTURE_PHASE_BEGIN.

MLN_GESTURE_PHASE_END 
MLN_GESTURE_PHASE_CANCEL 

The platform cancelled the gesture. This also cancels every running camera animation after the change applies.

◆ mln_map_debug_flag

enum mln_map_debug_flag : uint32_t

A debug overlay that the map draws.

Enumerator
MLN_MAP_DEBUG_TILE_BORDERS 
MLN_MAP_DEBUG_PARSE_STATUS 
MLN_MAP_DEBUG_TIMESTAMPS 
MLN_MAP_DEBUG_COLLISION 
MLN_MAP_DEBUG_OVERDRAW 
MLN_MAP_DEBUG_STENCIL_CLIP 
MLN_MAP_DEBUG_DEPTH_BUFFER 

◆ mln_map_mode

enum mln_map_mode : uint32_t

When a map renders.

Enumerator
MLN_MAP_MODE_CONTINUOUS 

Renders whenever the map changes.

MLN_MAP_MODE_STATIC 

Renders only when mln_map_request_still_image() asks for an image.

MLN_MAP_MODE_TILE 

Renders still images of single tiles, as MLN_MAP_MODE_STATIC does.

◆ mln_map_option_field

enum mln_map_option_field : uint32_t

The fields that mln_map_options sets.

Enumerator
MLN_MAP_OPTION_EVENT_MASK 
MLN_MAP_OPTION_TILE_CACHE_ENABLED 

◆ mln_map_tile_option_field

enum mln_map_tile_option_field : uint32_t

The fields that mln_map_tile_options sets.

Enumerator
MLN_MAP_TILE_OPTION_PREFETCH_ZOOM_DELTA 
MLN_MAP_TILE_OPTION_LOD_MIN_RADIUS 
MLN_MAP_TILE_OPTION_LOD_SCALE 
MLN_MAP_TILE_OPTION_LOD_PITCH_THRESHOLD 
MLN_MAP_TILE_OPTION_LOD_ZOOM_SHIFT 
MLN_MAP_TILE_OPTION_LOD_MODE 

◆ mln_map_viewport_option_field

The fields that mln_map_viewport_options sets.

Enumerator
MLN_MAP_VIEWPORT_OPTION_NORTH_ORIENTATION 
MLN_MAP_VIEWPORT_OPTION_CONSTRAIN_MODE 
MLN_MAP_VIEWPORT_OPTION_VIEWPORT_MODE 
MLN_MAP_VIEWPORT_OPTION_FRUSTUM_OFFSET 

◆ mln_momentum_decay_field

enum mln_momentum_decay_field : uint32_t

The fields that mln_momentum_decay sets.

Enumerator
MLN_MOMENTUM_DECAY_MODEL 
MLN_MOMENTUM_DECAY_HALF_LIFE_MS 
MLN_MOMENTUM_DECAY_STOP_SPEED 
MLN_MOMENTUM_DECAY_DISTANCE 
MLN_MOMENTUM_DECAY_DURATION_MS 
MLN_MOMENTUM_DECAY_EASING 
MLN_MOMENTUM_DECAY_MIN_SPEED 
MLN_MOMENTUM_DECAY_MAX_SPEED 
MLN_MOMENTUM_DECAY_MAX_DISTANCE 

◆ mln_momentum_decay_model

enum mln_momentum_decay_model : uint32_t

How a part of a gesture's momentum slows from its release speed.

Enumerator
MLN_MOMENTUM_DECAY_MODEL_FRICTION 

The speed halves every half_life_ms, until it drops to stop_speed. UIScrollView's normal deceleration is a half-life of 346 ms, and its fast deceleration 69 ms.

MLN_MOMENTUM_DECAY_MODEL_EASE 

The part eases distance over duration_ms, along easing, as a camera animation does. The caller plans the glide, for example from the platform's own fling physics, such as Android's OverScroller.

◆ mln_momentum_snap_field

enum mln_momentum_snap_field : uint32_t

The fields that mln_momentum_snap sets.

Enumerator
MLN_MOMENTUM_SNAP_SPACING 
MLN_MOMENTUM_SNAP_OFFSET 
MLN_MOMENTUM_SNAP_TOLERANCE 
MLN_MOMENTUM_SNAP_DURATION_MS 

◆ mln_north_orientation

enum mln_north_orientation : uint32_t

The screen direction that north points to when the bearing is 0.

Enumerator
MLN_NORTH_ORIENTATION_UP 
MLN_NORTH_ORIENTATION_RIGHT 
MLN_NORTH_ORIENTATION_DOWN 
MLN_NORTH_ORIENTATION_LEFT 

◆ mln_pan_momentum_field

enum mln_pan_momentum_field : uint32_t

The fields that mln_pan_momentum sets.

Enumerator
MLN_PAN_MOMENTUM_VELOCITY 

◆ mln_projection_mode_option_field

The fields that mln_projection_mode_options sets.

Enumerator
MLN_PROJECTION_MODE_OPTION_AXONOMETRIC 
MLN_PROJECTION_MODE_OPTION_X_SKEW 
MLN_PROJECTION_MODE_OPTION_Y_SKEW 

◆ mln_tile_lod_mode

enum mln_tile_lod_mode : uint32_t

How the map picks the level of detail of its tiles.

Enumerator
MLN_TILE_LOD_MODE_DEFAULT 

Uses the most detail at the center of the screen.

MLN_TILE_LOD_MODE_DISTANCE 

Uses the most detail closest to the camera.

◆ mln_viewport_mode

enum mln_viewport_mode : uint32_t

The vertical direction of the image that the map renders.

Enumerator
MLN_VIEWPORT_MODE_DEFAULT 
MLN_VIEWPORT_MODE_FLIPPED_Y 

Renders the image upside down.

Function Documentation

◆ mln_map_begin_command_group()

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

Holds back the map's changes from rendering until mln_map_end_command_group(), so they show in the same frame.

Groups nest, and the changes render when the outermost group ends.

◆ mln_map_dispose()

mln_status mln_map_dispose ( mln_map map,
mln_diagnostic * out_diagnostic )

Releases the map in any state, and finishes in the background.

Use it from destructors and finalizers. Otherwise, use mln_map_release().

◆ mln_map_end_command_group()

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

Ends the group that mln_map_begin_command_group() began.

◆ mln_map_get_feature_state()

mln_status mln_map_get_feature_state ( mln_map map,
const mln_feature_state_selector * selector,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads the state of a feature, as a JSON object.

The object is empty when the feature has no state.

◆ mln_map_get_loaded_style_json()

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

Reads the JSON of the style that the map loaded.

The JSON doesn't include the changes made to the style since it loaded.

◆ mln_map_get_snapshot()

mln_status mln_map_get_snapshot ( mln_map map,
mln_map_snapshot * out_snapshot,
mln_diagnostic * out_diagnostic )

Copies the map's state.

The copy doesn't wait for pending commands. To read the camera after they apply, use mln_map_get_camera().

Returns:

◆ mln_map_get_style_url()

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

Reads the URL of the map's style.

The URL is empty when the style came from mln_map_set_style_json().

◆ mln_map_release()

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

Releases the map.

Detach the map's render session first.

◆ mln_map_remove_feature_state()

mln_status mln_map_remove_feature_state ( mln_map map,
const mln_feature_state_selector * selector,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Removes the feature state that selector selects.

◆ mln_map_request_repaint()

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

Renders a new frame of a continuous map, even when nothing changed.

◆ mln_map_request_still_image()

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

Renders a still image of a static or tile map.

The map's render session draws the image once every resource that the image needs has loaded.

Completes with:

  • MLN_STATUS_CANCELLED when the map is released before the image is done.
  • MLN_STATUS_NATIVE_ERROR when the style or a resource that the image needs fails to load.

◆ mln_map_resize()

mln_status mln_map_resize ( mln_map map,
mln_logical_size logical_size,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Sets the map's size.

A map with a render session takes its size from the session, so resize the session with mln_render_session_resize() instead.

Returns:

  • MLN_STATUS_INVALID_STATE when the map has a render session.

Completes with:

  • MLN_STATUS_INVALID_STATE when a render session attached to the map before the resize applied.

◆ mln_map_set_event_mask()

mln_status mln_map_set_event_mask ( mln_map map,
mln_runtime_event_flags mask,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Selects the events that the map reports.

◆ mln_map_set_feature_state()

mln_status mln_map_set_feature_state ( mln_map map,
const mln_feature_state_selector * selector,
mln_buffer_view state,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Merges state into the state of a feature.

state is a JSON object. Its keys replace the same keys in the feature's state, and the other keys stay.

◆ mln_map_set_style_json()

mln_status mln_map_set_style_json ( mln_map map,
mln_buffer_view json,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Loads the map's style from json.

The command completes once the style has parsed, and the map's style is then loaded, as mln_map_set_style_url() describes. The style's sources, sprites, and glyphs load in the background.

Completes with:

  • MLN_STATUS_NATIVE_ERROR when json isn't a valid style. The map keeps its current style.

◆ mln_map_set_style_url()

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

Loads the map's style from url.

The command completes once the style document has loaded and parsed. The style's sources, sprites, and glyphs then load in the background.

The map's style is loaded from the time a style document parses until the next call to this function. While the style isn't loaded, the commands that change it complete with MLN_STATUS_INVALID_STATE. To change a new map's style without a style document, first load an empty style, such as {"version":8,"sources":{},"layers":[]}.

Completes with:

  • MLN_STATUS_NATIVE_ERROR when the style document fails to load or isn't a valid style.
  • MLN_STATUS_CANCELLED when the map is released, or this function or mln_map_set_style_json() loads another style, before the style document parses.

◆ mln_runtime_create_map()

mln_status mln_runtime_create_map ( mln_runtime runtime,
const mln_map_options * options,
mln_map * out_map,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Creates a map on runtime.

Asynchronous calls on the map before the completion runs wait for it, and complete with MLN_STATUS_INVALID_STATE when creation fails.

Lifetimes: out_map receives the handle before the call returns, while the map is still being built.

◆ mln_runtime_create_offline_region()

mln_status mln_runtime_create_offline_region ( mln_runtime runtime,
const mln_offline_region_definition * definition,
const uint8_t * metadata,
size_t metadata_size,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Creates an offline region in the runtime's cache file.

metadata holds any bytes to store with the region, such as its name. The region doesn't download until mln_runtime_set_offline_region_download_state() makes its download active.

◆ mln_runtime_delete_offline_region()

mln_status mln_runtime_delete_offline_region ( mln_runtime runtime,
mln_offline_region_id region_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Deletes the offline region region_id from the runtime's cache file.

Completes with:

  • MLN_STATUS_NOT_FOUND when the cache file has no region region_id.

◆ mln_runtime_get_offline_region()

mln_status mln_runtime_get_offline_region ( mln_runtime runtime,
mln_offline_region_id region_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads the offline region region_id.

The result is null when the cache file has no region with that ID.

◆ mln_runtime_get_offline_region_status()

mln_status mln_runtime_get_offline_region_status ( mln_runtime runtime,
mln_offline_region_id region_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Reads the download progress of the offline region region_id.

While the download is active, the counts cover what it has visited. Once it's inactive, they cover every resource the region holds, including those that only earlier versions of its style listed, so the completed counts can exceed the required counts.

Completes with:

  • MLN_STATUS_NOT_FOUND when the cache file has no region region_id.

◆ mln_runtime_invalidate_offline_region()

mln_status mln_runtime_invalidate_offline_region ( mln_runtime runtime,
mln_offline_region_id region_id,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Makes maps check each resource of the offline region region_id with the server before they use it.

The region keeps its resources. Starting its download again fetches the invalidated resources for offline use. If the style or a TileJSON document is then missing or invalid, the download reports an offline region response error and goes on from the stored copy. Resources that the current style no longer lists stay in the region until it's deleted.

Completes with:

  • MLN_STATUS_NOT_FOUND when the cache file has no region region_id.

◆ mln_runtime_list_offline_regions()

mln_status mln_runtime_list_offline_regions ( mln_runtime runtime,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Lists the offline regions in the runtime's cache file.

◆ mln_runtime_merge_offline_regions()

mln_status mln_runtime_merge_offline_regions ( mln_runtime runtime,
mln_buffer_view side_database_path,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Copies the offline regions of another cache file into the runtime's cache file.

A region whose definition and metadata match one that the runtime's file already has isn't copied again. The result lists the runtime's copy of each region in the other file.

Returns:

  • MLN_STATUS_INVALID_ARGUMENT when side_database_path isn't a readable database file.

Completes with:

  • MLN_STATUS_NATIVE_ERROR when the merge would exceed the tile limit that MLN_RUNTIME_EVENT_OFFLINE_REGION_TILE_COUNT_LIMIT_EXCEEDED describes.

◆ mln_runtime_set_offline_region_download_state()

mln_status mln_runtime_set_offline_region_download_state ( mln_runtime runtime,
mln_offline_region_id region_id,
mln_offline_region_download_state state,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Starts or pauses the download of the offline region region_id.

Setting the state that the download already has does nothing. A download stops when the runtime closes.

Completes with:

  • MLN_STATUS_NOT_FOUND when the cache file has no region region_id.

◆ mln_runtime_set_offline_region_observed()

mln_status mln_runtime_set_offline_region_observed ( mln_runtime runtime,
mln_offline_region_id region_id,
mln_runtime_event_flags events,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Selects the events that the runtime reports about the download of the offline region region_id.

events holds bits of MLN_RUNTIME_EVENT_FLAG_ALL_RUNTIME_EVENTS and replaces the region's previous selection. MLN_RUNTIME_EVENT_FLAG_NONE stops the region's events.

Completes with:

  • MLN_STATUS_NOT_FOUND when the cache file has no region region_id.

◆ mln_runtime_update_offline_region_metadata()

mln_status mln_runtime_update_offline_region_metadata ( mln_runtime runtime,
mln_offline_region_id region_id,
const uint8_t * metadata,
size_t metadata_size,
const mln_completion * completion,
mln_diagnostic * out_diagnostic )

Replaces the metadata of the offline region region_id.

Completes with:

  • MLN_STATUS_NOT_FOUND when the cache file has no region region_id.