Class MapPolyline
The MapPolyline represents the default model for polyline layer.
Inheritance
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapPolyline : Element, IThemeElement
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/india.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolylineLayer>
<map:MapPolylineLayer.Polylines>
<map:MapPolyline StrokeThickness="4">
<map:MapPolyline.Points>
<map:MapLatLng Latitude="13.0827"
Longitude="80.2707" />
<map:MapLatLng Latitude="13.1746"
Longitude="79.6117" />
<map:MapLatLng Latitude="13.6373"
Longitude="79.5037" />
<map:MapLatLng Latitude="14.4673"
Longitude="78.8242" />
<map:MapLatLng Latitude="14.9091"
Longitude="78.0092" />
<map:MapLatLng Latitude="16.2160"
Longitude="77.3566" />
<map:MapLatLng Latitude="17.1557"
Longitude="76.8697" />
<map:MapLatLng Latitude="18.0975"
Longitude="75.4249" />
<map:MapLatLng Latitude="18.5204"
Longitude="73.8567" />
<map:MapLatLng Latitude="19.0760"
Longitude="72.8777" />
</map:MapPolyline.Points>
<map:MapPolyline.StrokeDashArray>
<DoubleCollection>
<x:Double>2</x:Double>
<x:Double>2</x:Double>
<x:Double>0.1</x:Double>
<x:Double>2</x:Double>
</DoubleCollection>
</map:MapPolyline.StrokeDashArray>
</map:MapPolyline>
</map:MapPolylineLayer.Polylines>
</map:MapPolylineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Constructors
MapPolyline()
Initializes a new instance of the MapPolyline class.
Declaration
public MapPolyline()
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/india.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolylineLayer>
<map:MapPolylineLayer.Polylines>
<map:MapPolyline StrokeThickness = "4">
<map:MapPolyline.Points>
<map:MapLatLng Latitude="13.0827"
Longitude="80.2707" />
<map:MapLatLng Latitude="13.1746"
Longitude="79.6117" />
<map:MapLatLng Latitude="13.6373"
Longitude="79.5037" />
<map:MapLatLng Latitude="14.4673"
Longitude="78.8242" />
<map:MapLatLng Latitude="14.9091"
Longitude="78.0092" />
<map:MapLatLng Latitude="16.2160"
Longitude="77.3566" />
<map:MapLatLng Latitude="17.1557"
Longitude="76.8697" />
<map:MapLatLng Latitude="18.0975"
Longitude="75.4249" />
<map:MapLatLng Latitude="18.5204"
Longitude="73.8567" />
<map:MapLatLng Latitude="19.0760"
Longitude="72.8777" />
</map:MapPolyline.Points>
<map:MapPolyline.StrokeDashArray>
<DoubleCollection>
<x:Double>2</x:Double>
<x:Double>2</x:Double>
<x:Double>0.1</x:Double>
<x:Double>2</x:Double>
</DoubleCollection>
</map:MapPolyline.StrokeDashArray>
</map:MapPolyline>
</map:MapPolylineLayer.Polylines>
</map:MapPolylineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Fields
PointsProperty
Identifies the Points bindable property.
Declaration
public static readonly BindableProperty PointsProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
StrokeDashArrayProperty
Identifies the StrokeDashArray bindable property.
Declaration
public static readonly BindableProperty StrokeDashArrayProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
StrokeLineCapProperty
Identifies the StrokeLineCap bindable property.
Declaration
public static readonly BindableProperty StrokeLineCapProperty
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
Points
Gets or sets the collection of points. Every single MapPolyline connects multiple location coordinates through group of Points.
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/india.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolylineLayer>
<map:MapPolylineLayer.Polylines>
<map:MapPolyline>
<map:MapPolyline.Points>
<map:MapLatLng Latitude="13.0827"
Longitude="80.2707" />
<map:MapLatLng Latitude="13.1746"
Longitude="79.6117" />
<map:MapLatLng Latitude="13.6373"
Longitude="79.5037" />
<map:MapLatLng Latitude="14.4673"
Longitude="78.8242" />
<map:MapLatLng Latitude="14.9091"
Longitude="78.0092" />
<map:MapLatLng Latitude="16.2160"
Longitude="77.3566" />
<map:MapLatLng Latitude="17.1557"
Longitude="76.8697" />
<map:MapLatLng Latitude="18.0975"
Longitude="75.4249" />
<map:MapLatLng Latitude="18.5204"
Longitude="73.8567" />
<map:MapLatLng Latitude="19.0760"
Longitude="72.8777" />
</map:MapPolyline.Points>
</map:MapPolyline>
</map:MapPolylineLayer.Polylines>
</map:MapPolylineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Stroke
Gets or sets the brush that paints the interior area of the polyline.
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/india.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolylineLayer>
<map:MapPolylineLayer.Polylines>
<map:MapPolyline StrokeThickness = "4"
StrokeLineCap="Round"
Stroke="Blue">
<map:MapPolyline.Points>
<map:MapLatLng Latitude="13.0827"
Longitude="80.2707" />
<map:MapLatLng Latitude="13.1746"
Longitude="79.6117" />
<map:MapLatLng Latitude="13.6373"
Longitude="79.5037" />
<map:MapLatLng Latitude="14.4673"
Longitude="78.8242" />
<map:MapLatLng Latitude="14.9091"
Longitude="78.0092" />
<map:MapLatLng Latitude="16.2160"
Longitude="77.3566" />
<map:MapLatLng Latitude="17.1557"
Longitude="76.8697" />
<map:MapLatLng Latitude="18.0975"
Longitude="75.4249" />
<map:MapLatLng Latitude="18.5204"
Longitude="73.8567" />
<map:MapLatLng Latitude="19.0760"
Longitude="72.8777" />
</map:MapPolyline.Points>
</map:MapPolyline>
</map:MapPolylineLayer.Polylines>
</map:MapPolylineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
StrokeDashArray
Gets or sets the value collection of double values that specifies the pattern of dashes and gaps that are used to outline of the polyline.
Declaration
public DoubleCollection StrokeDashArray { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.DoubleCollection | The dash value of the map polyline. The default is |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/india.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolylineLayer>
<map:MapPolylineLayer.Polylines>
<map:MapPolyline StrokeThickness = "4">
<map:MapPolyline.Points>
<map:MapLatLng Latitude="13.0827"
Longitude="80.2707" />
<map:MapLatLng Latitude="13.1746"
Longitude="79.6117" />
<map:MapLatLng Latitude="13.6373"
Longitude="79.5037" />
<map:MapLatLng Latitude="14.4673"
Longitude="78.8242" />
<map:MapLatLng Latitude="14.9091"
Longitude="78.0092" />
<map:MapLatLng Latitude="16.2160"
Longitude="77.3566" />
<map:MapLatLng Latitude="17.1557"
Longitude="76.8697" />
<map:MapLatLng Latitude="18.0975"
Longitude="75.4249" />
<map:MapLatLng Latitude="18.5204"
Longitude="73.8567" />
<map:MapLatLng Latitude="19.0760"
Longitude="72.8777" />
</map:MapPolyline.Points>
<map:MapPolyline.StrokeDashArray>
<DoubleCollection>
<x:Double>2</x:Double>
<x:Double>2</x:Double>
<x:Double>0.1</x:Double>
<x:Double>2</x:Double>
</DoubleCollection>
</map:MapPolyline.StrokeDashArray>
</map:MapPolyline>
</map:MapPolylineLayer.Polylines>
</map:MapPolylineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
StrokeLineCap
Gets or sets the value that specifies the shape of the polyline's start and end of a polyline.
Declaration
public LineCap StrokeLineCap { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.LineCap | It specifies the stroke cap of the map polyline. The default value is butt. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/india.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolylineLayer>
<map:MapPolylineLayer.Polylines>
<map:MapPolyline StrokeThickness = "4"
StrokeLineCap="Round">
<map:MapPolyline.Points>
<map:MapLatLng Latitude="13.0827"
Longitude="80.2707" />
<map:MapLatLng Latitude="13.1746"
Longitude="79.6117" />
<map:MapLatLng Latitude="13.6373"
Longitude="79.5037" />
<map:MapLatLng Latitude="14.4673"
Longitude="78.8242" />
<map:MapLatLng Latitude="14.9091"
Longitude="78.0092" />
<map:MapLatLng Latitude="16.2160"
Longitude="77.3566" />
<map:MapLatLng Latitude="17.1557"
Longitude="76.8697" />
<map:MapLatLng Latitude="18.0975"
Longitude="75.4249" />
<map:MapLatLng Latitude="18.5204"
Longitude="73.8567" />
<map:MapLatLng Latitude="19.0760"
Longitude="72.8777" />
</map:MapPolyline.Points>
</map:MapPolyline>
</map:MapPolylineLayer.Polylines>
</map:MapPolylineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
StrokeThickness
Gets or sets the value that specifies the width of the polyline.
Declaration
public double StrokeThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It specifies the width of the map polyline. The default value is 2. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/india.json">
<map:MapShapeLayer.Sublayers>
<map:MapPolylineLayer>
<map:MapPolylineLayer.Polylines>
<map:MapPolyline StrokeThickness = "4">
<map:MapPolyline.Points>
<map:MapLatLng Latitude="13.0827"
Longitude="80.2707" />
<map:MapLatLng Latitude="13.1746"
Longitude="79.6117" />
<map:MapLatLng Latitude="13.6373"
Longitude="79.5037" />
<map:MapLatLng Latitude="14.4673"
Longitude="78.8242" />
<map:MapLatLng Latitude="14.9091"
Longitude="78.0092" />
<map:MapLatLng Latitude="16.2160"
Longitude="77.3566" />
<map:MapLatLng Latitude="17.1557"
Longitude="76.8697" />
<map:MapLatLng Latitude="18.0975"
Longitude="75.4249" />
<map:MapLatLng Latitude="18.5204"
Longitude="73.8567" />
<map:MapLatLng Latitude="19.0760"
Longitude="72.8777" />
</map:MapPolyline.Points>
</map:MapPolyline>
</map:MapPolylineLayer.Polylines>
</map:MapPolylineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>