ThinkGeo.com    |     Documentation    |     Premium Support

Point colours

We have several layers of points and lines, where we need to alter the colours and symbols for the shapes independently, is this easily possible? ..  i.e. rather than having all the points in a layer, say, red triangles .. we would have a unique colour and shape for each point.


Do we implement a custom layer for this (any starting point code?) or is there some shortcut?


regards,


Gordon



Hi, 
  
 if you can pickup the color/symbol information from a feature column, you can use a ValueStyle to display each feature as you like. 
  
 ValueStyle valueStyle = new ValueStyle(); 
 valueStyle.ColumnName = STR_IsPhoto; 
 valueStyle.ValueItems.Add(new ValueItem("1", new PointStyle( … 
  
 if you cannot pickup it from a column, then you can simulate a virtual column: 
 FeatureSource.CustomColumnFetch += FeatureSource_CustomColumnFetch_Photo; 
  
 Of course, you can implement a custom draw … but it looks to be much more complex than what you really need. 
  
 Hope this helps, 
 Patrick.


 Ah yes, that will work fine… Thanks Patrick

Gordon & Patrick, 
  
 Thanks for your posts! 
  
 I think the answer is exactly what Patrick described! 
  
 Besides, there are other kinds of special Styles( Like ClassBreakStyle, QualityFamilyAreaStyle, HueFamilyAreaStyle, GradientStyle, DotDensityStyle,IconValueStyle, RegexStyle) etc , you can choose to use them depends on different scenarios. 
  
 Any more questions just let me know. 
  
 Thanks. 
  
 Yale 


Well, 
  
 I understand more or less every styles you just mentionned; however, QualityFamilyAreaStyle & HueFamilyAreaStyle are not clear for me. 
 I checked the documentation and it did not clarify. 
  
 Can you explain what are they? 
  
 Patrick.

Patrick, 
  
 Thanks for your posts and questions! 
  
 First you can take a look the effects using the QualityFamilyAreaStyle & HueFamilyAreaStyle by looking at the HowDoI samples 
  
 CS Winforms HowDoISamples\Styles UseQualityFamilyAreaStyle 
 CS Winforms HowDoISamples\Styles UseHueFamilyAreaStyle 
  
 QualityFamilyAreaStyle is expected to use a whole bunch of QualityFamilyColor to render a Area type features. For example, I have 5 quality family colors to render 251 features, then  
 Feature1----using QualityFamilyColor one 
 Feature2----using QualityFamilyColor two 
 Feature3----using QualityFamilyColor three 
 Feature4----using QualityFamilyColor four 
 Feature5----using QualityFamilyColor five 
  
 Feature6----using QualityFamilyColor one 
 Etc in turn. 
  
 The same rule can apply to HueFamilyAreaStyle, only difference is this is to get a HueFamily colors instead of Quality Family ones by giving a base color. 
  
 Let me know if I am not clear enough! 
  
 Any more questions just let me know. 
  
 Thanks. 
  
 Yale