Class MapMarker
The MapMarker represents the default model for markers.
Inheritance
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapMarker : Element, IThemeElement
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidht="10"
IconFill="Red"
IconStroke="Blue"
IconStrokeThickness="4"
HorizontalAlignment="Start"
VerticalAlignment="Start"
Offset="5,5" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Constructors
MapMarker()
Initializes a new instance of the MapMarker class.
Declaration
public MapMarker()
Fields
HorizontalAlignmentProperty
Identifies the HorizontalAlignment bindable property.
Declaration
public static readonly BindableProperty HorizontalAlignmentProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for HorizontalAlignment bindable property. |
IconFillProperty
Identifies the IconFill bindable property.
Declaration
public static readonly BindableProperty IconFillProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IconFill bindable property. |
IconHeightProperty
Identifies the IconHeight bindable property.
Declaration
public static readonly BindableProperty IconHeightProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IconHeight bindable property. |
IconStrokeProperty
Identifies the IconStroke bindable property.
Declaration
public static readonly BindableProperty IconStrokeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IconStroke bindable property. |
IconStrokeThicknessProperty
Identifies the IconStrokeThickness bindable property.
Declaration
public static readonly BindableProperty IconStrokeThicknessProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IconStrokeThickness bindable property. |
IconTypeProperty
Identifies the IconType bindable property.
Declaration
public static readonly BindableProperty IconTypeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IconType bindable property. |
IconWidthProperty
Identifies the IconWidth bindable property.
Declaration
public static readonly BindableProperty IconWidthProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IconWidth bindable property. |
LatitudeProperty
Identifies the Latitude bindable property.
Declaration
public static readonly BindableProperty LatitudeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Latitude bindable property. |
LongitudeProperty
Identifies the Longitude bindable property.
Declaration
public static readonly BindableProperty LongitudeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Longitude bindable property. |
OffsetProperty
Identifies the Offset bindable property.
Declaration
public static readonly BindableProperty OffsetProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Offset bindable property. |
VerticalAlignmentProperty
Identifies the VerticalAlignment bindable property.
Declaration
public static readonly BindableProperty VerticalAlignmentProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for VerticalAlignment bindable property. |
Properties
HorizontalAlignment
Gets or sets the horizontal placement (left, center or right) of the marker icon relative to its position.
Declaration
public MapAlignment HorizontalAlignment { get; set; }
Property Value
Type | Description |
---|---|
MapAlignment | One of the enumeration values that specifies the horizontal alignment of map marker. The default is Center. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidht="10"
IconFill="Red"
IconStroke="Blue"
IconStrokeThickness="4"
HorizontalAlignment="Start" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
IconFill
Gets or sets the Brush
that paints the interior of the marker icon.
Declaration
public Brush IconFill { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | A |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidht="10"
IconFill="Red" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
IconHeight
Gets or sets the marker icon height.
Declaration
public double IconHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It specifies the height of the map icon. The default value is 8. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
IconStroke
Gets or sets the Brush
that specifies how the icon outline to be painted.
Declaration
public Brush IconStroke { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | A |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidht="10"
IconFill="Red"
IconStroke="Blue" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
IconStrokeThickness
Gets or sets the value that specifies the width of the icon stroke outline.
Declaration
public double IconStrokeThickness { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It specifies the width of the marker icon stroke outline. The default value is 1. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidht="10"
IconFill="Red"
IconStroke="Blue"
IconStrokeThickness="4" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
IconType
Gets or sets the marker icon type.
Declaration
public MapIconType IconType { get; set; }
Property Value
Type | Description |
---|---|
MapIconType | One of the enumeration values that specifies the icon type of marker. The default is Circle. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
IconWidth
Gets or sets the marker icon width.
Declaration
public double IconWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | It specifies the width of the map icon. The default value is 8. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidth="10" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Latitude
Gets or sets the marker latitude.
Declaration
public double Latitude { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The latitude value of the map marker. The default is |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Longitude
Gets or sets the marker longitude.
Declaration
public double Longitude { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The longitude value of the map marker. The default is |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Offset
Gets or sets the offset to the marker relative to its position.
Declaration
public Point Offset { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Point | It defines the offset position of the map marker in pixel. The default value is (0,0). |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidht="10"
IconFill="Red"
IconStroke="Blue"
IconStrokeThickness="4"
HorizontalAlignment="Start"
VerticalAlignment="Start"
Offset="5,5" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
VerticalAlignment
Gets or sets the vertical placement (top, center or bottom) of the marker icon relative to its position.
Declaration
public MapAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
MapAlignment | One of the enumeration values that specifies the vertical alignment of map marker. The default is Center. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json">
<map:MapShapeLayer.Markers>
<map:MapMarkerCollection>
<map:MapMarker x:Name="Seattle"
Latitude="47.60621"
Longitude="-122.332071"
IconType="Triangle"
IconHeight="10"
IconWidht="10"
IconFill="Red"
IconStroke="Blue"
IconStrokeThickness="4"
HorizontalAlignment="Start"
VerticalAlignment="Start" />
</map:MapMarkerCollection>
</map:MapShapeLayer.Markers>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>