Skip to content

MapLibre Native FFI

MapLibre Native FFI is a C API for MapLibre Native, an engine that draws vector and raster maps from a MapLibre style document. It exposes MapLibre Native concepts directly across a C ABI and language bindings. Use it for SDKs and custom integrations that need direct control of the map and render session.

The MapLibre Android and iOS SDKs provide a map view that owns a window, a frame loop, and gesture handling. This API provides the map and render session. The host creates the window and graphics context, pumps the runtime, and decides when to draw each frame. A texture render target supports image export and compositing into a host scene.

See the examples in the repository for complete integration examples for each language binding.

MapLibre Native FFI is pre-1.0. The C ABI is unstable while mln_c_version() returns 0, and headers, package coordinates, and behavior change between snapshots.

The C API covers most of the MapLibre Native API surface. Custom layers and shader registry access remain outside the current surface. Hosts that require custom draw calls or shaders must extend the native layer.

Tested in CI Built only

EnvironmentBackendsBindingsExamples
Linux x64Vulkan OpenGL C# Dart Go Kotlin/JVM Kotlin/Native Python Rust Swift Zig c-map compose-map go-map lwjgl-map rust-map zig-map zig-readback
Linux arm64Vulkan OpenGL C# Dart Go Kotlin/JVM Python Rust Swift Zig c-map compose-map go-map lwjgl-map rust-map zig-map zig-readback
macOS arm64Vulkan OpenGL Metal C# Dart Go Kotlin/JVM Kotlin/Native Python Rust Swift Zig compose-map lwjgl-map rust-map swift-map zig-map zig-readback
Windows x64Vulkan OpenGL C# Dart Kotlin/JVM Python Rust Zig compose-map lwjgl-map rust-map zig-map zig-readback
Windows arm64Vulkan OpenGL C# Dart Kotlin/JVM Python Rust compose-map lwjgl-map rust-map
Emscripten wasm32OpenGL WebGPU Rust -
Android arm64Vulkan OpenGL Dart Go Kotlin/Android Rust Zig android-map
Android x64Vulkan OpenGL Dart Go Kotlin/JVM Python Rust Zig android-map
iOS device arm64Metal Dart Kotlin/Native Swift Zig swift-map
iOS Simulator arm64Metal Dart Kotlin/Native Swift Zig swift-map
tvOS device arm64Metal Kotlin/Native Swift Zig -
tvOS Simulator arm64Metal Kotlin/Native Swift Zig -
OpenHarmony arm64Vulkan OpenGL Go Rust -
OpenHarmony x64Vulkan OpenGL Go Rust -

OpenGL uses WGL on Windows and EGL on other platforms. macOS EGL uses ANGLE.