|
MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
|
Go to the source code of this file.
Maps, the types that describe their camera and view, and offline regions.
| typedef struct mln_anchored_momentum mln_anchored_momentum |
How a gesture's zoom, bearing, or pitch keeps changing after release.
| typedef enum mln_anchored_momentum_field mln_anchored_momentum_field |
The fields that mln_anchored_momentum sets.
| typedef uint32_t mln_anchored_momentum_fields |
A set of mln_anchored_momentum_field bits.
| typedef enum mln_animation_option_field mln_animation_option_field |
The fields that mln_animation_options sets.
| typedef uint32_t mln_animation_option_fields |
A set of mln_animation_option_field bits.
| typedef struct mln_animation_options mln_animation_options |
How a camera change animates.
| typedef enum mln_bound_option_field mln_bound_option_field |
The fields that mln_bound_options sets.
| typedef uint32_t mln_bound_option_fields |
A set of mln_bound_option_field bits.
| typedef struct mln_bound_options mln_bound_options |
Limits on the camera, for mln_map_set_bounds().
| typedef struct mln_camera mln_camera |
A map's whole camera.
| 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.
| typedef struct mln_camera_delta mln_camera_delta |
A change to the camera from where it is now, for gestures.
| typedef enum mln_camera_delta_field mln_camera_delta_field |
The fields that mln_camera_delta sets.
| typedef uint32_t mln_camera_delta_fields |
A set of mln_camera_delta_field bits.
| typedef enum mln_camera_fit_option_field mln_camera_fit_option_field |
The fields that mln_camera_fit_options sets.
| typedef uint32_t mln_camera_fit_option_fields |
A set of mln_camera_fit_option_field bits.
| typedef struct mln_camera_fit_options mln_camera_fit_options |
Options for finding the camera that fits an area.
| 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.
| typedef enum mln_camera_option_field mln_camera_option_field |
The fields that mln_camera_options sets.
| typedef uint32_t mln_camera_option_fields |
A set of mln_camera_option_field bits.
| typedef struct mln_camera_options mln_camera_options |
A camera, with only the members that fields selects.
| typedef struct mln_camera_query_result mln_camera_query_result |
A map's camera, with the snapshot generation that it matches.
| typedef struct mln_camera_transition_end mln_camera_transition_end |
The end of a camera change.
| 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.
| 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.
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.
| 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.
| typedef enum mln_camera_update_mode mln_camera_update_mode |
How a camera command moves the camera.
| typedef struct mln_camera_velocity mln_camera_velocity |
How fast each part of a camera change moves.
| typedef enum mln_constrain_mode mln_constrain_mode |
How the map keeps the camera within the world or within its bounds.
| typedef struct mln_edge_insets mln_edge_insets |
Distances in logical pixels from each edge of the map.
| 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.
| typedef union mln_feature_id_data mln_feature_id_data |
The string or number of an mln_feature_id.
| typedef enum mln_feature_id_type mln_feature_id_type |
The type of an mln_feature_id.
| typedef struct mln_feature_state_selector mln_feature_state_selector |
The features whose state to set, read, or remove.
The fields that mln_feature_state_selector sets.
| typedef uint32_t mln_feature_state_selector_fields |
A set of mln_feature_state_selector_field bits.
| 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.
| typedef enum mln_free_camera_option_field mln_free_camera_option_field |
The fields that mln_free_camera_options sets.
| typedef uint32_t mln_free_camera_option_fields |
A set of mln_free_camera_option_field bits.
| typedef struct mln_free_camera_options mln_free_camera_options |
The camera's position and orientation in three dimensions.
| 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:
| typedef enum mln_gesture_phase 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.
| typedef struct mln_lat_lng mln_lat_lng |
A geographic coordinate, in degrees.
| typedef struct mln_lat_lng_bounds mln_lat_lng_bounds |
A rectangle of coordinates, from its southwest to its northeast corner.
| typedef struct mln_logical_extent mln_logical_extent |
A size in logical pixels, and the physical pixels in each logical pixel.
| typedef struct mln_logical_size mln_logical_size |
A size in logical pixels, which the map's scale factor turns into pixels.
| typedef enum mln_map_debug_flag mln_map_debug_flag |
A debug overlay that the map draws.
| typedef uint32_t mln_map_debug_flags |
A set of mln_map_debug_flag bits.
| typedef enum mln_map_mode mln_map_mode |
When a map renders.
| typedef enum mln_map_option_field mln_map_option_field |
The fields that mln_map_options sets.
| typedef uint32_t mln_map_option_fields |
A set of mln_map_option_field bits.
| typedef struct mln_map_options mln_map_options |
Options for mln_runtime_create_map().
| typedef struct mln_map_snapshot mln_map_snapshot |
A map's state, as mln_map_get_snapshot() reads it.
| typedef enum mln_map_tile_option_field mln_map_tile_option_field |
The fields that mln_map_tile_options sets.
| typedef uint32_t mln_map_tile_option_fields |
A set of mln_map_tile_option_field bits.
| 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.
| 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.
| typedef struct mln_map_view mln_map_view |
One view of a map: its camera, size, and projection.
| 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.
The fields that mln_map_viewport_options sets.
| typedef uint32_t mln_map_viewport_option_fields |
A set of mln_map_viewport_option_field bits.
| typedef struct mln_map_viewport_options mln_map_viewport_options |
How the map orients and constrains its view.
| 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.
| typedef enum mln_momentum_decay_field mln_momentum_decay_field |
The fields that mln_momentum_decay sets.
| typedef uint32_t mln_momentum_decay_fields |
A set of mln_momentum_decay_field bits.
| typedef enum mln_momentum_decay_model mln_momentum_decay_model |
How a part of a gesture's momentum slows from its release speed.
| 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.
| typedef enum mln_momentum_snap_field mln_momentum_snap_field |
The fields that mln_momentum_snap sets.
| typedef uint32_t mln_momentum_snap_fields |
A set of mln_momentum_snap_field bits.
| typedef enum mln_north_orientation mln_north_orientation |
The screen direction that north points to when the bearing is 0.
| 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.
| typedef struct mln_offline_region_definition mln_offline_region_definition |
The area, zoom range, and style that an offline region covers.
| typedef union mln_offline_region_definition_data mln_offline_region_definition_data |
The rectangle or geometry of an offline region definition.
| typedef struct mln_offline_region_info mln_offline_region_info |
An offline region in the runtime's cache file.
| typedef struct mln_offline_tile_pyramid_region_definition mln_offline_tile_pyramid_region_definition |
An offline region that covers a rectangle of the map.
| typedef struct mln_pan_momentum mln_pan_momentum |
How a gesture's pan keeps moving the map's content after release.
| typedef enum mln_pan_momentum_field mln_pan_momentum_field |
The fields that mln_pan_momentum sets.
| typedef uint32_t mln_pan_momentum_fields |
A set of mln_pan_momentum_field bits.
| typedef struct mln_projected_meters mln_projected_meters |
A point in the Web Mercator projection, in meters.
| 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.
The fields that mln_projection_mode_options sets.
| typedef uint32_t mln_projection_mode_option_fields |
A set of mln_projection_mode_option_field bits.
| typedef struct mln_projection_mode_options mln_projection_mode_options |
Settings that skew the map or draw it without perspective.
| typedef struct mln_quaternion mln_quaternion |
A rotation, as a quaternion.
| typedef struct mln_screen_point mln_screen_point |
A point on the screen, in logical pixels from the map's top-left corner.
| typedef enum mln_tile_lod_mode mln_tile_lod_mode |
How the map picks the level of detail of its tiles.
| 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.
| typedef struct mln_vec3 mln_vec3 |
A vector in three dimensions.
| typedef enum mln_viewport_mode mln_viewport_mode |
The vertical direction of the image that the map renders.
| 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 | |
| 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 | |
| enum mln_bound_option_field : uint32_t |
The fields that mln_bound_options sets.
| 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 | |
| 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 | |
| enum mln_camera_option_field : uint32_t |
The fields that mln_camera_options sets.
| enum mln_camera_transition_outcome : uint32_t |
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. |
| enum mln_camera_update_mode : uint32_t |
| 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(). |
| 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 | |
| enum mln_feature_state_selector_field : uint32_t |
The fields that mln_feature_state_selector sets.
| Enumerator | |
|---|---|
| MLN_FEATURE_STATE_SELECTOR_FEATURE_ID | |
| enum mln_free_camera_option_field : uint32_t |
The fields that mln_free_camera_options sets.
| Enumerator | |
|---|---|
| MLN_FREE_CAMERA_OPTION_POSITION | |
| MLN_FREE_CAMERA_OPTION_ORIENTATION | |
| 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.
| enum mln_map_debug_flag : uint32_t |
| 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. |
| 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 | |
| enum mln_map_tile_option_field : uint32_t |
The fields that mln_map_tile_options sets.
| enum mln_map_viewport_option_field : uint32_t |
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 | |
| enum mln_momentum_decay_field : uint32_t |
The fields that mln_momentum_decay sets.
| enum mln_momentum_decay_model : uint32_t |
How a part of a gesture's momentum slows from its release speed.
| 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 | |
| enum mln_north_orientation : uint32_t |
| enum mln_pan_momentum_field : uint32_t |
The fields that mln_pan_momentum sets.
| Enumerator | |
|---|---|
| MLN_PAN_MOMENTUM_VELOCITY | |
| enum mln_projection_mode_option_field : uint32_t |
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 | |
| enum mln_tile_lod_mode : uint32_t |
| enum mln_viewport_mode : uint32_t |
| 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_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_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_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_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_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_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_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_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_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_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 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:
Completes with:
| 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_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_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 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 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_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_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 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_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 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 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_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:
Completes with:
| 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 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 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: