# PointStyles based on data

**URL:** <https://community.thinkgeo.com/t/pointstyles-based-on-data/9836>\
**Category:** WPF\
**Created:** [June 25, 2020, 1:20pm UTC](https://community.thinkgeo.com/t/pointstyles-based-on-data/9836 "2020-06-25T13:20:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_Douglas](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@Aaron\_Douglas](https://community.thinkgeo.com/u/Aaron_Douglas)\
**Post date:** [June 25, 2020, 1:20pm UTC](https://community.thinkgeo.com/t/pointstyles-based-on-data/9836/1 "2020-06-25T13:20:34Z")

</div>

Hello all,

I’m wondering if there’s a way to style points based on metadata.

For example, I have a map that is plotting data points. The data has an associated “state” value for each point (at least in our data set). Is there a simple way to say, for example, if state is 1, the color is red. If state is 2, the color is blue and the symbol type is cross.

I can see doing this with multiple layers, and each state would have its own layer, but is it possible to do it all in one layer?

Thanks in advance,

Aaron

---

<div class="post-metadata">

**Author:** ![Frank4](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/frank4/32/25224_2.png) [@Frank4](https://community.thinkgeo.com/u/Frank4)\
**Post date:** [June 25, 2020, 4:26pm UTC](https://community.thinkgeo.com/t/pointstyles-based-on-data/9836/2 "2020-06-25T16:26:25Z")

</div>

Thanks Aaron,  
Yes. You could use ClassBreakStyle. You can find the sample in our how do I sample

> **[samples/wpf/HowDoISample · master · ThinkGeo / Public / Desktop Maps · GitLab](https://gitlab.com/thinkgeo/public/thinkgeo-desktop-maps/-/tree/master/samples/wpf/HowDoISample)**
>
> .NET controls for building interactive maps with professional-grade GIS controls for the Windows desktop using WPF or WinForms. Sponsor: https://thinkgeo.com

I attached you the main file.  
[LoadClusterPointStyle.xaml](https://community.thinkgeo.com/uploads/short-url/fR9EHm95s1rjDuAEeEtMy7zfuUL.xaml) (422 Bytes) [LoadClusterPointStyle.xaml.cs](https://community.thinkgeo.com/uploads/short-url/8YO2TVWGoCVsUQmdI3KaYwYjG1g.cs) (4.7 KB)

You can also use the ValueStyle  
[FourColorMap.xaml.cs](https://community.thinkgeo.com/uploads/short-url/jW42HWIT3zxDb76TAQQxR3NemU7.cs) (3.4 KB) [FourColorMap.xaml](https://community.thinkgeo.com/uploads/short-url/6yImMqNkkD1dBSuP73xBdlsuXjd.xaml) (1.3 KB)

fourColorLayer = new InMemoryFeatureLayer();  
ValueStyle valueStyle = new ValueStyle { ColumnName = “Color” };  
valueStyle.ValueItems.Add(new ValueItem(“1”, AreaStyle.CreateSimpleAreaStyle(GeoColors.LightGreen)));  
valueStyle.ValueItems.Add(new ValueItem(“2”, AreaStyle.CreateSimpleAreaStyle(GeoColors.LightSkyBlue)));  
valueStyle.ValueItems.Add(new ValueItem(“3”, AreaStyle.CreateSimpleAreaStyle(GeoColors.Yellow)));  
valueStyle.ValueItems.Add(new ValueItem(“4”, AreaStyle.CreateSimpleAreaStyle(GeoColors.LightPink)));  
fourColorLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(valueStyle);  
fourColorLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;  
layerOverlay.Layers.Add(fourColorLayer);

Thanks

Frank

---

<div class="post-metadata">

**Author:** ![Aaron\_Douglas](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@Aaron\_Douglas](https://community.thinkgeo.com/u/Aaron_Douglas)\
**Post date:** [June 25, 2020, 4:41pm UTC](https://community.thinkgeo.com/t/pointstyles-based-on-data/9836/3 "2020-06-25T16:41:06Z")

</div>

Thanks Frank.  
I had actually just been looking at the Four Color map example.

I’ll take a look at the LoadClusterPoint example as well.

---

<div class="post-metadata">

**Author:** ![Aaron\_Douglas](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@Aaron\_Douglas](https://community.thinkgeo.com/u/Aaron_Douglas)\
**Post date:** [June 25, 2020, 5:06pm UTC](https://community.thinkgeo.com/t/pointstyles-based-on-data/9836/4 "2020-06-25T17:06:51Z")

</div>

Hey Frank,

using the ValueStyle, is it possible to specify more than one column name?

---

<div class="post-metadata">

**Author:** ![Frank4](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/frank4/32/25224_2.png) [@Frank4](https://community.thinkgeo.com/u/Frank4)\
**Post date:** [June 25, 2020, 7:12pm UTC](https://community.thinkgeo.com/t/pointstyles-based-on-data/9836/5 "2020-06-25T19:12:02Z")

</div>

Thanks Aaron,  
Yes. We do support that. You can take a look this one.

> [@Valuestyle with different columns](https://community.thinkgeo.com/t/valuestyle-with-different-columns/8132):
>
> I wonder if it´s possible to use the valuestyle with different columns, I mean to use the field1 and field2 assigning a different style for that combination of values. You have some example? Thanks in advance.

Thanks

Frank

---

<div class="post-metadata">

**Author:** ![Aaron\_Douglas](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@Aaron\_Douglas](https://community.thinkgeo.com/u/Aaron_Douglas)\
**Post date:** [July 2, 2020, 8:16pm UTC](https://community.thinkgeo.com/t/pointstyles-based-on-data/9836/6 "2020-07-02T20:16:01Z")

</div>

Thanks Frank. I’ll take a look.
