Skip to main content

Crate mbgl_sys

Crate mbgl_sys 

Source
Expand description

Low-level FFI bindings to MapLibre GL Native

This crate provides unsafe Rust bindings to the MapLibre GL Native C API. It is intended to be used by higher-level safe wrappers.

§Safety

All functions in this crate are unsafe and require careful handling of:

  • Pointer validity
  • Memory ownership
  • Thread safety

Users should prefer the safe maplibre-native wrapper crate instead.

Modules§

resource_kind
Resource kind constants

Structs§

MLNCameraOptions
Camera options for rendering
MLNHeadlessFrontend
Opaque type for MLNHeadlessFrontend
MLNImageData
Rendered image data
MLNMap
Opaque type for MLNMap
MLNRenderOptions
Render options
MLNResourceRequest
Resource request (for custom file source)
MLNResourceResponse
Resource response
MLNSize
Size structure

Enums§

MLNDebugOptions
Debug options (bitflags)
MLNErrorCode
Error codes returned by the API
MLNMapMode
Map rendering mode

Functions§

mln_cleanup
Cleanup the MapLibre Native library.
mln_get_last_error
Get the last error message.
mln_headless_frontend_create
Create a new headless frontend for rendering.
mln_headless_frontend_destroy
Destroy a headless frontend.
mln_headless_frontend_get_size
Get the size of the headless frontend.
mln_headless_frontend_set_size
Set the size of the headless frontend.
mln_image_free
Free image data returned by mln_map_render_still.
mln_init
Initialize the MapLibre Native library.
mln_map_add_image
Add a custom image to the map’s style.
mln_map_create
Create a new map instance.
mln_map_create_with_loader
Create a new map instance with custom resource loader.
mln_map_destroy
Destroy a map instance.
mln_map_get_camera
Get current camera options.
mln_map_is_fully_loaded
Check if the style is fully loaded.
mln_map_load_style
Load a style JSON into the map.
mln_map_load_style_url
Load a style from a URL.
mln_map_remove_image
Remove an image from the map’s style.
mln_map_render_still
Render a still image synchronously.
mln_map_render_still_async
Render a still image asynchronously.
mln_map_set_camera
Set camera options.
mln_map_set_debug
Set debug options.
mln_map_set_size
Set map size.
mln_set_api_key
Set the API key for MapTiler/Mapbox style URLs.
mln_set_base_path
Set the base path for local file resources.

Type Aliases§

MLNRenderCallback
Callback type for async rendering
MLNResourceCallback
Callback type for resource requests