Python
Install
Section titled “Install”Install the binding and one runtime from
PyPI. It needs Python 3.12 or
later. The runtime holds the native library for your
backend:
maplibre-native-ffi-runtime-opengl, -metal, or -vulkan. Importing the
binding fails unless exactly one runtime is installed.
pip install maplibre-native-ffi maplibre-native-ffi-runtime-vulkanTo choose the runtime by platform, give each one an environment marker:
[project]dependencies = [ "maplibre-native-ffi", "maplibre-native-ffi-runtime-metal; sys_platform == 'darwin'", "maplibre-native-ffi-runtime-opengl; sys_platform != 'darwin'",]Windows with MinGW
Section titled “Windows with MinGW”The runtimes above use MSVC on Windows. For MinGW, install
maplibre-native-ffi-runtime-opengl-mingw or
maplibre-native-ffi-runtime-vulkan-mingw instead.
Android
Section titled “Android”Initialize the library once per process, before you create a runtime, with the
calling thread’s JNI environment and an Android Context:
maplibre_native_ffi.api.init_android(jni_env, context)