Does anyone have any suggestions on how to fix this? I’m using the DynamicIsoLineLayer, set to use ClosedLinesAsPolygons. At various zoom levels, the entire layer won’t draw. The two screen shots I’ve included show what I’m experiencing. The code attached is what actually creates the layer. Any suggestions would be welcome.
private
DynamicIsoLineLayer GetGridIsoLineLayer()
{
DynamicIsoLineLayer isoLineLayer =
null
;
try
{
//Create a grid cell matrix based on the textboxes and the current extent
//CreateGridCellMatrix();
//Load the grid we just created into the GridIsoLineLayer using the number of breaks defines
//on the screen
Collection<
double
> isoLineLevels = GridIsoLineLayer.GetIsoLineLevels(
this
._isolinePointData,
this
._isolineLineBreaks);
for
(
int
i = 0; i < isoLineLevels.Count; i++)
{
isoLineLevels = Math.Round(isoLineLevels, 2);
}
isoLineLayer =
new
DynamicIsoLineLayer(
this
._isolinePointData, isoLineLevels,
new
InverseDistanceWeightedGridInterpolationModel(2,
double
.MaxValue), IsoLineType.ClosedLinesAsPolygons);
// determine the grid size for the current extent
isoLineLayer.CellHeightInPixel = (
int
)
this
.map.ActualHeight /
this
._isolineCellRows;
isoLineLayer.CellWidthInPixel = (
int
)
this
.map.ActualWidth /
this
._isolineCellColumns;
//Create a series of colors from blue to red that we will use for the breaks
Collection<geocolor> colors = GeoColor.GetColorsInQualityFamily(GeoColor.StandardColors.Blue, GeoColor.StandardColors.Red, isoLineLevels.Count, ColorWheelDirection.Clockwise);
//Setup a class break style based on the isoline levels and the colors
ClassBreakStyle classBreakStyle =
new
ClassBreakStyle(isoLineLayer.DataValueColumnName);
Collection
<thinkgeo.mapsuite.core.style> firstStyles =new
Collection
<thinkgeo.mapsuite.core.style>();
firstStyles.Add(
new
LineStyle(
new
GeoPen(colors[0], 3)));
firstStyles.Add(
new
AreaStyle(
new
GeoPen(GeoColor.SimpleColors.LightBlue, 3),
new
GeoSolidBrush(
new
GeoColor(150, colors[0]))));
classBreakStyle.ClassBreaks.Add(
new
ClassBreak(
double
.MinValue, firstStyles));
for
(
int
i = 0; i < colors.Count - 1; i++)
{
Collection
<thinkgeo.mapsuite.core.style> styles =new
Collection
<thinkgeo.mapsuite.core.style>();
styles.Add(
new
LineStyle(
new
GeoPen(colors[i + 1], 3)));
styles.Add(
new
AreaStyle(
new
GeoPen(GeoColor.SimpleColors.LightBlue, 3),
new
GeoSolidBrush(
new
GeoColor(150, colors[i + 1]))));
classBreakStyle.ClassBreaks.Add(
new
ClassBreak(isoLineLevels, styles));
}
isoLineLayer.CustomStyles.Add(classBreakStyle);
//Create the text styles to label the lines
TextStyle textStyle = TextStyles.CreateSimpleTextStyle(isoLineLayer.DataValueColumnName,
“Arial”
, 8, DrawingFontStyles.Bold, GeoColor.StandardColors.Black, 0, 0);
textStyle.HaloPen =
new
GeoPen(GeoColor.StandardColors.White, 2);
textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping;
textStyle.SplineType = SplineType.StandardSplining;
textStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;
textStyle.TextLineSegmentRatio = 9999999;
textStyle.FittingLineInScreen =
true
;
textStyle.SuppressPartialLabels =
true
;
isoLineLayer.CustomStyles.Add(textStyle);
}
catch
(Exception ex)
{
this
.LogException(ex,
“An exception occurred while getting the grid isoline layer.”
);
}
return
isoLineLayer;
}