Class RangeColorMapping
Represents the range color mapping.
Inherited Members
Namespace: Syncfusion.Maui.Maps
Assembly: Syncfusion.Maui.Maps.dll
Syntax
public class RangeColorMapping : ColorMapping
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>
Constructors
RangeColorMapping()
Declaration
public RangeColorMapping()
Fields
FromProperty
Identifies the From bindable property.
Declaration
public static readonly BindableProperty FromProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for From bindable property. |
ToProperty
Identifies the To bindable property.
Declaration
public static readonly BindableProperty ToProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for To bindable property. |
Properties
From
Gets or sets the start range for the color mapping.
Declaration
public double From { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The start range for the color mapping. The default is 0. |
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>
To
Gets or sets the end range for the color mapping.
Declaration
public double To { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The end range for the color mapping. The default is 0. |
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>