Interface IMapLibreMapController
- Namespace
- MapLibreNative.Maui.Handlers
public interface IMapLibreMapController : IMapLibreMapOptionsSink
- Inherited Members
Properties
FollowLocation
When true, each GPS fix also re-centres the map.
bool FollowLocation { get; set; }
Property Value
ShowBearing
When false the bearing arrow is suppressed — indicator always points north.
bool ShowBearing { get; set; }
Property Value
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
layerNamestringsourceNamestringbelowLayerIdstringsourceLayerstringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatenableInteractionbool
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
layerNamestringsourceNamestringbelowLayerIdstringsourceLayerstringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatenableInteractionbool
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
layerNamestringsourceNamestringbelowLayerIdstringsourceLayerstringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatenableInteractionbool
AddGeoJsonSource(string, string)
void AddGeoJsonSource(string sourceName, string source)
Parameters
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
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
layerNamestringsourceNamestringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatbelowLayerIdstring
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
layerNamestringsourceNamestringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatbelowLayerIdstring
AddImageSource(string, string, LatLngQuad?)
void AddImageSource(string sourceName, string url, LatLngQuad? coordinates)
Parameters
sourceNamestringurlstringcoordinatesLatLngQuad
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
layerNamestringsourceNamestringbelowLayerIdstringsourceLayerstringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatenableInteractionbool
AddRasterDemSource(string, string?, string[]?, int, int, int)
void AddRasterDemSource(string sourceName, string? tileUrl, string[]? tileUrlTemplates, int tileSize, int minZoom, int maxZoom)
Parameters
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
layerNamestringsourceNamestringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatbelowLayerIdstring
AddRasterSource(string, string?, string[]?, int, int, int)
void AddRasterSource(string sourceName, string? tileUrl, string[]? tileUrlTemplates, int tileSize, int minZoom, int maxZoom)
Parameters
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
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
layerNamestringsourceNamestringbelowLayerIdstringsourceLayerstringpropertiesIDictionary<string, object>minZoomfloatmaxZoomfloatenableInteractionbool
AddVectorSource(string, string?, string[]?, int, int)
void AddVectorSource(string sourceName, string? tileUrl, string[]? tileUrlTemplates, int minZoom, int maxZoom)
Parameters
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
pointsIReadOnlyList<(double Lat, double Lon)>padTopdoublepadLeftdoublepadBottomdoublepadRightdouble
Returns
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
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
latitudedoublelongitudedoublezoomdoublebearingdoublepitchdoublepadTopdoublepadLeftdoublepadBottomdoublepadRightdoubledurationMslong
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
FlyTo(MapSpan, double, double, long)
void FlyTo(MapSpan span, double bearing = 0, double pitch = 0, long durationMs = 500)
Parameters
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
latitudedoublelongitudedoublezoomdoublebearingdoublepitchdoublepadTopdoublepadLeftdoublepadBottomdoublepadRightdoubledurationMslong
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
GetBearing()
double GetBearing()
Returns
GetBounds()
BoundOptions GetBounds()
Returns
GetCenter()
LatLng GetCenter()
Returns
GetClusterChildren(string, string)
Direct children of a cluster as a GeoJSON FeatureCollection string, or null.
string? GetClusterChildren(string sourceId, string clusterFeatureJson)
Parameters
Returns
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
Returns
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
Returns
GetDebugOptions()
Get current debug overlay bitmask (see MbglDebugOptions).
int GetDebugOptions()
Returns
GetLayerLayoutProperty(string, string)
Returns the JSON-encoded value of a layout property, or null if not set.
string? GetLayerLayoutProperty(string layerId, string name)
Parameters
Returns
GetLayerPaintProperty(string, string)
Returns the JSON-encoded value of a paint property, or null if not set.
string? GetLayerPaintProperty(string layerId, string name)
Parameters
Returns
GetLayerVisibility(string)
Returns true if the layer is currently visible.
bool GetLayerVisibility(string layerId)
Parameters
layerIdstring
Returns
GetPitch()
double GetPitch()
Returns
GetPrefetchZoomDelta()
int GetPrefetchZoomDelta()
Returns
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
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
GetZoom()
double GetZoom()
Returns
JumpTo(MapSpan, double, double)
void JumpTo(MapSpan span, double bearing = 0, double pitch = 0)
Parameters
JumpTo(double, double, double, double, double)
void JumpTo(double latitude, double longitude, double zoom, double bearing = 0, double pitch = 0)
Parameters
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
latitudedoublelongitudedoublezoomdoublebearingdoublepitchdoublepadTopdoublepadLeftdoublepadBottomdoublepadRightdouble
LatLngToScreenPoint(double, double)
(double X, double Y) LatLngToScreenPoint(double latitude, double longitude)
Parameters
Returns
LatLngsForPixels(IReadOnlyList<(double X, double Y)>)
(double Lat, double Lon)[] LatLngsForPixels(IReadOnlyList<(double X, double Y)> pixels)
Parameters
Returns
MoveBy(double, double, long)
void MoveBy(double dx, double dy, long durationMs = 0)
Parameters
PitchBy(double, long)
void PitchBy(double deltaDegrees, long durationMs = 0)
Parameters
PixelsForLatLngs(IReadOnlyList<(double Lat, double Lon)>)
(double X, double Y)[] PixelsForLatLngs(IReadOnlyList<(double Lat, double Lon)> points)
Parameters
Returns
QueryRenderedFeaturesAtPoint(double, double, string?)
string? QueryRenderedFeaturesAtPoint(double x, double y, string? layerIds = null)
Parameters
Returns
QueryRenderedFeaturesInBox(double, double, double, double, string?)
string? QueryRenderedFeaturesInBox(double x1, double y1, double x2, double y2, string? layerIds = null)
Parameters
Returns
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
sourceIdstringsourceLayerIdsstringComma-separated source-layer names — required for vector sources, ignored for GeoJSON sources.
filterJsonstringOptional style-spec filter expression JSON.
Returns
RemoveLayer(string)
void RemoveLayer(string layerId)
Parameters
layerIdstring
RemoveSource(string)
void RemoveSource(string sourceId)
Parameters
sourceIdstring
RemoveSpriteImage(string)
Remove a sprite image previously registered with AddSpriteImage(string, int, int, byte[], float, bool).
void RemoveSpriteImage(string imageId)
Parameters
imageIdstring
RotateBy(double, double, double, double)
void RotateBy(double x0, double y0, double x1, double y1)
Parameters
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
ScreenPointToLatLng(double, double)
LatLng ScreenPointToLatLng(double x, double y)
Parameters
Returns
SetCameraTargetBounds(LatLngBounds, double, double, double, double)
void SetCameraTargetBounds(LatLngBounds bounds, double minZoom = NaN, double maxZoom = NaN, double minPitch = NaN, double maxPitch = NaN)
Parameters
boundsLatLngBoundsminZoomdoublemaxZoomdoubleminPitchdoublemaxPitchdouble
SetConstrainMode(int)
void SetConstrainMode(int mode)
Parameters
modeint0=None 1=HeightOnly 2=WidthAndHeight 3=Screen
SetDebugOptions(int)
Set debug overlay bitmask. Use 0 to disable all overlays.
void SetDebugOptions(int options)
Parameters
optionsint
SetGeoJsonFeature(string, string)
void SetGeoJsonFeature(string sourceName, string geojsonFeature)
Parameters
SetGeoJsonSource(string, string)
void SetGeoJsonSource(string sourceName, string source)
Parameters
SetGestureInProgress(bool)
void SetGestureInProgress(bool inProgress)
Parameters
inProgressbool
SetLayerVisibility(string, bool)
Show or hide an existing layer.
void SetLayerVisibility(string layerId, bool visible)
Parameters
SetNorthOrientation(int)
void SetNorthOrientation(int orientation)
Parameters
orientationint0=Upwards 1=Rightwards 2=Downwards 3=Leftwards
SetPrefetchZoomDelta(int)
void SetPrefetchZoomDelta(int delta)
Parameters
deltaint
SetTileLodMinRadius(double)
void SetTileLodMinRadius(double radius)
Parameters
radiusdouble
SetTileLodMode(int)
void SetTileLodMode(int mode)
Parameters
modeint0=Default 1=Distance
SetTileLodPitchThreshold(double)
void SetTileLodPitchThreshold(double thresholdRadians)
Parameters
thresholdRadiansdouble
SetTileLodScale(double)
void SetTileLodScale(double scale)
Parameters
scaledouble
SetTileLodZoomShift(double)
void SetTileLodZoomShift(double shift)
Parameters
shiftdouble
SetViewportMode(int)
void SetViewportMode(int mode)
Parameters
modeint0=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
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
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
OnMapLongClickReceived
event Func<LatLng, double, double, bool>? OnMapLongClickReceived
Event Type
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>?