Hi Guys,
I am attempting to load a TAB file but I am getting the following exception:
"Open failed, the reason is these tab files are not supported by Mitab."
Here is my code:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Map1.MapUnit = GeographyUnit.Meter;
string version = Map.Version.ToString();
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
WorldMapKitWmsWebOverlay worldMapKitOverlay = new WorldMapKitWmsWebOverlay();
TabFeatureLayer worldLayer = new TabFeatureLayer(MapPath(@"~/MapData/Boundary.TAB"));
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(100, GeoColor.SimpleColors.Green), GeoColor.SimpleColors.Green);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.Open();
Map1.CurrentExtent = worldLayer.GetBoundingBox();
worldLayer.Close();
LayerOverlay staticOverlay = new LayerOverlay("StaticOverlay");
staticOverlay.IsBaseOverlay = false;
staticOverlay.Layers.Add(worldLayer);
Map1.CustomOverlays.Add(staticOverlay);
}
}