ThinkGeo.com    |     Documentation    |     Premium Support

Create polygon with just outline, no fill

Seems like a simple problem but I’m having trouble figuring out the solution to this. I want to create a polygon/areastyle where just the outline is shown, but the fill should be clear. So basically it would look like if I was just creating connected lines.

Edit: Here’s the constructor I’m currently using for making area styles:

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, GeoColor outlinePenColor, int outlinePenWidth);

I thought I just had to set the fillBrushColor to GeoColor.StandardColors.Transparent, but that made the outline dissapear as well.

Hi Dan,

This code should works for you.

        AreaStyle areaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.Transparent, GeoColor.StandardColors.Black);
        shapeFileLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = areaStyle;
        shapeFileLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

Regards,

Ethan

I’m dumb. The reason it wasn’t showing up is because I had the “name” being used in my columnvalues for this custom area style spelled wrong. Thanks again!

Hi Dan,

I am glad to hear this problem solved.

Any question please let us know.

Regards,

Ethan