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§
- MLNCamera
Options - Camera options for rendering
- MLNHeadless
Frontend - Opaque type for MLNHeadlessFrontend
- MLNImage
Data - Rendered image data
- MLNMap
- Opaque type for MLNMap
- MLNRender
Options - Render options
- MLNResource
Request - Resource request (for custom file source)
- MLNResource
Response - Resource response
- MLNSize
- Size structure
Enums§
- MLNDebug
Options - Debug options (bitflags)
- MLNError
Code - Error codes returned by the API
- MLNMap
Mode - 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§
- MLNRender
Callback - Callback type for async rendering
- MLNResource
Callback - Callback type for resource requests