Table of Contents

Interface IMapLibreMapController

public interface IMapLibreMapController : IMapLibreMapOptionsSink
Inherited Members

Properties

FollowLocation

When true, each GPS fix also re-centres the map.

bool FollowLocation { get; set; }

Property Value

bool

ShowBearing

When false the bearing arrow is suppressed — indicator always points north.

bool ShowBearing { get; set; }

Property Value

bool

Methods

AddCircleLayer(string, string, string?, string?, IDictionary<string, object?>, float, float, bool)

void AddCircleLayer(string layerName, string sourceName, string? belowLayerId, string? sourceLayer, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, bool enableInteraction = false)

Parameters

layerName string
sourceName string
belowLayerId string
sourceLayer string
properties IDictionary<string, object>
minZoom float
maxZoom float
enableInteraction bool

AddFillExtrusionLayer(string, string, string?, string?, IDictionary<string, object?>, float, float, bool)

void AddFillExtrusionLayer(string layerName, string sourceName, string? belowLayerId, string? sourceLayer, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, bool enableInteraction = false)

Parameters

layerName string
sourceName string
belowLayerId string
sourceLayer string
properties IDictionary<string, object>
minZoom float
maxZoom float
enableInteraction bool

AddFillLayer(string, string, string?, string?, IDictionary<string, object?>, float, float, bool)

void AddFillLayer(string layerName, string sourceName, string? belowLayerId, string? sourceLayer, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, bool enableInteraction = false)

Parameters

layerName string
sourceName string
belowLayerId string
sourceLayer string
properties IDictionary<string, object>
minZoom float
maxZoom float
enableInteraction bool

AddGeoJsonSource(string, string)

void AddGeoJsonSource(string sourceName, string source)

Parameters

sourceName string
source string

AddGeoJsonSource(string, string, string?)

Add a GeoJSON source with style-spec options (clustering etc.). optionsJson is a JSON object of GeoJSON source options — the style-spec keys minus type/data, e.g. {"cluster":true,"clusterRadius":50,"clusterMaxZoom":14}.

void AddGeoJsonSource(string sourceName, string source, string? optionsJson)

Parameters

sourceName string
source string
optionsJson string

AddHeatmapLayer(string, string, IDictionary<string, object?>, float, float, string?)

void AddHeatmapLayer(string layerName, string sourceName, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, string? belowLayerId = null)

Parameters

layerName string
sourceName string
properties IDictionary<string, object>
minZoom float
maxZoom float
belowLayerId string

AddHillshadeLayer(string, string, IDictionary<string, object?>, float, float, string?)

void AddHillshadeLayer(string layerName, string sourceName, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, string? belowLayerId = null)

Parameters

layerName string
sourceName string
properties IDictionary<string, object>
minZoom float
maxZoom float
belowLayerId string

AddImageSource(string, string, LatLngQuad?)

void AddImageSource(string sourceName, string url, LatLngQuad? coordinates)

Parameters

sourceName string
url string
coordinates LatLngQuad

AddLineLayer(string, string, string?, string?, IDictionary<string, object?>, float, float, bool)

void AddLineLayer(string layerName, string sourceName, string? belowLayerId, string? sourceLayer, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, bool enableInteraction = false)

Parameters

layerName string
sourceName string
belowLayerId string
sourceLayer string
properties IDictionary<string, object>
minZoom float
maxZoom float
enableInteraction bool

AddRasterDemSource(string, string?, string[]?, int, int, int)

void AddRasterDemSource(string sourceName, string? tileUrl, string[]? tileUrlTemplates, int tileSize, int minZoom, int maxZoom)

Parameters

sourceName string
tileUrl string
tileUrlTemplates string[]
tileSize int
minZoom int
maxZoom int

AddRasterLayer(string, string, IDictionary<string, object?>, float, float, string?)

void AddRasterLayer(string layerName, string sourceName, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, string? belowLayerId = null)

Parameters

layerName string
sourceName string
properties IDictionary<string, object>
minZoom float
maxZoom float
belowLayerId string

AddRasterSource(string, string?, string[]?, int, int, int)

void AddRasterSource(string sourceName, string? tileUrl, string[]? tileUrlTemplates, int tileSize, int minZoom, int maxZoom)

Parameters

sourceName string
tileUrl string
tileUrlTemplates string[]
tileSize int
minZoom int
maxZoom int

AddSpriteImage(string, int, int, byte[], float, bool)

Register a named sprite image for use with icon-image in SymbolLayers. rgba must be width × height × 4 bytes of premultiplied RGBA.

void AddSpriteImage(string imageId, int width, int height, byte[] rgba, float pixelRatio = 1, bool sdf = false)

Parameters

imageId string
width int
height int
rgba byte[]
pixelRatio float
sdf bool

AddSymbolLayer(string, string, string?, string?, IDictionary<string, object?>, float, float, bool)

void AddSymbolLayer(string layerName, string sourceName, string? belowLayerId, string? sourceLayer, IDictionary<string, object?> properties, float minZoom = 0, float maxZoom = 0, bool enableInteraction = false)

Parameters

layerName string
sourceName string
belowLayerId string
sourceLayer string
properties IDictionary<string, object>
minZoom float
maxZoom float
enableInteraction bool

AddVectorSource(string, string?, string[]?, int, int)

void AddVectorSource(string sourceName, string? tileUrl, string[]? tileUrlTemplates, int minZoom, int maxZoom)

Parameters

sourceName string
tileUrl string
tileUrlTemplates string[]
minZoom int
maxZoom int

CameraForLatLngs(IReadOnlyList<(double Lat, double Lon)>, double, double, double, double)

CameraResult CameraForLatLngs(IReadOnlyList<(double Lat, double Lon)> points, double padTop = 0, double padLeft = 0, double padBottom = 0, double padRight = 0)

Parameters

points IReadOnlyList<(double Lat, double Lon)>
padTop double
padLeft double
padBottom double
padRight double

Returns

CameraResult

CancelTransitions()

void CancelTransitions()

ClearLocationIndicator()

Remove the location indicator layer and reset state.

void ClearLocationIndicator()

EaseTo(MapSpan, double, double, long)

void EaseTo(MapSpan span, double bearing = 0, double pitch = 0, long durationMs = 300)

Parameters

span MapSpan
bearing double
pitch double
durationMs long

EaseTo(double, double, double, double, double, double, double, double, double, long)

void EaseTo(double latitude, double longitude, double zoom, double bearing, double pitch, double padTop, double padLeft, double padBottom, double padRight, long durationMs = 300)

Parameters

latitude double
longitude double
zoom double
bearing double
pitch double
padTop double
padLeft double
padBottom double
padRight double
durationMs long

EaseTo(double, double, double, double, double, long)

void EaseTo(double latitude, double longitude, double zoom, double bearing = 0, double pitch = 0, long durationMs = 300)

Parameters

latitude double
longitude double
zoom double
bearing double
pitch double
durationMs long

FlyTo(MapSpan, double, double, long)

void FlyTo(MapSpan span, double bearing = 0, double pitch = 0, long durationMs = 500)

Parameters

span MapSpan
bearing double
pitch double
durationMs long

FlyTo(double, double, double, double, double, double, double, double, double, long)

void FlyTo(double latitude, double longitude, double zoom, double bearing, double pitch, double padTop, double padLeft, double padBottom, double padRight, long durationMs = 500)

Parameters

latitude double
longitude double
zoom double
bearing double
pitch double
padTop double
padLeft double
padBottom double
padRight double
durationMs long

FlyTo(double, double, double, double, double, long)

void FlyTo(double latitude, double longitude, double zoom, double bearing = 0, double pitch = 0, long durationMs = 500)

Parameters

latitude double
longitude double
zoom double
bearing double
pitch double
durationMs long

GetBearing()

double GetBearing()

Returns

double

GetBounds()

BoundOptions GetBounds()

Returns

BoundOptions

GetCenter()

LatLng GetCenter()

Returns

LatLng

GetClusterChildren(string, string)

Direct children of a cluster as a GeoJSON FeatureCollection string, or null.

string? GetClusterChildren(string sourceId, string clusterFeatureJson)

Parameters

sourceId string
clusterFeatureJson string

Returns

string

GetClusterExpansionZoom(string, string)

Zoom level at which the given cluster (a Feature from a rendered-features query on a clustered source) expands into children, or null.

double? GetClusterExpansionZoom(string sourceId, string clusterFeatureJson)

Parameters

sourceId string
clusterFeatureJson string

Returns

double?

GetClusterLeaves(string, string, uint, uint)

Up to limit leaf features of a cluster (from offset) as a GeoJSON FeatureCollection string, or null.

string? GetClusterLeaves(string sourceId, string clusterFeatureJson, uint limit = 10, uint offset = 0)

Parameters

sourceId string
clusterFeatureJson string
limit uint
offset uint

Returns

string

GetDebugOptions()

Get current debug overlay bitmask (see MbglDebugOptions).

int GetDebugOptions()

Returns

int

GetLayerLayoutProperty(string, string)

Returns the JSON-encoded value of a layout property, or null if not set.

string? GetLayerLayoutProperty(string layerId, string name)

Parameters

layerId string
name string

Returns

string

GetLayerPaintProperty(string, string)

Returns the JSON-encoded value of a paint property, or null if not set.

string? GetLayerPaintProperty(string layerId, string name)

Parameters

layerId string
name string

Returns

string

GetLayerVisibility(string)

Returns true if the layer is currently visible.

bool GetLayerVisibility(string layerId)

Parameters

layerId string

Returns

bool

GetPitch()

double GetPitch()

Returns

double

GetPrefetchZoomDelta()

int GetPrefetchZoomDelta()

Returns

int

GetStyleLayerIds()

All layer IDs in draw order, or empty array if no style is loaded.

string[] GetStyleLayerIds()

Returns

string[]

GetStyleSourceIds()

All source IDs in the current style, or empty array if no style is loaded.

string[] GetStyleSourceIds()

Returns

string[]

GetStyleUrl()

URL from which the current style was loaded, or empty string.

string GetStyleUrl()

Returns

string

GetVisibleBounds()

Returns the map's currently visible region as a lat/lng bounding box (south-west and north-east corners). Corners are NaN when the map is not yet ready.

(double LatSW, double LonSW, double LatNE, double LonNE) GetVisibleBounds()

Returns

(double LatSW, double LonSW, double LatNE, double LonNE)

GetZoom()

double GetZoom()

Returns

double

JumpTo(MapSpan, double, double)

void JumpTo(MapSpan span, double bearing = 0, double pitch = 0)

Parameters

span MapSpan
bearing double
pitch double

JumpTo(double, double, double, double, double)

void JumpTo(double latitude, double longitude, double zoom, double bearing = 0, double pitch = 0)

Parameters

latitude double
longitude double
zoom double
bearing double
pitch double

JumpTo(double, double, double, double, double, double, double, double, double)

void JumpTo(double latitude, double longitude, double zoom, double bearing, double pitch, double padTop, double padLeft, double padBottom, double padRight)

Parameters

latitude double
longitude double
zoom double
bearing double
pitch double
padTop double
padLeft double
padBottom double
padRight double

LatLngToScreenPoint(double, double)

(double X, double Y) LatLngToScreenPoint(double latitude, double longitude)

Parameters

latitude double
longitude double

Returns

(double X, double Y)

LatLngsForPixels(IReadOnlyList<(double X, double Y)>)

(double Lat, double Lon)[] LatLngsForPixels(IReadOnlyList<(double X, double Y)> pixels)

Parameters

pixels IReadOnlyList<(double Lat, double Lon)>

Returns

(double X, double Y)[]

MoveBy(double, double, long)

void MoveBy(double dx, double dy, long durationMs = 0)

Parameters

dx double
dy double
durationMs long

PitchBy(double, long)

void PitchBy(double deltaDegrees, long durationMs = 0)

Parameters

deltaDegrees double
durationMs long

PixelsForLatLngs(IReadOnlyList<(double Lat, double Lon)>)

(double X, double Y)[] PixelsForLatLngs(IReadOnlyList<(double Lat, double Lon)> points)

Parameters

points IReadOnlyList<(double Lat, double Lon)>

Returns

(double X, double Y)[]

QueryRenderedFeaturesAtPoint(double, double, string?)

string? QueryRenderedFeaturesAtPoint(double x, double y, string? layerIds = null)

Parameters

x double
y double
layerIds string

Returns

string

QueryRenderedFeaturesInBox(double, double, double, double, string?)

string? QueryRenderedFeaturesInBox(double x1, double y1, double x2, double y2, string? layerIds = null)

Parameters

x1 double
y1 double
x2 double
y2 double
layerIds string

Returns

string

QuerySourceFeatures(string, string?, string?)

Query all features in a source's data, regardless of visibility. Returns a GeoJSON FeatureCollection string, or null if the renderer is not ready.

string? QuerySourceFeatures(string sourceId, string? sourceLayerIds = null, string? filterJson = null)

Parameters

sourceId string
sourceLayerIds string

Comma-separated source-layer names — required for vector sources, ignored for GeoJSON sources.

filterJson string

Optional style-spec filter expression JSON.

Returns

string

RemoveLayer(string)

void RemoveLayer(string layerId)

Parameters

layerId string

RemoveSource(string)

void RemoveSource(string sourceId)

Parameters

sourceId string

RemoveSpriteImage(string)

Remove a sprite image previously registered with AddSpriteImage(string, int, int, byte[], float, bool).

void RemoveSpriteImage(string imageId)

Parameters

imageId string

RotateBy(double, double, double, double)

void RotateBy(double x0, double y0, double x1, double y1)

Parameters

x0 double
y0 double
x1 double
y1 double

ScaleBy(double, double, double, long)

Multiply the map scale by scale (2.0 = one zoom level in), optionally about a screen anchor point (NaN = viewport centre).

void ScaleBy(double scale, double anchorX = NaN, double anchorY = NaN, long durationMs = 0)

Parameters

scale double
anchorX double
anchorY double
durationMs long

ScreenPointToLatLng(double, double)

LatLng ScreenPointToLatLng(double x, double y)

Parameters

x double
y double

Returns

LatLng

SetCameraTargetBounds(LatLngBounds, double, double, double, double)

void SetCameraTargetBounds(LatLngBounds bounds, double minZoom = NaN, double maxZoom = NaN, double minPitch = NaN, double maxPitch = NaN)

Parameters

bounds LatLngBounds
minZoom double
maxZoom double
minPitch double
maxPitch double

SetConstrainMode(int)

void SetConstrainMode(int mode)

Parameters

mode int

0=None 1=HeightOnly 2=WidthAndHeight 3=Screen

SetDebugOptions(int)

Set debug overlay bitmask. Use 0 to disable all overlays.

void SetDebugOptions(int options)

Parameters

options int

SetGeoJsonFeature(string, string)

void SetGeoJsonFeature(string sourceName, string geojsonFeature)

Parameters

sourceName string
geojsonFeature string

SetGeoJsonSource(string, string)

void SetGeoJsonSource(string sourceName, string source)

Parameters

sourceName string
source string

SetGestureInProgress(bool)

void SetGestureInProgress(bool inProgress)

Parameters

inProgress bool

SetLayerVisibility(string, bool)

Show or hide an existing layer.

void SetLayerVisibility(string layerId, bool visible)

Parameters

layerId string
visible bool

SetNorthOrientation(int)

void SetNorthOrientation(int orientation)

Parameters

orientation int

0=Upwards 1=Rightwards 2=Downwards 3=Leftwards

SetPrefetchZoomDelta(int)

void SetPrefetchZoomDelta(int delta)

Parameters

delta int

SetTileLodMinRadius(double)

void SetTileLodMinRadius(double radius)

Parameters

radius double

SetTileLodMode(int)

void SetTileLodMode(int mode)

Parameters

mode int

0=Default 1=Distance

SetTileLodPitchThreshold(double)

void SetTileLodPitchThreshold(double thresholdRadians)

Parameters

thresholdRadians double

SetTileLodScale(double)

void SetTileLodScale(double scale)

Parameters

scale double

SetTileLodZoomShift(double)

void SetTileLodZoomShift(double shift)

Parameters

shift double

SetViewportMode(int)

void SetViewportMode(int mode)

Parameters

mode int

0=Default 1=FlippedY

UpdateGpsLocation(double, double, float, float)

Feed a GPS location fix to the GPS control overlay. The current GPS tracking mode (Off / Show / Follow) determines whether the location indicator is shown and whether the camera follows the position. Safe to call before the style is loaded; the position is cached and applied once the style is ready.

void UpdateGpsLocation(double lat, double lon, float bearing = 0, float accuracyMeters = 10)

Parameters

lat double
lon double
bearing float
accuracyMeters float

UpdateLocationIndicator(double, double, float, float)

Show (or update) the user-location indicator at the given position. Safe to call before the style is fully loaded; the position is queued and applied on StyleLoaded.

void UpdateLocationIndicator(double lat, double lon, float bearing = 0, float accuracyMeters = 10)

Parameters

lat double
lon double
bearing float
accuracyMeters float

Events

OnCameraIdleReceived

event Action? OnCameraIdleReceived

Event Type

Action?

OnCameraMoveReceived

event Action? OnCameraMoveReceived

Event Type

Action?

OnCameraMoveStartedReceived

event Action<int>? OnCameraMoveStartedReceived

Event Type

Action<int>?

OnCameraTrackingChangedReceived

event Action<int>? OnCameraTrackingChangedReceived

Event Type

Action<int>?

OnCameraTrackingDismissedReceived

event Action? OnCameraTrackingDismissedReceived

Event Type

Action?

OnDidBecomeIdleReceived

event Action? OnDidBecomeIdleReceived

Event Type

Action?

OnDidFailLoadingMapReceived

Fired when the map fails to load its style. The string is the error message.

event Action<string>? OnDidFailLoadingMapReceived

Event Type

Action<string>?

OnMapClickReceived

event Func<LatLng, double, double, bool>? OnMapClickReceived

Event Type

Func<LatLng, double, double, bool>?

OnMapLongClickReceived

event Func<LatLng, double, double, bool>? OnMapLongClickReceived

Event Type

Func<LatLng, double, double, bool>?

OnMapReadyReceived

event Action<Map>? OnMapReadyReceived

Event Type

Action<Map>?

OnStyleImageMissingReceived

Fired when a style image is missing. The string is the image ID.

event Action<string>? OnStyleImageMissingReceived

Event Type

Action<string>?

OnStyleLoadedReceived

event Action<Style>? OnStyleLoadedReceived

Event Type

Action<Style>?

OnUserLocationUpdateReceived

event Action<Location>? OnUserLocationUpdateReceived

Event Type

Action<Location>?