Class MapPolygonLayer
A sublayer which renders group of MapPolygon on MapShapeLayer and MapTileLayer
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapPolygonLayer : MapSublayer
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
MapPolygonLayer()
Initializes a new instance of the MapPolygonLayer class.
Declaration
public MapPolygonLayer()
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
PolygonsProperty
Identifies the Polygons bindable property.
Declaration
public static readonly BindableProperty PolygonsProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
Polygons
Gets or sets the collection of polygon. Every single MapPolygon is a closed path which connects multiple location coordinates through group of Points.
Declaration
public ObservableCollection<MapPolygon> Polygons { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<MapPolygon> | The polygon 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 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>
Methods
OnBindingContextChanged()
Invoked whenever the binding context of the View changes.
Declaration
protected override void OnBindingContextChanged()