Table of Contents

Namespace MapLibreNative.Maui

Classes

MbglCache

Provides the default path of MapLibre's cache database. The map views and MbglOfflineManager both default to this path, so offline regions downloaded by the manager are served to the map automatically.

MbglFrontend

Wraps mbgl_frontend_t*.

Ownership note: once passed to MbglMap, the map takes ownership of the underlying native pointer and will destroy it via mbgl_map_destroy. Dispose() becomes a no-op after MapLibreNative.Maui.MbglFrontend.TransferOwnership() is called. Do not call Dispose() after Dispose().

MbglLayer

Non-owning handle to a layer inside a loaded style.

MbglMap

Wraps mbgl_map_t*. Dispose on the render thread.

MbglNetwork

Controls MapLibre's process-global network state. When offline, all network requests are suspended and only cached / offline resources are served; switching back online resumes queued requests.

MbglOfflineManager

Manages offline region downloads and the ambient cache. Wraps mbgl_offline_manager_t. Dispose when done; in-flight operations complete safely after disposal.

MbglOfflineRegion

An offline region stored in the cache database.

MbglOfflineRegionStatus

Download status of an offline region.

MbglRunLoop

Wraps mbgl_runloop_t*. Must be created and disposed on the map thread.

MbglSource

Non-owning handle to a source inside a loaded style.

MbglStyle

Provides access to sources and layers. This is a non-owning handle — do not dispose it; it is invalidated when the parent MbglMap is disposed.

NativeMethods

Raw P/Invoke bindings — prefer the typed wrappers in MbglMap etc.

Structs

BoundOptions

Camera bounds returned by GetBounds().

CameraResult

Camera result from a fit-to-points operation.

MbglOfflineError

Error payload for RegionError.

MbglOfflineProgress

Progress payload for RegionProgress.

Enums

GpsFollowZoomMode

How the GPS control chooses the camera zoom when Follow mode engages (via the on-map GPS button, or the first fix that arrives while following). Later fixes never change the zoom, so a manual pinch/scroll zoom sticks until Follow is re-entered.

MapControlCorner

The corner of the map that an on-map overlay control (navigation, GPS or attribution) is anchored to.

MbglDebugOptions

Bitmask of debug visualisation overlays. OR together the flags you want.

MbglLogLevel

Log severity levels emitted by MapLibre Native.

MbglStatus

Return status from every mutating C ABI function. Non-zero means failure; call GetLastError() for a diagnostic message.

Delegates

NativeMethods.LogFn

Log intercept callback. Return non-zero to consume the record (suppress default output).

NativeMethods.MapObserverFn
NativeMethods.OfflineDoneFn

One-shot completion callback for offline operations with no payload.

NativeMethods.OfflineProgressFn

Recurring download-progress callback for an observed region.

NativeMethods.OfflineRegionErrorFn

Recurring download-error callback for an observed region. reason matches mbgl's Response::Error::Reason values (2=NotFound 3=Server 4=Connection 5=RateLimit 6=Other), or 100 when the Mapbox tile count limit was exceeded.

NativeMethods.OfflineRegionsFn

One-shot callback delivering a JSON array of offline regions.

NativeMethods.OfflineStatusFn

One-shot callback delivering a region status JSON object.

NativeMethods.RenderFn