alexa
Syncfusion
menu Syncfusion

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class EqualColorMapping

    Represents the equal color mapping.

    Inheritance
    object
    ColorMapping
    EqualColorMapping
    Inherited Members
    ColorMapping.Color
    ColorMapping.ColorProperty
    ColorMapping.Text
    ColorMapping.TextProperty
    Namespace: Syncfusion.Maui.Maps
    Assembly: Syncfusion.Maui.Maps.dll
    Syntax
    public class EqualColorMapping : ColorMapping
    Examples
    • XAML
    • C#
    <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="CountryName">
    
             <map:MapShapeLayer.ColorMappings>
                 <map:EqualColorMapping Color="#809fff" Value="China" Text="China" />
             </map:MapShapeLayer.ColorMappings>
    
          </map:MapShapeLayer>
       </map:SfMaps.Layer>
    </map:SfMaps>
    SfMaps maps = new SfMaps();
    MapShapeLayer layer = new MapShapeLayer();
    RangeViewModel rangeViewModel = new RangeViewModel();
    this.BindingContext = new RangeViewModel();
    layer.ShapesSource = MapSource.FromUri(new Uri("https://cdn.syncfusion.com/maps/map-data/world-map.json"));
    layer.ShapeFill = Colors.Gray;
    layer.ShapeStroke = Colors.White;
    layer.ShapeStrokeThickness = 2;
    layer.DataSource = rangeViewModel.WorldPopulationDensity;
    layer.ShapeDataField = "name";
    layer.PrimaryValuePath="CountryName";
    layer.ShapeColorValuePath="Density";
    layer.ColorMappings = new ObservableCollection<ColorMapping>()
    {
        new EqualColorMapping
        {
            Color = Color.FromRgb(128, 159, 255),
            Value = "China",
            Text="China"
        },
    };
    maps.Layer = layer;
    this.Content = maps;

    Constructors

    EqualColorMapping()

    Declaration
    public EqualColorMapping()

    Fields

    ValueProperty

    Identifies the Value bindable property.

    Declaration
    public static readonly BindableProperty ValueProperty
    Field Value
    Type Description
    BindableProperty

    The identifier for Value bindable property.

    Properties

    Value

    Gets or sets value for the equal color mapping.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    string

    The value for the equal color mapping. The default is null.

    Examples
    • XAML
    • C#
    <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="CountryName">
    
             <map:MapShapeLayer.ColorMappings>
                 <map:EqualColorMapping Color="#809fff" Value="China" Text="China" />
             </map:MapShapeLayer.ColorMappings>
    
          </map:MapShapeLayer>
       </map:SfMaps.Layer>
    </map:SfMaps>
    SfMaps maps = new SfMaps();
    MapShapeLayer layer = new MapShapeLayer();
    RangeViewModel rangeViewModel = new RangeViewModel();
    this.BindingContext = new RangeViewModel();
    layer.ShapesSource = MapSource.FromUri(new Uri("https://cdn.syncfusion.com/maps/map-data/world-map.json"));
    layer.ShapeFill = Colors.Gray;
    layer.ShapeStroke = Colors.White;
    layer.ShapeStrokeThickness = 2;
    layer.DataSource = rangeViewModel.WorldPopulationDensity;
    layer.ShapeDataField = "name";
    layer.PrimaryValuePath="CountryName";
    layer.ShapeColorValuePath="Density";
    layer.ColorMappings = new ObservableCollection<ColorMapping>()
    {
        new EqualColorMapping
        {
            Color = Color.FromRgb(128, 159, 255),
            Value = "China",
            Text="China"
        },
    };
    maps.Layer = layer;
    this.Content = maps;
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved