As per Sample made in C Sharp for Map suite explorer, I have created ThemeItem and ThemeView Control in vb.net. I think there is something missing in code, so the event on check box change and selection of theme item not fire. Pleas help.
Private Sub SetupThemeItem(ByVal layer As Layer)Dim themeItem As New ThemeItem()
AddHandler themeItem.ThemeItemRightClick, AddressOf themeItem_ThemeItemRightClickEnd Sub
Private Sub themeItem_ItemCheckedChanged(ByVal sender As Object, ByVal e As ShapeEventArgs)If DirectCast(winformsMap1.Overlays(0), LayerOverlay).Layers.Contains(e.ShapeName) Then
I am sorry to say that it is very hard to provide the VB sample for Map Suite Explorer for now as the project is somehow huge, is it possible to provide me your sample to recreate this issue, I reviewed the code above and I did not find any problem with it.
Any more questions please feel free to let me know.
I have attached my sample with ticket no 3370. Please review my code and correct is if any, so that I will able to check / uncheck the layer and selct that layer for movement up/down Regards Sanjay
I have Tab FeatureLayer, it shows data. I have done thematic color or this layer. So, I before implementing thematic color, I want to make copy of FeatureLayer. So the thematic color can apply on copy of FeatureLayer, and original not be disturbed. How to made a clone of FeatureLayer.
I think you didn’t understand properly. I am not trying to copy a feature, although I am trying to copy a TabFileFeatureLayer, which will be treated as different object.
If any thing more you want to clear please let me know.
If you want to keep this copy in memory or session, why not try to save those properties used to construct the feature layer instead, for example, try to keep the pathFileName, idColumnName, featureSchemaName instead of keeping the TabFeatureLayer, and then try to create a new TabFeatureLayer using these properties when needed. What is your opinion?
Any more questions please feel free to let me know.
You mean to say to create a new TabFeatureLayer with different name, whenever required, with help of already loaded tab file. It could be one solution.
Actually where I required a copy of TabFeatureLayer, that is different form. Initially when TabFutureLayer created that process is wriiten on Main form. Also I have to find the file name from a colletion of Tab File. Is the copy facility not availalable in API?
What is cloneDeep? It is working with Layer, but not with FeatureLayer?
You can find the old FdoExtension.dll on your disk, delete it and copy the new FdoExtension.dll to the same folder, or you can change the reference of your application and point to the new FdoExtension.dll.
I have changed the FdoExtentio.dll (4.5.0.144 and 4.5.144.0 both Tested), but I am getting error like
Type 'MapSuiteFdoExtension.GeoFdoFeatureSource' in Assembly 'MapSuiteFdoExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
Actually my proceess of copy like this,
Dim Layer As FeatureLayer = winformsMap1.FindFeatureLayer(drpTable.Text.Trim)
'drpTable.Text contains the name of TabFeatureLayer
dim copiedLayer As TabFileFeatureLayer = TryCast(Layer.CloneDeep(), TabFileFeatureLayer)
its generates error, also I have tried like below but same result
Dim
t As TabFileFeatureLayer = TryCast(Layer, TabFileFeatureLayer)
Dim copiedLayer As TabFileFeatureLayer = t.CloneDeep
Now click on copy button and try to use following code:
Dim
Layer As FeatureLayer = WinformsMap1.FindFeatureLayer("WorldLayer")
Layer.Close()
Dim copiedLayer As TabFileFeatureLayer = TryCast(Layer.CloneDeep(), TabFileFeatureLayer)
We can not careate a new TabFeatureLayer (as you shown) for copy purpose, beacuse TabFeatureLayer is already created. We have to find the FeatureLayer to create copy, I tried with above code. If anything wrong with code please let me know. In other way you can try to make copy with WinForms1.FindFeatureLayer
I tested your code and I can recreate your problem, I think you need to CloneDeep TabFileFeatureLayer before calling TabFileFeatureLayer.Open(), otherwise it will throw exception, the reason is that when you call open method, it will load some unmanaged source which can’t be serialize.