Skip to content

.NET

Add the binding and one runtime from NuGet. It needs .NET 10 or later. The runtime holds the native library for your backend: Maplibre.NativeFfi.Runtime.OpenGL, .Metal, or .Vulkan.

Terminal window
dotnet add package Maplibre.NativeFfi
dotnet add package Maplibre.NativeFfi.Runtime.Vulkan

The runtimes above use MSVC on Windows. For MinGW, add Maplibre.NativeFfi.Runtime.OpenGL.MinGW or Maplibre.NativeFfi.Runtime.Vulkan.MinGW instead.

Initialize the library once per process, before you create a runtime, with the calling thread’s JNI environment and an Android Context:

MainActivity.cs
MaplibreNative.InitAndroid(
NativePointer.FromBorrowedAddress(jniEnv),
NativePointer.FromBorrowedAddress(context));