I’m having trouble getting features colored properly using ValueStyles. I’ve looked through the samples and don’t see where I’ve made a mistake. Hopefully someone here can point it out. The behavior I’m seeing is that the ColumnName on the ValueStyle never seems to match with the Column on the Feature. I have verified the the column values do exist and contain matching data. They should match. The colors will change if I don’t set ColumnName on ValueStyle the first color is chosen and it does display. It just won’t match anything named. Any ideas?
Thanks,
Robert
Here’s the code.
'This populates the ValueStyledim oCVs as ValueStyle =NothingoCVs =NewValueStyleoCVs.ColumnName ="CROP_NAME"ForEachoCPIngCropsColloColor = System.Drawing.ColorTranslator.FromWin32(CInt(oCP.Color))oCVs.ValueItems.Add(NewValueItem(oCP.Name, AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(oColor.A, oColor.R, oColor.G, oColor.B), GeoColor.StandardColors.Black)))NextoLay.ZoomLevelSet.ZoomLevel17.CustomStyles.Add(oCVs)
'This traverses the features and sets the CROP_NAME valueForEachfeatCZInoLay.InternalFeaturesoCZ = collCZs.Item(featCZ.Tag)'get the object associated with the feature to find color codefeatCZ.ColumnValues.Add(“CROP_NAME”, oCZ.CropCode)Next