Class ColorMapping
Represents the base class for EqualColorMapping and RangeColorMapping.
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public abstract class ColorMapping : BindableObject
Constructors
ColorMapping()
Declaration
protected ColorMapping()
Fields
ColorProperty
Identifies the Color bindable property.
Declaration
public static readonly BindableProperty ColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Color bindable property. |
TextProperty
Identifies the Text bindable property.
Declaration
public static readonly BindableProperty TextProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Text bindable property. |
Properties
Color
Gets or sets the color that applies to the shape or bubble based on the value.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The color value. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json"
ShapeFill="Gray"
ShapeStroke="White"
ShapeStrokeThickness="2"
DataSource="{Binding WorldPopulationDensity}"
ShapeDataField="name"
PrimaryValuePath="CountryName"
ShapeColorValuePath="Density">
<map:MapShapeLayer.ColorMappings>
<map:RangeColorMapping Color="#809fff" From="0" To="100" Text="0-100" />
<map:RangeColorMapping Color="#3366ff" From="100" To="500" Text="100-500" />
<map:RangeColorMapping Color="#0039e6" From="500" To="1000" Text="500-1000" />
<map:RangeColorMapping Color="#002db3" From="1000" To="5000" Text="1000-5000" />
<map:RangeColorMapping Color="#001a66" From="5000" To="50000" Text="5000-50000" />
</map:MapShapeLayer.ColorMappings>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>
Text
Gets or sets the text to be used for the shape or bubble legend item.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | The value to be displayed in legend item. |
Examples
<map:SfMaps>
<map:SfMaps.Layer>
<map:MapShapeLayer x:Name="layer"
ShapesSource="https://cdn.syncfusion.com/maps/map-data/world-map.json"
ShapeFill="Gray"
ShapeStroke="White"
ShapeStrokeThickness="2"
DataSource="{Binding WorldPopulationDensity}"
ShapeDataField="name"
PrimaryValuePath="CountryName"
ShapeColorValuePath="Density">
<map:MapShapeLayer.ColorMappings>
<map:RangeColorMapping Color="#809fff" From="0" To="100" Text="0-100" />
<map:RangeColorMapping Color="#3366ff" From="100" To="500" Text="100-500" />
<map:RangeColorMapping Color="#0039e6" From="500" To="1000" Text="500-1000" />
<map:RangeColorMapping Color="#002db3" From="1000" To="5000" Text="1000-5000" />
<map:RangeColorMapping Color="#001a66" From="5000" To="50000" Text="5000-50000" />
</map:MapShapeLayer.ColorMappings>
</map:MapShapeLayer>
</map:SfMaps.Layer>
</map:SfMaps>