# Different style for features in the same zoom level

**URL:** <https://community.thinkgeo.com/t/different-style-for-features-in-the-same-zoom-level/1000>\
**Category:** WinForms\
**Created:** [January 28, 2010, 11:26am UTC](https://community.thinkgeo.com/t/different-style-for-features-in-the-same-zoom-level/1000 "2010-01-28T11:26:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gustavo](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@Gustavo](https://community.thinkgeo.com/u/Gustavo)\
**Post date:** [January 28, 2010, 11:26am UTC](https://community.thinkgeo.com/t/different-style-for-features-in-the-same-zoom-level/1000/1 "2010-01-28T11:26:06Z")

</div>

Hi,&nbsp;

I&nbsp;would&nbsp;like&nbsp;to&nbsp;know&nbsp;if&nbsp;it's&nbsp;possible&nbsp;to&nbsp;configure&nbsp;the&nbsp;drawing&nbsp;style&nbsp;of&nbsp;features&nbsp;(in&nbsp;this&nbsp;case,&nbsp;roads)&nbsp;&nbsp;in&nbsp;the&nbsp;same&nbsp;zoom&nbsp;level&nbsp;in&nbsp;the&nbsp;same&nbsp;shapefile.&nbsp;

For&nbsp;instance,&nbsp;I&nbsp;want&nbsp;the&nbsp;highways&nbsp;to&nbsp;be&nbsp;drawn&nbsp;differently&nbsp;from&nbsp;normal&nbsp;roads,&nbsp;in&nbsp;the&nbsp;same&nbsp;zoom&nbsp;level.&nbsp;

Is&nbsp;there&nbsp;a&nbsp;way&nbsp;to&nbsp;configure&nbsp;the&nbsp;style&nbsp;conditionally,&nbsp;based&nbsp;on&nbsp;the&nbsp;road&nbsp;attibutes?

I&nbsp;also&nbsp;want&nbsp;to&nbsp;control&nbsp;which&nbsp;cities&nbsp;are&nbsp;shown&nbsp;at&nbsp;a&nbsp;certain&nbsp;zoom&nbsp;level.&nbsp;For&nbsp;example,&nbsp;when&nbsp;the&nbsp;map&nbsp;is&nbsp;far&nbsp;away&nbsp;I&nbsp;just&nbsp;want&nbsp;to&nbsp;show&nbsp;the&nbsp;capitals,&nbsp;and&nbsp;when&nbsp;I&nbsp;zoom&nbsp;in&nbsp;I&nbsp;want&nbsp;to&nbsp;show&nbsp;the&nbsp;cities&nbsp;progressevely&nbsp;based&nbsp;on&nbsp;its&nbsp;population&nbsp;or&nbsp;importance.&nbsp;Is&nbsp;it&nbsp;possible&nbsp;to&nbsp;achieve&nbsp;that&nbsp;using&nbsp;just&nbsp;one&nbsp;shapefile?

Thanks

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [January 28, 2010, 5:39pm UTC](https://community.thinkgeo.com/t/different-style-for-features-in-the-same-zoom-level/1000/2 "2010-01-28T17:39:46Z")

</div>

Yes,&nbsp;you&nbsp;can&nbsp;configure&nbsp;the&nbsp;style&nbsp;conditionally,&nbsp;based&nbsp;on&nbsp;the&nbsp;road&nbsp;attributes.&nbsp;You&nbsp;would&nbsp;need&nbsp;the&nbsp;ValueStyle&nbsp;for&nbsp;this.&nbsp;I&nbsp;suggest&nbsp;you&nbsp;check&nbsp;out&nbsp;the&nbsp;sample&nbsp;app&nbsp;“Draw&nbsp;Features&nbsp;Based&nbsp;On&nbsp;Values”&nbsp;of&nbsp;the&nbsp;“How&nbsp;Do&nbsp;I”&nbsp;apps.&nbsp;Also,&nbsp;there&nbsp;a&nbsp;recent&nbsp;project&nbsp;of&nbsp;the&nbsp;Code&nbsp;Community&nbsp;that&nbsp;shows&nbsp;how&nbsp;to&nbsp;use&nbsp;ValueStyle:&nbsp;  
&nbsp;[code.thinkgeo.com/projects/show/valuestylecountries](http://code.thinkgeo.com/projects/show/valuestylecountries)&nbsp;  
&nbsp;&nbsp;  
&nbsp;One&nbsp;project&nbsp;is&nbsp;using&nbsp;point&nbsp;based&nbsp;layer&nbsp;and&nbsp;the&nbsp;other&nbsp;one&nbsp;is&nbsp;using&nbsp;a&nbsp;polygon&nbsp;based&nbsp;layer,&nbsp;but&nbsp;I&nbsp;think&nbsp;that&nbsp;you&nbsp;will&nbsp;get&nbsp;the&nbsp;idea&nbsp;on&nbsp;how&nbsp;to&nbsp;use&nbsp;that&nbsp;style&nbsp;for&nbsp;your&nbsp;case.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;your&nbsp;other&nbsp;question&nbsp;on&nbsp;displaying&nbsp;a&nbsp;layer&nbsp;differently&nbsp;based&nbsp;on&nbsp;the&nbsp;zoom&nbsp;level,&nbsp;the&nbsp;answer&nbsp;is&nbsp;also&nbsp;YES.&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;example,&nbsp;you&nbsp;can&nbsp;have&nbsp;a&nbsp;layer&nbsp;for&nbsp;cities.&nbsp;At&nbsp;the&nbsp;highest&nbsp;zoom&nbsp;level,&nbsp;you&nbsp;use&nbsp;a&nbsp;regular&nbsp;style&nbsp;to&nbsp;display&nbsp;all&nbsp;the&nbsp;feature&nbsp;the&nbsp;same&nbsp;way.&nbsp;At&nbsp;lower&nbsp;zoom&nbsp;levels,&nbsp;you&nbsp;can&nbsp;use&nbsp;a&nbsp;Value&nbsp;Style&nbsp;or&nbsp;a&nbsp;ClassBreakStyle&nbsp;to&nbsp;show&nbsp;differently&nbsp;the&nbsp;feature&nbsp;based&nbsp;on&nbsp;the&nbsp;population.&nbsp;I&nbsp;don’t&nbsp;think&nbsp;we&nbsp;have&nbsp;a&nbsp;specific&nbsp;app&nbsp;in&nbsp;the&nbsp;“How&nbsp;Do&nbsp;I”&nbsp;sample&nbsp;apps&nbsp;or&nbsp;in&nbsp;the&nbsp;Code&nbsp;Community.&nbsp;But&nbsp;I&nbsp;think&nbsp;this&nbsp;will&nbsp;be&nbsp;a&nbsp;good&nbsp;idea&nbsp;to&nbsp;present&nbsp;such&nbsp;a&nbsp;project&nbsp;to&nbsp;the&nbsp;community&nbsp;and&nbsp;we&nbsp;will&nbsp;post&nbsp;one&nbsp;soon.&nbsp;Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;idea.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;You&nbsp;need&nbsp;to&nbsp;look&nbsp;at&nbsp;the&nbsp;ZoomLevelSet&nbsp;property&nbsp;of&nbsp;Layers&nbsp;to&nbsp;adjust&nbsp;the&nbsp;styles&nbsp;based&nbsp;on&nbsp;the&nbsp;zoom&nbsp;levels.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle&nbsp;=&nbsp;AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent,&nbsp;GeoColor.FromArgb(100,&nbsp;GeoColor.SimpleColors.Green));&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel&nbsp;=&nbsp;ApplyUntilZoomLevel.Level20;&nbsp;&nbsp;&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;If&nbsp;this&nbsp;is&nbsp;still&nbsp;not&nbsp;very&nbsp;clear,&nbsp;let&nbsp;us&nbsp;know&nbsp;and&nbsp;we&nbsp;will&nbsp;hurry&nbsp;up&nbsp;to&nbsp;create&nbsp;a&nbsp;new&nbsp;project&nbsp;on&nbsp;that&nbsp;topic&nbsp;for&nbsp;the&nbsp;Code&nbsp;Community.&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;
