This project has moved. For the latest updates, please go here.

Can different styles be applied based on feature set

Topics: SharpMap v0.9 / v1.x, Web Controls
Jul 30, 2011 at 10:11 AM

I have a group layer with 3 sub-layers.Each sublayer is displayed one at a time. User selects different polygons. I save the user selected polygons in a SQL database - one table. I also save which sublayer the polygons were selected from

Can I display the items from the SQL database - single table with different style attributes for different polygons.

i.e say Polygon1 & 2 were originally saved from Sublayer1, Polygon3 from sublayer2. Can I display Polygon1 & 2 in Red outline & Polygon3 in Green outline?

i.e select different style attribute based on featue set?

Aug 2, 2011 at 6:59 PM

I'm not sure if I understand what you are trying to achieve, but you can apply a CustomTheme to your layer based on attribute data.

To do that you need to come up with some Method that matches CustomTheme's

IStyle GetStyleMethod(FeatureDataRow row)

delegate function. In ShapeFileSampleOsm.cs of the WinFormSamples project makes heavy use of this approach. So does GradientThemeSample.cs

Hth FObermaier