ThinkGeo.com    |     Documentation    |     Premium Support

Custom value styles not working

I’m getting an error thrown in Thinkgeo.Mapsuite.Wpf.dll when trying to use custom value styles for InMemoryFeatureLayers.

I provide a small sample project at this link: https://www.dropbox.com/s/dn7gdgygyotx5z0/WpfApp3.zip?dl=0

The error I’m getting is:
System.ArgumentNullException: ‘Value cannot be null.
Parameter name: key’

To test the sample project, simply click “click me” button at the top of the window. Following the code, you’ll see it defines a FontStyleModel class, which holds a TextStyle. I add this to a ValueStyle, and have an InMemoryFeatureLayer using that ValueStyle. However, it throws the above error. I tried the same code using a WinForms map too and got the same error. Am I missing something?

Thanks!

Hi Dan,

It looks I cannot download dropbox succeed, it’s so slow and always shows failed, you can try to use Google Drive the next time.

And your problem is you hadn’t set the text column in your text style like this:

That’s why it throw exception.

Regards,

Ethan

Ah thank you! It works perfect now :slight_smile:

Hi Dan,

I am glad to hear it is solved.

Regards,

Ethan