I must be missing something simple. I have created a series of vertices to build a polygon. If i create a LineShape from them and add them to my layer, everything works perfectly:
linePoints.Add(new Vertex(minXminY));
linePoints.Add(new Vertex(maxXminY));
linePoints.Add(new Vertex(maxXmaxY));
linePoints.Add(new Vertex(minXmaxY));
linePoints.Add(new Vertex(minXminY));
line = new LineShape(linePoints);
newPolyLayer.FeatureSource.AddFeature(line);
Now, if i load that line into a PolygonShape and do the same process to add it to the layer, nothing shows up on my map. Do i need to do something differently when working with a PolygonShape vs a LineShape??
PolygonShape pathPart = new PolygonShape(line.GetWellKnownText().Replace("LINESTRING", "POLYGON(") + ")");
newPolyLayer.FeatureSource.AddFeature(pathPart);
Here's an example of the WKT:
POLYGON((-96.5510170619308 45.192079,-96.5510949380692 45.192079,-96.5510949380692 45.1921065365298,-96.5510170619308 45.1921065365298,-96.5510170619308 45.192079))
In both instances, the FeatureSource has the transaction open, and the layer is open.
Also in both cases I set the defaultLineStyle and add the layer to the overlay, then refresh the map
newPolyLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.SimpleColors.Black, 1, true);
labelOverlay.Layers.Add("myLayer", newPolyLayer);
map.Refresh();