RangeColorMapping is not working properly

Hi,

I have the following issue with the Maps Control for WindowsForms  - v19.2460.0.47 - , we specify the following color ranges. 

With shapeLayer.ShapeSetting.FillSetting.ColorMappings            

.Add(New RangeColorMapping() With                    {                        
.Color = System.Drawing.Color.Red,                        
.From = 100,                        
.[To] = 500                    }                 )            
.Add(New RangeColorMapping() With                    {                        
.Color = System.Drawing.Color.Green,                       
.From = 75,                        
.[To] = 100                    }                 )            
.Add(New RangeColorMapping() With                {                        
.Color = System.Drawing.Color.CornflowerBlue,                        
.From = 50,                        
.[To] = 75                })            
.Add(New RangeColorMapping() With                {                        
.Color = System.Drawing.Color.LightSalmon,                        
.From = 25,                        
.[To] = 50                })            
.Add(New RangeColorMapping() With                 {                    
.Color = System.Drawing.Color.Yellow,                    
.From = 0,                    
.[To] = 25                 })            
.Add(New RangeColorMapping() With                 {                    
.Color = System.Drawing.Color.Transparent,                    
.From = 0,                    
.[To] = 0                 })


However, when the Maps control is displayed, it doesn't respect the exact colors - some items looks with another color tonality - and also the ranges are wrong as you can see in the attached image.

Is there another property that we need to set in order to get the exact color applied in the right range? 

Could you please help us with this issue? We need to deliver the solution to our customer :( 


Thanks in advance.

Octavio



Attachment: MapsRangeColors_a0dfb21a.zip

1 Reply

SS Sridevi Sivakumar Syncfusion Team July 22, 2021 03:48 PM UTC

Hi david aimar,

Greetings from Syncfusion.

We have analysed your shared code snippet and image, In Maps current behavior is, exact color is applied to the shape when  RangeColorMapping `To​` value is equal to the Item ColorValuePath Value or else desaturation color will be applied to the shape.


For example, RangeColorMapping  `To​` value is 20 and ColorValuePath value is less than 20, then orange color is not applied to the shape. Desaturated color is applied to the shape.
 
Forms.cs

 shapeLayer.ShapeSetting.ShapeValuePath = "Population";
shapeLayer.ShapeSetting.ShapeColorValuePath = "Population";
shapeLayer.ShapeSetting.FillSetting.ColorMappings.Add(new RangeColorMapping { From = 0, To = 20, Color = Color.Orange });

ViewModel.cs
   countries.Add(new Country() { NAME = "India", Population = 12 });
 

Screenshot:

Let us know if you need any further assistance.

Regards,
Sridevi S.
 


Loader.
Up arrow icon