Sanjay,
I reproduced your problem properly and I'm looking for a solution for you,currently can you use the InMemoryFeatureLayer to instead of the TabFileFeatureLayer temporarily, because about the Tab file support we used the third part maybe there are several issues. Our team is working on the tab file support ourselves and we will not be dependented on the third part. This ability will going to the May public release, please just wait several days and I think we can have a good support for tab file then.
Here is the work around for using InMemoryFeatureLayer to instead of the TabFileFeatureLayer below:
Dim version As String = WinformsMap.GetVersion
System.Windows.Forms.Cursor.Current = Cursors.WaitCursor
Dim worldLayer As New TabFileFeatureLayer("C:\Users\user\Desktop\ThinkGeo\Ticket3370\MapSuiteFeatures\MapSuiteFeatures\MapSuitFeatures\MapSuitFeatures\vector.TAB", Nothing)
'Dim worldLayer As New CustomFeatureLayer("C:\Users\user\Desktop\ThinkGeo\Ticket3370\MapSuiteFeatures\MapSuiteFeatures\MapSuitFeatures\MapSuitFeatures\vector.TAB")
'worldLayer.Open()
''Dim strings As Collection(Of String) = New Collection(Of String)
''strings.Add("Vector_Class")
'worldLayer.FeatureSource.GetFeaturesInsideBoundingBox(New RectangleShape(71.4341527265625, 34.2687417226563, 86.7337132734375, 23.8877602773438), ReturningColumnsType.AllColumns)
worldLayer.Open()
Dim features As Collection(Of Feature) = worldLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns)
'worldLayer.Close()
Dim inMemoryFeatureLayer As InMemoryFeatureLayer = New InMemoryFeatureLayer()
inMemoryFeatureLayer.Open()
inMemoryFeatureLayer.Columns.Add(New FeatureSourceColumn("Vector_Class"))
For Each Feature In features
inMemoryFeatureLayer.InternalFeatures.Add(Feature)
Next
inMemoryFeatureLayer.Close()
Dim customLineStyle As Style = New LineStyle(New GeoPen(GeoColor.SimpleColors.Black, 1))
Dim customAreaStyle As Style = New AreaStyle(New GeoSolidBrush(GeoColor.FromArgb(100, GeoColor.SimpleColors.Green)))
Dim customPointStyle As Style = New PointStyle(PointSymbolType.Star, New GeoSolidBrush(GeoColor.SimpleColors.LightGreen), 10)
Dim customTextStyle As Style = New TextStyle
' Draw a feature based on a value
Dim valueStyle As New ValueStyle()
valueStyle.ColumnName = "Vector_Class"
valueStyle.ValueItems.Add(New ValueItem("primary_roads", LineStyles.MajorRoad1))
valueStyle.ValueItems.Add(New ValueItem("secondary_roads", LineStyles.SecondaryRoad1))
valueStyle.ValueItems.Add(New ValueItem("water", AreaStyles.Water1))
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customAreaStyle)
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customPointStyle)
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customLineStyle)
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customTextStyle)
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle)
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
inMemoryFeatureLayer.Open()
WinformsMap1.CurrentExtent = inMemoryFeatureLayer.GetBoundingBox()
inMemoryFeatureLayer.Close()
Dim overlay As New LayerOverlay()
overlay.Layers.Add(inMemoryFeatureLayer)
WinformsMap1.Overlays.Add(overlay)
WinformsMap1.Refresh()
The code above is used to the Load function in your application, also you have to change the code for the other functionalities in your application for InMemoryFeatureLayer.
Thanks,
Scott,