Table of Contents

Class Polygon

A filled area bounded by a sequence of geographic locations, mirroring Microsoft.Maui.Controls.Maps.Polygon. Rendered as a GeoJSON Polygon with a fill layer and a stroke line layer. The ring is closed automatically.

public class Polygon : MapOverlayElement
Inheritance
Polygon
Inherited Members

Constructors

Polygon()

public Polygon()

Fields

FillColorProperty

public static readonly BindableProperty FillColorProperty

Field Value

BindableProperty

Properties

FillColor

The fill colour of the polygon.

public Color? FillColor { get; set; }

Property Value

Color?

Geopath

The vertices of the polygon. Mutating the collection rebuilds the shape.

public IList<Location> Geopath { get; }

Property Value

IList<Location>

Methods

BuildOverlay(MapLibreMap)

Adds this element's source and layer(s) to map.

protected override void BuildOverlay(MapLibreMap map)

Parameters

map MapLibreMap

BuildSourceFeatures()

Returns the element's source features when the geometry can be updated in place, or null to fall back to a full rebuild. Overridden by geometry-based elements (Circle/Polyline/Polygon) so that geometry changes update the existing source via SetGeoJsonSource instead of removing and re-adding the source and its layers.

protected override GeoJSON.Text.Feature.FeatureCollection? BuildSourceFeatures()

Returns

GeoJSON.Text.Feature.FeatureCollection?

RemoveOverlay(MapLibreMap)

Removes this element's layer(s) and source from map.

protected override void RemoveOverlay(MapLibreMap map)

Parameters

map MapLibreMap