Class MapDataLabelSettings
Represents the map data labels settings.
Inheritance
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class MapDataLabelSettings : Element, IThemeElement
Examples
<map:SfMaps>
<map:SfMaps.BindingContext>
<local:RangeViewModel/>
</map:SfMaps.BindingContext>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json"
DataSource="{Binding WorldPopulationDensity}"
ShapeDataField="name"
PrimaryValuePath="CountryName"
ShowDataLabels="True">
<map:MapShapeLayer.DataLabelSettings>
<map:MapDataLabelSettings DataLabelPath="Density"
OverflowMode="Trim">
<map:MapDataLabelSettings.DataLabelStyle>
<map:MapLabelStyle TextColor="Green"
FontSize="12"
FontAttributes="Bold" />
</map:MapDataLabelSettings.DataLabelStyle>
</map:MapDataLabelSettings>
</map:MapShapeLayer.DataLabelSettings>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Constructors
MapDataLabelSettings()
Initializes a new instance of the MapDataLabelSettings class.
Declaration
public MapDataLabelSettings()
Fields
DataLabelPathProperty
Identifies the DataLabelPath dependency property.
Declaration
public static readonly BindableProperty DataLabelPathProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for DataLabelPath dependency property. |
DataLabelStyleProperty
Identifies the DataLabelStyle dependency property.
Declaration
public static readonly BindableProperty DataLabelStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for DataLabelStyle dependency property. |
OverflowModeProperty
Identifies the OverflowMode dependency property.
Declaration
public static readonly BindableProperty OverflowModeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for OverflowMode dependency property. |
Properties
DataLabelPath
Gets or sets the field value to be fetched from data for each shape used to determine the data label in the shape layer of the maps.
Declaration
public string DataLabelPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The data label path of the shapes. The default is |
Examples
<map:SfMaps>
<map:SfMaps.BindingContext>
<local:RangeViewModel/>
</map:SfMaps.BindingContext>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json"
DataSource="{Binding WorldPopulationDensity}"
ShapeDataField="name"
PrimaryValuePath="CountryName"
ShowDataLabels="True">
<map:MapShapeLayer.DataLabelSettings>
<map:MapDataLabelSettings DataLabelPath="Density"/>
</map:MapShapeLayer.DataLabelSettings>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
DataLabelStyle
Gets or sets the map data label style to customize the appearance of the data labels.
Declaration
public MapLabelStyle DataLabelStyle { get; set; }
Property Value
Type | Description |
---|---|
MapLabelStyle | Apply when customization required for data labels. |
Examples
<map:SfMaps>
<map:SfMaps.BindingContext>
<local:RangeViewModel/>
</map:SfMaps.BindingContext>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json"
DataSource="{Binding WorldPopulationDensity}"
ShapeDataField="name"
PrimaryValuePath="CountryName"
ShowDataLabels="True">
<map:MapShapeLayer.DataLabelSettings>
<map:MapDataLabelSettings DataLabelPath="Density">
<map:MapDataLabelSettings.DataLabelStyle>
<map:MapLabelStyle TextColor="Green"
FontSize="12"
FontAttributes="Bold"/>
</map:MapDataLabelSettings.DataLabelStyle>
</map:MapDataLabelSettings>
</map:MapShapeLayer.DataLabelSettings>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
OverflowMode
Gets or sets the label intersection action.
Declaration
public MapLabelOverflowMode OverflowMode { get; set; }
Property Value
Type | Description |
---|---|
MapLabelOverflowMode | One of the enumeration values that specifies the over flow mode of data label. The default is None. |
Examples
<map:SfMaps>
<map:SfMaps.BindingContext>
<local:RangeViewModel/>
</map:SfMaps.BindingContext>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json"
DataSource="{Binding WorldPopulationDensity}"
ShapeDataField="name"
PrimaryValuePath="CountryName"
ShowDataLabels="True">
<map:MapShapeLayer.DataLabelSettings>
<map:MapDataLabelSettings DataLabelPath="Density"
OverflowMode="Trim">
<map:MapDataLabelSettings.DataLabelStyle>
<map:MapLabelStyle TextColor="Green"
FontSize="12"
FontAttributes="Bold" />
</map:MapDataLabelSettings.DataLabelStyle>
</map:MapDataLabelSettings>
</map:MapShapeLayer.DataLabelSettings>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Methods
OnBindingContextChanged()
Invoked whenever the binding context of the View changes.
Declaration
protected override void OnBindingContextChanged()