ThinkGeo.com    |     Documentation    |     Premium Support

ClassBreak issue

ClassBreaks don’t seem to work properly for Double.NaN values.
We often use Double.NaN values to represent data that is missing or has other issues and should
stand out from numerical values.

I put in a workaround to convert these values to Double.MinValue for the map, but that is a bit of a kludge. In the following the first call works fine, but the second call will not properly update map styles.

ClassBreak classBreak = new ClassBreak(double.MinValue, AreaStyle.CreateSimpleAreaStyle(new GeoColor(alpha, geoColor), GeoColors.White));

ClassBreak classBreak = new ClassBreak(double.NaN, AreaStyle.CreateSimpleAreaStyle(new GeoColor(alpha, geoColor), GeoColors.White));

Hi Robert,

ClassBreakStyle is supposed to render based on ranges. For example, if we add the following 2 breaks:
double.MinValue - Red
0 - Blue
It will render the features either in Red or Blue depending on the given value is less or greater than 0.

However, it cannot create a valid range if we put Double.NaN in a break, that’s why it doesn’t work. In this case I think you can create a ClassBreakStyle (to define the style for ranges) and a ValueStyle(define the style specific for double.NaN) and add both of the 2 styles to the ZoomLevel.CustomStyles collection. That would work for you.

Thanks,
Ben