Table of Contents

Class MapHandle

Namespace
Maplibre.NativeFfi.Map
Assembly
Maplibre.NativeFfi.dll

Owner-thread map handle bound to a runtime.

public sealed class MapHandle : IDisposable
Inheritance
MapHandle
Implements
Inherited Members

Properties

IsClosed

Whether this wrapper has successfully closed its native handle.

public bool IsClosed { get; }

Property Value

bool

Methods

AddColorReliefLayer(string, string, string)

Adds a color-relief layer for a raster DEM source.

public void AddColorReliefLayer(string layerId, string sourceId, string beforeLayerId)

Parameters

layerId string
sourceId string
beforeLayerId string

AddCustomGeometrySource(string, CustomGeometrySourceOptions)

Adds a custom geometry source with tile callbacks.

public void AddCustomGeometrySource(string sourceId, CustomGeometrySourceOptions options)

Parameters

sourceId string
options CustomGeometrySourceOptions

Remarks

The upcall stubs this installs live until MapLibre stops referencing them: until the source is removed, until a style load leaves a style without it, or until this map closes. The binding releases them from the callback the C API invokes then, so nothing here depends on the events SetEventMask(RuntimeEventMask) selects.

AddGeoJsonSourceData(string, GeoJsonSourceDataHandle)

Adds a GeoJSON source backed by prepared data.

public void AddGeoJsonSourceData(string sourceId, GeoJsonSourceDataHandle data)

Parameters

sourceId string
data GeoJsonSourceDataHandle

Remarks

The call borrows data; the source adopts the options baked into it when the data was prepared and keeps its own reference, so the handle may be released afterward.

AddGeoJsonSourceUrl(string, string, GeoJsonSourceOptions?)

Adds a GeoJSON source that loads data from a URL.

public void AddGeoJsonSourceUrl(string sourceId, string url, GeoJsonSourceOptions? options)

Parameters

sourceId string
url string
options GeoJsonSourceOptions

Remarks

options is fixed when the source is created; SetGeoJsonSourceUrl(string, string) and SetGeoJsonSourceData(string, GeoJsonSourceDataHandle) keep it.

AddHillshadeLayer(string, string, string)

Adds a hillshade layer for a raster DEM source.

public void AddHillshadeLayer(string layerId, string sourceId, string beforeLayerId)

Parameters

layerId string
sourceId string
beforeLayerId string

AddImageSourceImage(string, IReadOnlyList<LatLng>, PremultipliedRgba8Image)

Adds an image source with inline premultiplied RGBA8 image data.

public void AddImageSourceImage(string sourceId, IReadOnlyList<LatLng> coordinates, PremultipliedRgba8Image image)

Parameters

sourceId string
coordinates IReadOnlyList<LatLng>
image PremultipliedRgba8Image

AddImageSourceUrl(string, IReadOnlyList<LatLng>, string)

Adds an image source that loads image data from a URL.

public void AddImageSourceUrl(string sourceId, IReadOnlyList<LatLng> coordinates, string url)

Parameters

sourceId string
coordinates IReadOnlyList<LatLng>
url string

AddLocationIndicatorLayer(string, string)

Adds a source-free location indicator layer.

public void AddLocationIndicatorLayer(string layerId, string beforeLayerId)

Parameters

layerId string
beforeLayerId string

AddRasterDemSourceTiles(string, IReadOnlyList<string>, TileSourceOptions?)

Adds a raster DEM source from inline tile URL templates.

public void AddRasterDemSourceTiles(string sourceId, IReadOnlyList<string> tiles, TileSourceOptions? options)

Parameters

sourceId string
tiles IReadOnlyList<string>
options TileSourceOptions

AddRasterDemSourceUrl(string, string, TileSourceOptions?)

Adds a raster DEM source that loads TileJSON from a URL.

public void AddRasterDemSourceUrl(string sourceId, string url, TileSourceOptions? options)

Parameters

sourceId string
url string
options TileSourceOptions

AddRasterSourceTiles(string, IReadOnlyList<string>, TileSourceOptions?)

Adds a raster source from inline tile URL templates.

public void AddRasterSourceTiles(string sourceId, IReadOnlyList<string> tiles, TileSourceOptions? options)

Parameters

sourceId string
tiles IReadOnlyList<string>
options TileSourceOptions

AddRasterSourceUrl(string, string, TileSourceOptions?)

Adds a raster source that loads TileJSON from a URL.

public void AddRasterSourceUrl(string sourceId, string url, TileSourceOptions? options)

Parameters

sourceId string
url string
options TileSourceOptions

AddStyleLayerJson(byte[], string)

Adds a style layer from UTF-8 JSON bytes.

public void AddStyleLayerJson(byte[] layerJson, string beforeLayerId)

Parameters

layerJson byte[]
beforeLayerId string

AddStyleSourceJson(string, byte[])

Adds a style source from UTF-8 JSON bytes.

public void AddStyleSourceJson(string sourceId, byte[] sourceJson)

Parameters

sourceId string
sourceJson byte[]

AddVectorSourceTiles(string, IReadOnlyList<string>, TileSourceOptions?)

Adds a vector source from inline tile URL templates.

public void AddVectorSourceTiles(string sourceId, IReadOnlyList<string> tiles, TileSourceOptions? options)

Parameters

sourceId string
tiles IReadOnlyList<string>
options TileSourceOptions

AddVectorSourceUrl(string, string, TileSourceOptions?)

Adds a vector source that loads TileJSON from a URL.

public void AddVectorSourceUrl(string sourceId, string url, TileSourceOptions? options)

Parameters

sourceId string
url string
options TileSourceOptions

CameraForGeometry(byte[], CameraFitOptions?)

Calculates a camera that fits geographic geometry and fit options.

public CameraOptions CameraForGeometry(byte[] geometry, CameraFitOptions? fitOptions)

Parameters

geometry byte[]
fitOptions CameraFitOptions

Returns

CameraOptions

CameraForLatLngBounds(LatLngBounds, CameraFitOptions?)

Calculates a camera that fits geographic bounds and fit options.

public CameraOptions CameraForLatLngBounds(LatLngBounds bounds, CameraFitOptions? fitOptions)

Parameters

bounds LatLngBounds
fitOptions CameraFitOptions

Returns

CameraOptions

CameraForLatLngs(IReadOnlyList<LatLng>, CameraFitOptions?)

Calculates a camera that fits geographic coordinates and fit options.

public CameraOptions CameraForLatLngs(IReadOnlyList<LatLng> coordinates, CameraFitOptions? fitOptions)

Parameters

coordinates IReadOnlyList<LatLng>
fitOptions CameraFitOptions

Returns

CameraOptions

CancelTransitions()

Cancels in-flight camera transitions.

public void CancelTransitions()

Close()

Destroys the map on its owner thread.

public void Close()

Remarks

Closing discards this map's queued runtime events and its recorded loading failure without a flush and without a terminal event.

CopyStyleImagePremultipliedRgba8(string)

Copies a style image as premultiplied RGBA8 pixels when it exists.

public StyleImage? CopyStyleImagePremultipliedRgba8(string imageId)

Parameters

imageId string

Returns

StyleImage

Create(RuntimeHandle, MapOptions)

Creates a map from a runtime on the runtime owner thread.

public static MapHandle Create(RuntimeHandle runtime, MapOptions options)

Parameters

runtime RuntimeHandle
options MapOptions

Returns

MapHandle

CreateProjection()

Creates a standalone projection snapshot from the map's current camera state.

public MapProjectionHandle CreateProjection()

Returns

MapProjectionHandle

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

DumpDebugLogs()

Asks the native map to write debug logs through the native log system.

public void DumpDebugLogs()

EaseTo(CameraOptions, AnimationOptions?)

Eases to the camera descriptor with animation options.

public void EaseTo(CameraOptions camera, AnimationOptions? animation)

Parameters

camera CameraOptions
animation AnimationOptions

Remarks

A null animation, or one with no Duration, uses a duration of zero. Set Duration to animate.

FlyTo(CameraOptions, AnimationOptions?)

Flies to the camera descriptor with animation options.

public void FlyTo(CameraOptions camera, AnimationOptions? animation)

Parameters

camera CameraOptions
animation AnimationOptions

Remarks

Unlike the other camera commands, a null animation, or one with no Duration, derives a duration from the distance travelled at 1.2 rho-screenfuls per second.

GetBounds()

Gets map bounds constraints.

public BoundOptions GetBounds()

Returns

BoundOptions

GetCamera()

Gets the current camera descriptor.

public CameraOptions GetCamera()

Returns

CameraOptions

GetDebugOptions()

Gets native debug drawing options.

public DebugOptions GetDebugOptions()

Returns

DebugOptions

GetEventMask()

Reports which map-originated event types this map queues.

public RuntimeEventMask GetEventMask()

Returns

RuntimeEventMask

Remarks

The value is the mask last set, including bits outside AllMapEvents that this map ignores. A map created with the default EventMask reports every event type this library selects by default, including any this binding does not declare.

GetFreeCameraOptions()

Gets free-camera options.

public FreeCameraOptions GetFreeCameraOptions()

Returns

FreeCameraOptions

GetImageSourceCoordinates(string)

Gets image source coordinates when the source exists.

public LatLng[]? GetImageSourceCoordinates(string sourceId)

Parameters

sourceId string

Returns

LatLng[]

GetLayerFilter(string)

Gets one layer filter snapshot, or null when no filter exists.

public byte[]? GetLayerFilter(string layerId)

Parameters

layerId string

Returns

byte[]

GetLayerMaxZoom(string)

Gets the highest zoom at which one layer draws.

public double GetLayerMaxZoom(string layerId)

Parameters

layerId string

Returns

double

Remarks

A layer with no upper bound reports double.PositiveInfinity.

GetLayerMinZoom(string)

Gets the lowest zoom at which one layer draws.

public double GetLayerMinZoom(string layerId)

Parameters

layerId string

Returns

double

Remarks

A layer with no lower bound reports double.NegativeInfinity.

GetLayerProperty(string, string)

Gets one layer property snapshot, or null when undefined.

public byte[]? GetLayerProperty(string layerId, string propertyName)

Parameters

layerId string
propertyName string

Returns

byte[]

GetLayerSourceId(string)

Gets one layer's source ID, empty when it carries none.

public string GetLayerSourceId(string layerId)

Parameters

layerId string

Returns

string

GetLayerSourceLayer(string)

Gets one layer's source-layer ID, empty when it carries none.

public string GetLayerSourceLayer(string layerId)

Parameters

layerId string

Returns

string

GetLayerVisibility(string)

Gets whether one layer draws.

public StyleLayerVisibility GetLayerVisibility(string layerId)

Parameters

layerId string

Returns

StyleLayerVisibility

GetLoadedStyleJson()

Gets the style document this map's style was last parsed from.

public byte[] GetLoadedStyleJson()

Returns

byte[]

Remarks

This is the loaded document, not a serialization of the live style: runtime mutations do not change it, and a failed parse leaves the previously parsed document in place. The result is empty when no document has been parsed.

GetProjectionMode()

Gets projection mode options.

public ProjectionModeOptions GetProjectionMode()

Returns

ProjectionModeOptions

GetRenderingStatsViewEnabled()

Whether the built-in rendering statistics overlay is enabled.

public bool GetRenderingStatsViewEnabled()

Returns

bool

GetSize()

Gets the map's logical viewport size in UI pixels and its pixel ratio. The scale factor is fixed for the lifetime of the map and is independent of any render target's scale factor.

public (uint Width, uint Height, double ScaleFactor) GetSize()

Returns

(uint Width, uint Height, double ScaleFactor)

GetStyleLayerJson(string)

Gets a full style-spec layer JSON snapshot when the layer exists.

public byte[]? GetStyleLayerJson(string layerId)

Parameters

layerId string

Returns

byte[]

GetStyleLightProperty(string)

Gets one style light property snapshot, or null when undefined.

public byte[]? GetStyleLightProperty(string propertyName)

Parameters

propertyName string

Returns

byte[]

GetStyleTransitionOptions()

Gets the style's global transition options.

public StyleTransitionOptions GetStyleTransitionOptions()

Returns

StyleTransitionOptions

GetStyleUrl()

Gets the URL this map's style was last requested from.

public string GetStyleUrl()

Returns

string

Remarks

SetStyleUrl(string) records the URL when the request is made, before the response arrives, and SetStyleJson(byte[]) clears it, so this can disagree with GetLoadedStyleJson(). The result is empty for inline JSON, for a map with no style, and for an empty URL alike.

GetTileOptions()

Gets tile tuning options.

public TileOptions GetTileOptions()

Returns

TileOptions

GetViewportOptions()

Gets the map's viewport options.

public ViewportOptions GetViewportOptions()

Returns

ViewportOptions

InvalidateCustomGeometrySourceRegion(string, LatLngBounds)

Invalidates custom geometry source tiles that intersect bounds.

public void InvalidateCustomGeometrySourceRegion(string sourceId, LatLngBounds bounds)

Parameters

sourceId string
bounds LatLngBounds

InvalidateCustomGeometrySourceTile(string, CanonicalTileId)

Invalidates one custom geometry source tile.

public void InvalidateCustomGeometrySourceTile(string sourceId, CanonicalTileId tileId)

Parameters

sourceId string
tileId CanonicalTileId

IsFullyLoaded()

Whether the native map reports all required resources loaded.

public bool IsFullyLoaded()

Returns

bool

IsGestureInProgress()

Whether a host-driven gesture is currently in progress.

public bool IsGestureInProgress()

Returns

bool

JumpTo(CameraOptions)

Moves immediately to the camera descriptor, applying only non-null fields.

public void JumpTo(CameraOptions camera)

Parameters

camera CameraOptions

LatLngBoundsForCamera(CameraOptions)

Computes geographic bounds for a camera from two viewport corners.

public LatLngBounds LatLngBoundsForCamera(CameraOptions camera)

Parameters

camera CameraOptions

Returns

LatLngBounds

Remarks

The box is the hull of the top-left and bottom-right screen corners for that camera in the current viewport. When bearing and pitch are zero, the box equals the visible area. Those corners are the northwest and southeast of the viewport. Longitudes stay in -180 to 180.

LatLngBoundsForCameraUnwrapped(CameraOptions)

Computes geographic bounds for a camera from the four viewport corners.

public LatLngBounds LatLngBoundsForCameraUnwrapped(CameraOptions camera)

Parameters

camera CameraOptions

Returns

LatLngBounds

Remarks

The axis-aligned hull of all four screen corners and the center encompasses the projected viewport. Longitudes unwrap onto the shortest path through the center. A viewport that crosses the antimeridian reports values outside -180 to 180.

LatLngForPixel(ScreenPoint)

Converts a screen pixel to a geographic coordinate using the current map projection.

public LatLng LatLngForPixel(ScreenPoint point)

Parameters

point ScreenPoint

Returns

LatLng

LatLngsForPixels(IReadOnlyList<ScreenPoint>)

Converts screen pixels to geographic coordinates using the current map projection.

public LatLng[] LatLngsForPixels(IReadOnlyList<ScreenPoint> points)

Parameters

points IReadOnlyList<ScreenPoint>

Returns

LatLng[]

MoveBy(double, double)

Moves the map by a screen delta.

public void MoveBy(double deltaX, double deltaY)

Parameters

deltaX double
deltaY double

MoveByAnimated(double, double, AnimationOptions?)

Moves the map by a screen delta with animation options.

public void MoveByAnimated(double deltaX, double deltaY, AnimationOptions? animation)

Parameters

deltaX double
deltaY double
animation AnimationOptions

Remarks

A null animation, or one with no Duration, applies the change instantly; see EaseTo(CameraOptions, AnimationOptions?).

MoveStyleLayer(string, string)

Moves a style layer before another layer, or to the top when beforeLayerId is empty.

public void MoveStyleLayer(string layerId, string beforeLayerId)

Parameters

layerId string
beforeLayerId string

PitchBy(double)

Pitches the map by a delta in degrees.

public void PitchBy(double pitch)

Parameters

pitch double

PitchByAnimated(double, AnimationOptions?)

Pitches the map by a delta in degrees with animation options.

public void PitchByAnimated(double pitch, AnimationOptions? animation)

Parameters

pitch double
animation AnimationOptions

Remarks

A null animation, or one with no Duration, applies the change instantly; see EaseTo(CameraOptions, AnimationOptions?).

PixelForLatLng(LatLng)

Converts a geographic coordinate to a screen pixel using the current map projection.

public ScreenPoint PixelForLatLng(LatLng coordinate)

Parameters

coordinate LatLng

Returns

ScreenPoint

PixelsForLatLngs(IReadOnlyList<LatLng>)

Converts geographic coordinates to screen pixels using the current map projection.

public ScreenPoint[] PixelsForLatLngs(IReadOnlyList<LatLng> coordinates)

Parameters

coordinates IReadOnlyList<LatLng>

Returns

ScreenPoint[]

RemoveStyleImage(string)

Removes a style image and reports whether it existed.

public bool RemoveStyleImage(string imageId)

Parameters

imageId string

Returns

bool

RemoveStyleLayer(string)

Removes a style layer and reports whether it existed.

public bool RemoveStyleLayer(string layerId)

Parameters

layerId string

Returns

bool

RemoveStyleSource(string)

Removes a style source and reports whether it existed.

public bool RemoveStyleSource(string sourceId)

Parameters

sourceId string

Returns

bool

RequestRepaint()

Requests a repaint for a continuous map.

public void RequestRepaint()

RequestStillImage()

Requests an asynchronous still-image render for a static map.

public void RequestStillImage()

RotateBy(ScreenPoint, ScreenPoint)

Rotates around two screen points.

public void RotateBy(ScreenPoint first, ScreenPoint second)

Parameters

first ScreenPoint
second ScreenPoint

RotateByAnimated(ScreenPoint, ScreenPoint, AnimationOptions?)

Rotates around two screen points with animation options.

public void RotateByAnimated(ScreenPoint first, ScreenPoint second, AnimationOptions? animation)

Parameters

first ScreenPoint
second ScreenPoint
animation AnimationOptions

Remarks

A null animation, or one with no Duration, applies the change instantly; see EaseTo(CameraOptions, AnimationOptions?).

ScaleBy(double, ScreenPoint?)

Scales the map around a screen anchor.

public void ScaleBy(double scale, ScreenPoint? anchor)

Parameters

scale double
anchor ScreenPoint?

ScaleByAnimated(double, ScreenPoint?, AnimationOptions?)

Scales the map around a screen anchor with animation options.

public void ScaleByAnimated(double scale, ScreenPoint? anchor, AnimationOptions? animation)

Parameters

scale double
anchor ScreenPoint?
animation AnimationOptions

Remarks

A null animation, or one with no Duration, applies the change instantly; see EaseTo(CameraOptions, AnimationOptions?).

SetBounds(BoundOptions)

Sets map bounds constraints, applying only non-null descriptor fields.

public void SetBounds(BoundOptions options)

Parameters

options BoundOptions

SetCustomGeometrySourceTileData(string, CanonicalTileId, byte[])

Sets custom geometry source tile data.

public void SetCustomGeometrySourceTileData(string sourceId, CanonicalTileId tileId, byte[] data)

Parameters

sourceId string
tileId CanonicalTileId
data byte[]

SetDebugOptions(DebugOptions)

Sets native debug drawing options.

public void SetDebugOptions(DebugOptions options)

Parameters

options DebugOptions

SetEventMask(RuntimeEventMask)

Selects which map-originated event types this map queues.

public void SetEventMask(RuntimeEventMask mask)

Parameters

mask RuntimeEventMask

Remarks

The mask reads the bits in AllMapEvents and ignores the rest, so All selects every map-originated type. An event type this mask clears is never queued, so it neither reaches a batch nor wakes a parked Pump(TimeSpan, TimeSpan?). Select every event type the host reads, because MapRenderUpdateAvailable, the two still-image types, and MapCameraTransitionFinished carry state a host reaches no other way. Narrowing gates later events and keeps queued ones, so a host drains what it already caused.

SetFreeCameraOptions(FreeCameraOptions)

Sets free-camera options, applying only non-null descriptor fields.

public void SetFreeCameraOptions(FreeCameraOptions options)

Parameters

options FreeCameraOptions

SetGeoJsonSourceData(string, GeoJsonSourceDataHandle)

Updates a GeoJSON source with prepared data.

public void SetGeoJsonSourceData(string sourceId, GeoJsonSourceDataHandle data)

Parameters

sourceId string
data GeoJsonSourceDataHandle

Remarks

The call borrows data and fails when the options baked into it differ from the source's, except for cluster properties.

SetGeoJsonSourceSynchronousTiling(string, bool)

Overrides synchronous tiling for a GeoJSON source.

public void SetGeoJsonSourceSynchronousTiling(string sourceId, bool enabled)

Parameters

sourceId string
enabled bool

Remarks

The effective behavior is the source's baked-in option OR this override.

SetGeoJsonSourceUrl(string, string)

Updates a GeoJSON source to load data from a URL.

public void SetGeoJsonSourceUrl(string sourceId, string url)

Parameters

sourceId string
url string

SetGestureInProgress(bool)

Marks whether a host-driven gesture is in progress.

public void SetGestureInProgress(bool inProgress)

Parameters

inProgress bool

Remarks

The flag stays set until the host clears it: pair every true with a false.

SetImageSourceCoordinates(string, IReadOnlyList<LatLng>)

Updates image source coordinates.

public void SetImageSourceCoordinates(string sourceId, IReadOnlyList<LatLng> coordinates)

Parameters

sourceId string
coordinates IReadOnlyList<LatLng>

SetImageSourceImage(string, PremultipliedRgba8Image)

Updates an image source with inline premultiplied RGBA8 image data.

public void SetImageSourceImage(string sourceId, PremultipliedRgba8Image image)

Parameters

sourceId string
image PremultipliedRgba8Image

SetImageSourceUrl(string, string)

Updates an image source to load image data from a URL.

public void SetImageSourceUrl(string sourceId, string url)

Parameters

sourceId string
url string

SetLayerFilter(string, byte[]?)

Sets or clears one layer filter from UTF-8 JSON bytes.

public void SetLayerFilter(string layerId, byte[]? filter)

Parameters

layerId string
filter byte[]

SetLayerMaxZoom(string, double)

Sets the highest zoom at which one layer draws.

public void SetLayerMaxZoom(string layerId, double maxZoom)

Parameters

layerId string
maxZoom double

Remarks

Pass double.PositiveInfinity for no upper bound.

SetLayerMinZoom(string, double)

Sets the lowest zoom at which one layer draws.

public void SetLayerMinZoom(string layerId, double minZoom)

Parameters

layerId string
minZoom double

Remarks

Pass double.NegativeInfinity for no lower bound.

SetLayerProperty(string, string, byte[])

Sets one layer property from UTF-8 JSON bytes.

public void SetLayerProperty(string layerId, string propertyName, byte[] value)

Parameters

layerId string
propertyName string
value byte[]

SetLayerSourceId(string, string)

Sets one layer's source ID.

public void SetLayerSourceId(string layerId, string sourceId)

Parameters

layerId string
sourceId string

Remarks

Layer types that take no source, such as background, are rejected. The named source need not exist yet.

SetLayerSourceLayer(string, string)

Sets one layer's source-layer ID.

public void SetLayerSourceLayer(string layerId, string sourceLayer)

Parameters

layerId string
sourceLayer string

Remarks

Layer types that take no source, such as background, are rejected.

SetLayerVisibility(string, StyleLayerVisibility)

Sets whether one layer draws.

public void SetLayerVisibility(string layerId, StyleLayerVisibility visibility)

Parameters

layerId string
visibility StyleLayerVisibility

SetLocationIndicatorAccuracyRadius(string, double)

Sets a location indicator layer accuracy radius in logical pixels.

public void SetLocationIndicatorAccuracyRadius(string layerId, double radius)

Parameters

layerId string
radius double

SetLocationIndicatorBearing(string, double)

Sets a location indicator layer bearing in degrees.

public void SetLocationIndicatorBearing(string layerId, double bearing)

Parameters

layerId string
bearing double

SetLocationIndicatorImageName(string, LocationIndicatorImageKind, string)

Sets a location indicator layer image-name property.

public void SetLocationIndicatorImageName(string layerId, LocationIndicatorImageKind imageKind, string imageId)

Parameters

layerId string
imageKind LocationIndicatorImageKind
imageId string

SetLocationIndicatorLocation(string, LatLng, double)

Sets a location indicator layer location.

public void SetLocationIndicatorLocation(string layerId, LatLng coordinate, double altitude)

Parameters

layerId string
coordinate LatLng
altitude double

SetProjectionMode(ProjectionModeOptions)

Sets projection mode options, applying only non-null descriptor fields.

public void SetProjectionMode(ProjectionModeOptions mode)

Parameters

mode ProjectionModeOptions

SetRenderingStatsViewEnabled(bool)

Shows or hides the built-in rendering statistics overlay.

public void SetRenderingStatsViewEnabled(bool enabled)

Parameters

enabled bool

SetStyleImage(string, PremultipliedRgba8Image, StyleImageOptions?)

Sets or replaces a style image.

public void SetStyleImage(string imageId, PremultipliedRgba8Image image, StyleImageOptions? options)

Parameters

imageId string
image PremultipliedRgba8Image
options StyleImageOptions

SetStyleJson(byte[])

Loads inline style JSON through MapLibre Native style APIs.

public void SetStyleJson(byte[] json)

Parameters

json byte[]

Remarks

Malformed JSON is reported twice: this call throws the parse error, and the same message also arrives as a MapLoadingFailed runtime event. A style MapLibre rejects semantically produces neither an exception nor an event.

SetStyleLightJson(byte[])

Sets the style light document from UTF-8 JSON bytes.

public void SetStyleLightJson(byte[] lightJson)

Parameters

lightJson byte[]

SetStyleLightProperty(string, byte[])

Sets one style light property from UTF-8 JSON bytes.

public void SetStyleLightProperty(string propertyName, byte[] value)

Parameters

propertyName string
value byte[]

SetStyleTransitionOptions(StyleTransitionOptions)

Sets the style's global transition options.

public void SetStyleTransitionOptions(StyleTransitionOptions options)

Parameters

options StyleTransitionOptions

Remarks

This replaces the whole transition configuration rather than merging into it, and null duration and delay clear the style-wide override. Loading a style replaces these options, so apply an override after the style loads.

SetStyleUrl(string)

Loads a style URL through MapLibre Native style APIs.

public void SetStyleUrl(string url)

Parameters

url string

Remarks

Loading is asynchronous: a style that is missing, unreachable, or malformed returns normally here and reports through a MapLoadingFailed runtime event. A style MapLibre rejects semantically produces neither an exception nor an event.

SetTileOptions(TileOptions)

Sets tile tuning options, applying only non-null descriptor fields.

public void SetTileOptions(TileOptions options)

Parameters

options TileOptions

SetViewportOptions(ViewportOptions)

Sets viewport options, applying only non-null descriptor fields.

public void SetViewportOptions(ViewportOptions options)

Parameters

options ViewportOptions

StyleImageExists(string)

Whether a style image exists.

public bool StyleImageExists(string imageId)

Parameters

imageId string

Returns

bool

StyleImageInfo(string)

Gets style image metadata when the image exists.

public StyleImageInfo? StyleImageInfo(string imageId)

Parameters

imageId string

Returns

StyleImageInfo

StyleImageStretches(string)

Copies a style image's stretchable intervals when it exists.

public (IReadOnlyList<ImageStretch> StretchX, IReadOnlyList<ImageStretch> StretchY)? StyleImageStretches(string imageId)

Parameters

imageId string

Returns

(IReadOnlyList<ImageStretch> StretchX, IReadOnlyList<ImageStretch> StretchY)?

StyleLayerExists(string)

Whether a style layer exists.

public bool StyleLayerExists(string layerId)

Parameters

layerId string

Returns

bool

StyleLayerIds()

Lists style layer IDs in style order.

public string[] StyleLayerIds()

Returns

string[]

StyleLayerType(string)

Gets a style layer type when the layer exists.

public string? StyleLayerType(string layerId)

Parameters

layerId string

Returns

string

StyleSourceExists(string)

Whether a style source exists.

public bool StyleSourceExists(string sourceId)

Parameters

sourceId string

Returns

bool

StyleSourceIds()

Lists style source IDs in style order.

public string[] StyleSourceIds()

Returns

string[]

StyleSourceInfo(string)

Gets copied style source metadata when the source exists.

public SourceInfo? StyleSourceInfo(string sourceId)

Parameters

sourceId string

Returns

SourceInfo

StyleSourceType(string)

Gets a style source type when the source exists.

public SourceType? StyleSourceType(string sourceId)

Parameters

sourceId string

Returns

SourceType?