Hello Community & Support Team,
I am completely new to GIS issues and am currently trying to load and display sample .TAB files. I do this according to the code you provided at the “How do I”-samples. While the sample .TAB file you provided with the code (HoustonMuniBdySamp_Boundary.TAB) loads and displays just fine, loading and displaying a different TAB file results in a white window (no error message). I guess it’s just something wrong with my settings, or projection, style or data format, but I don’t get it.
Although it’s almost the same as your sample code, here is my code:
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.ThreadingMode = MapThreadingMode.SingleThreaded;
WorldMapKitWmsDesktopOverlay worldMapKitDesktopOverlay =
new
WorldMapKitWmsDesktopOverlay();
winformsMap1.Overlays.Add(worldMapKitDesktopOverlay);
winformsMap1.CurrentExtent =
new
RectangleShape(-96.51477, 30.759543, -94.355788, 28.910652);
winformsMap1.BackgroundOverlay.BackgroundBrush =
new
GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
TabFeatureLayer.BuildIndexFile(@
“Sample.TAB”
);
TabFeatureLayer worldLayer =
new
TabFeatureLayer(@
“Sample.TAB”
);
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(100, GeoColor.SimpleColors.Green), GeoColor.SimpleColors.Green);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay staticOverlay =
new
LayerOverlay();
staticOverlay.Layers.Add(
“WorldLayer”
, worldLayer);
winformsMap1.Overlays.Add(staticOverlay);
winformsMap1.Refresh();
I know that the AreaStyle section is superfluous, but I just tried the easiest way.
When I ogr2ogr my .TAB-File into a .shp-File, the MapSuite Explorer is able to display the .shp Files after building an index file automatically, but displaying this .shp file in my own WinForm using a ShapeFileFeatureLayer also results in a white window.
Any hint or help is appreciated.
Thanks in advance!