Class MapLine
The MapLine represents the default model for line layer.
Inheritance
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapLine : 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:MapLineLayer>
<map:MapLineLayer.Lines>
<map:MapLine StrokeThickness = "3"
StrokeLineCap="Round"
Stroke="LightGreen">
<map:MapLine.From>
<map:MapLatLng Latitude="26.841944"
Longitude="114.561183" />
</map:MapLine.From>
<map:MapLine.To>
<map:MapLatLng Latitude="37.316207"
Longitude="89.494558" />
</map:MapLine.To>
<map:MapLine.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:MapLine.StrokeDashArray>
</map:MapLine>
</map:MapLineLayer.Lines>
</map:MapLineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Constructors
MapLine()
Initializes a new instance of the MapLine class.
Declaration
public MapLine()
Fields
FromProperty
Identifies the From bindable property.
Declaration
public static readonly BindableProperty FromProperty
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 |
ToProperty
Identifies the To bindable property.
Declaration
public static readonly BindableProperty ToProperty
Field Value
Type |
---|
Microsoft.Maui.Controls.BindableProperty |
Properties
From
Gets or sets the value that specifies the start point of line.
Declaration
public MapLatLng From { get; set; }
Property Value
Type | Description |
---|---|
MapLatLng | The from value of the map line. The default is |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapLineLayer>
<map:MapLineLayer.Lines>
<map:MapLine>
<map:MapLine.From>
<map:MapLatLng Latitude="26.841944"
Longitude="114.561183" />
</map:MapLine.From>
<map:MapLine.To>
<map:MapLatLng Latitude="37.316207"
Longitude="89.494558" />
</map:MapLine.To>
</map:MapLine>
</map:MapLineLayer.Lines>
</map:MapLineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Stroke
Gets or sets the brush that used to paints the line.
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:MapLineLayer>
<map:MapLineLayer.Lines>
<map:MapLine StrokeThickness = "3"
StrokeLineCap="Round"
Stroke="LightGreen">
<map:MapLine.From>
<map:MapLatLng Latitude="26.841944"
Longitude="114.561183" />
</map:MapLine.From>
<map:MapLine.To>
<map:MapLatLng Latitude="37.316207"
Longitude="89.494558" />
</map:MapLine.To>
</map:MapLine>
</map:MapLineLayer.Lines>
</map:MapLineLayer>
</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 line.
Declaration
public DoubleCollection StrokeDashArray { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.DoubleCollection | The dash value of the map line. The default is |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapLineLayer>
<map:MapLineLayer.Lines>
<map:MapLine StrokeThickness = "3"
StrokeLineCap="Round"
Stroke="LightGreen">
<map:MapLine.From>
<map:MapLatLng Latitude="26.841944"
Longitude="114.561183" />
</map:MapLine.From>
<map:MapLine.To>
<map:MapLatLng Latitude="37.316207"
Longitude="89.494558" />
</map:MapLine.To>
<map:MapLine.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:MapLine.StrokeDashArray>
</map:MapLine>
</map:MapLineLayer.Lines>
</map:MapLineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
StrokeLineCap
Gets or sets the value that specifies the shape of the line's start and end of a line.
Declaration
public LineCap StrokeLineCap { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.LineCap | It specifies the stroke cap of the map line. The default value is butt. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapLineLayer>
<map:MapLineLayer.Lines>
<map:MapLine StrokeThickness = "3"
StrokeLineCap="Round">
<map:MapLine.From>
<map:MapLatLng Latitude="26.841944"
Longitude="114.561183" />
</map:MapLine.From>
<map:MapLine.To>
<map:MapLatLng Latitude="37.316207"
Longitude="89.494558" />
</map:MapLine.To>
</map:MapLine>
</map:MapLineLayer.Lines>
</map:MapLineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
StrokeThickness
Gets or sets the value that specifies the width of the line stroke outline.
Declaration
public double StrokeThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It specifies the width of the map line. The default value is 5. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapLineLayer>
<map:MapLineLayer.Lines>
<map:MapLine StrokeThickness = "3">
<map:MapLine.From>
<map:MapLatLng Latitude="26.841944"
Longitude="114.561183" />
</map:MapLine.From>
<map:MapLine.To>
<map:MapLatLng Latitude="37.316207"
Longitude="89.494558" />
</map:MapLine.To>
</map:MapLine>
</map:MapLineLayer.Lines>
</map:MapLineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
To
Gets or sets the value that specifies the end point of line.
Declaration
public MapLatLng To { get; set; }
Property Value
Type | Description |
---|---|
MapLatLng | The to value of the map line. The default is |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer ShapesSource = "https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Sublayers>
<map:MapLineLayer>
<map:MapLineLayer.Lines>
<map:MapLine>
<map:MapLine.From>
<map:MapLatLng Latitude="26.841944"
Longitude="114.561183" />
</map:MapLine.From>
<map:MapLine.To>
<map:MapLatLng Latitude="37.316207"
Longitude="89.494558" />
</map:MapLine.To>
</map:MapLine>
</map:MapLineLayer.Lines>
</map:MapLineLayer>
</map:MapShapeLayer.Sublayers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>