Class MapPolygon
The MapPolygon represents the default model for polygon layer.
Inheritance
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapPolygon : Element, IThemeElement
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolygonLayer>
<map:MapPolygonLayer.Polygons>
<map:MapPolygon Fill = "LightGreen"
Stroke="Green"
StrokeThickness="4">
<map:MapPolygon.Points>
<map:MapLatLng Latitude="5.562764"
Longitude="101.470795" />
<map:MapLatLng Latitude="-19.138292"
Longitude="44.822302" />
<map:MapLatLng Latitude="-23.391278"
Longitude="124.580986" />
</map:MapPolygon.Points>
</map:MapPolygon>
</map:MapPolygonLayer.Polygons>
</map:MapPolygonLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Constructors
MapPolygon()
Initializes a new instance of the MapPolygon class.
Declaration
public MapPolygon()
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolygonLayer>
<map:MapPolygonLayer.Polygons>
<map:MapPolygon Fill = "LightGreen"
Stroke="Green"
StrokeThickness="4">
<map:MapPolygon.Points>
<map:MapLatLng Latitude="5.562764"
Longitude="101.470795" />
<map:MapLatLng Latitude="-19.138292"
Longitude="44.822302" />
<map:MapLatLng Latitude="-23.391278"
Longitude="124.580986" />
</map:MapPolygon.Points>
</map:MapPolygon>
</map:MapPolygonLayer.Polygons>
</map:MapPolygonLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Fields
FillProperty
Identifies the Fill bindable property.
Declaration
public static readonly BindableProperty FillProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
PointsProperty
Identifies the Points bindable property.
Declaration
public static readonly BindableProperty PointsProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
StrokeProperty
Identifies the Stroke bindable property.
Declaration
public static readonly BindableProperty StrokeProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
StrokeThicknessProperty
Identifies the StrokeThickness bindable property.
Declaration
public static readonly BindableProperty StrokeThicknessProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
Fill
Gets or sets the brush that paints the interior area of the polygon.
Declaration
public Brush Fill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | A |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolygonLayer>
<map:MapPolygonLayer.Polygons>
<map:MapPolygon Fill = "LightGreen">
<map:MapPolygon.Points>
<map:MapLatLng Latitude="5.562764"
Longitude="101.470795" />
<map:MapLatLng Latitude="-19.138292"
Longitude="44.822302" />
<map:MapLatLng Latitude="-23.391278"
Longitude="124.580986" />
</map:MapPolygon.Points>
</map:MapPolygon>
</map:MapPolygonLayer.Polygons>
</map:MapPolygonLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Points
Gets or sets the collection of geolocation coordinates of the polygon to be drawn.
Declaration
public IList<MapLatLng> Points { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<MapLatLng> | The points collection. By default, the collection is empty. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolygonLayer>
<map:MapPolygonLayer.Polygons>
<map:MapPolygon>
<map:MapPolygon.Points>
<map:MapLatLng Latitude="5.562764"
Longitude="101.470795" />
<map:MapLatLng Latitude="-19.138292"
Longitude="44.822302" />
<map:MapLatLng Latitude="-23.391278"
Longitude="124.580986" />
</map:MapPolygon.Points>
</map:MapPolygon>
</map:MapPolygonLayer.Polygons>
</map:MapPolygonLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Stroke
Gets or sets the brush that paints the stroke area of the polygon.
Declaration
public Brush Stroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | A |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolygonLayer>
<map:MapPolygonLayer.Polygons>
<map:MapPolygon Fill = "LightGreen"
Stroke="Green">
<map:MapPolygon.Points>
<map:MapLatLng Latitude="5.562764"
Longitude="101.470795" />
<map:MapLatLng Latitude="-19.138292"
Longitude="44.822302" />
<map:MapLatLng Latitude="-23.391278"
Longitude="124.580986" />
</map:MapPolygon.Points>
</map:MapPolygon>
</map:MapPolygonLayer.Polygons>
</map:MapPolygonLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
StrokeThickness
Gets or sets the value that specifies the width of the polygon stroke outline.
Declaration
public double StrokeThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It specifies the width of the map polygon stroke outline. The default value is 2. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolygonLayer>
<map:MapPolygonLayer.Polygons>
<map:MapPolygon Fill = "LightGreen"
Stroke="Green"
StrokeThickness="4">
<map:MapPolygon.Points>
<map:MapLatLng Latitude="5.562764"
Longitude="101.470795" />
<map:MapLatLng Latitude="-19.138292"
Longitude="44.822302" />
<map:MapLatLng Latitude="-23.391278"
Longitude="124.580986" />
</map:MapPolygon.Points>
</map:MapPolygon>
</map:MapPolygonLayer.Polygons>
</map:MapPolygonLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>