public class mwMapLayer : InMemoryFeatureLayer { private string IdColumnName; private string Longitude; private string Latitude; private string Polygon; private bool ifPolygon = false; public bool ifFeaturesInitialized = true; public mwMapLayer(string idcolumnname, string longitude, string latitude, bool ifpolygon) { IdColumnName = idcolumnname; Longitude = longitude; Latitude = latitude; ifPolygon = ifpolygon; if (ifPolygon) Polygon = longitude; if (!SetupFeatures()) ifFeaturesInitialized = false; } public bool SetupFeatures() { // the wkt is from you errordata.txt string wkt = File.ReadAllText(@"d:\wkt.txt"); Feature feature = new Feature(wkt, IdColumnName); ; feature.ColumnValues.Add("num", "6687"); feature.ColumnValues.Add("name", "Atlantic"); InternalFeatures.Add(feature); return true; } } private void BuildDetailLayer() { //Setup Detail Layer mwMapLayer DetailLayer = new mwMapLayer("name", "location", "", true); if (DetailLayer.ifFeaturesInitialized) { DetailLayer.Open(); DetailLayer.Columns.Add(new FeatureSourceColumn("TotalSelected")); DetailLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; ClassBreakStyle Breaks = new ClassBreakStyle("TotalSelected"); for (int j = 0; j < 5; j++) { AreaStyle aStyle = AreaStyles.Country1; } DetailLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(Breaks); DetailLayer.Close(); LayerOverlay Layer = new LayerOverlay(); Layer.Layers.Add("DetailLayer1", DetailLayer); winformsMap1.Overlays.Add("DetailLayer", Layer); DetailLayer.FeatureSource.Open(); winformsMap1.CurrentExtent = DetailLayer.FeatureSource.GetBoundingBox(); DetailLayer.FeatureSource.Close(); } }