ThinkGeo.com    |     Documentation    |     Premium Support

Error assigning custom class to MapView.EditOverlay

We are using ThinkGeo UI Winforms14.3.2. The following line of code produces an exception:

MainMap.EditOverlay = New CustomEditOverlay(MainMap)

System.Collections.Generic.KeyNotFoundException
HResult=0x80131577
Message=The given key was not present in the dictionary.
Source=mscorlib
StackTrace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at ThinkGeo.UI.WinForms.MapViewBase.set_EditOverlay(EditInteractiveOverlay value)
at ThinkGeo.UI.WinForms.MapView.set_EditOverlay(EditInteractiveOverlay value)
at ThinkGeo_14_Demo.Form1.VB$StateMachine_25_Form1_Load.MoveNext() in C:\Users\steller\source\repos\ThinkGeo_14_Demo\Form1.vb:line 40

This exception does not happen in 14.3.1.

I have attached a sample project.

Thanks!

ThinkGeo_14_Demo.zip (795.6 KB)

Steve

hi @Steven1,

We’ve already fixed this issue in beta builds.

In 14.3.2, you could use the following code to bypass the exception.

    If MainMap.EditOverlay IsNot Nothing Then
        MainMap.EditOverlay = New CustomEditOverlay(MainMap)
    End If

Regards,
Leo