This project has moved and is read-only. For the latest updates, please go here.

How to get Styles within a Theme

Topics: SharpMap Project, Web Controls, WinForms Controls
Oct 17, 2012 at 8:30 AM
Edited Oct 17, 2012 at 8:31 AM

I am trying to make a simple style editor for editing theming of vectorlayers, the issue I face is that once a theme has been set for a layer, there is no easy way to find the style(s) that have made the theme.

The only way I see is to keep a separate registry of layer, theme and style, if any one can suggest a better option (basically one that will prevent duplication of style data) it would be really great.

Jan 7, 2013 at 5:09 AM
Edited Jan 7, 2013 at 5:10 AM

Well coming back to this topic one solution will be to use an interface and apply it to the themes being used like so:

    interface IHaveStyleMap
        Dictionary<string, IStyle> StyleMap { get; }

Then we can implement it in the Theme concrete classes like for eg in the UniqueValuesTheme


public Dictionary<string, IStyle> StyleMap
            get { return _styleMap; }


The benefit of this is that the existing implementations will not be broken, and the interface will provide us with an easy way to support legend, theme editor etc. I may be on a wrong path here please correct me if I am wrong.