# Problem adding features

**URL:** <https://community.thinkgeo.com/t/problem-adding-features/1327>\
**Category:** WinForms\
**Created:** [July 2, 2010, 8:51am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327 "2010-07-02T08:51:31Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 2, 2010, 8:51am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/1 "2010-07-02T08:51:31Z")

</div>

I&nbsp;am&nbsp;trying&nbsp;to&nbsp;add&nbsp;some&nbsp;features&nbsp;on&nbsp;my&nbsp;map.

I&nbsp;do&nbsp;the&nbsp;following&nbsp;on&nbsp;form&nbsp;load

&nbsp;

Map1.MapUnit&nbsp;=&nbsp;GeographyUnit.DecimalDegree  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.BackgroundOverlay.BackgroundBrush&nbsp;=&nbsp;New&nbsp;GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;baseLayer&nbsp;As&nbsp;New&nbsp;ShapeFileFeatureLayer(mapPath)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;baseLayer.RequireIndex&nbsp;=&nbsp;False  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;baseLayer.zoomlevelset.zoomlevel01.DefaultAreaStyle&nbsp;=&nbsp;AreaStyles.Country1  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;baseLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel&nbsp;=&nbsp;ApplyUntilZoomLevel.Level20  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;layerOverlay&nbsp;As&nbsp;New&nbsp;LayerOverlay()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layerOverlay.Layers.Add(baseLayer)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.Overlays.Add(layerOverlay)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.CurrentExtent&nbsp;=&nbsp;New&nbsp;RectangleShape(22.835,&nbsp;41.2921,&nbsp;25.8892,&nbsp;40.4029)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;pointLayer&nbsp;As&nbsp;New&nbsp;InMemoryFeatureLayer()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType&nbsp;=&nbsp;PointType.Symbol  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolType&nbsp;=&nbsp;PointSymbolType.Circle  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel&nbsp;=&nbsp;ApplyUntilZoomLevel.Level20  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;dynamicOverlay&nbsp;As&nbsp;New&nbsp;LayerOverlay()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dynamicOverlay.Layers.Add("PointLayer",&nbsp;pointLayer)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.Overlays.Add("PointOverlay",&nbsp;dynamicOverlay)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Map1.Refresh()

&nbsp;

and&nbsp;at&nbsp;some&nbsp;point&nbsp;i&nbsp;try&nbsp;to&nbsp;draw&nbsp;some&nbsp;icons

&nbsp;Public&nbsp;Sub&nbsp;drawOnMap()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;Each&nbsp;u&nbsp;As&nbsp;User&nbsp;In&nbsp;Me.list.Values  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;u.lastPosition.x&nbsp;\<\>&nbsp;Nothing&nbsp;And&nbsp;u.lastPosition.y&nbsp;\<\>&nbsp;Nothing&nbsp;Then  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;latitude&nbsp;As&nbsp;Double&nbsp;=&nbsp;Convert.ToDouble(u.lastPosition.y,&nbsp;CultureInfo.InvariantCulture)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;longitude&nbsp;As&nbsp;Double&nbsp;=&nbsp;Convert.ToDouble(u.lastPosition.x,&nbsp;CultureInfo.InvariantCulture)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;feature&nbsp;As&nbsp;New&nbsp;Feature(longitude,&nbsp;latitude,&nbsp;"user"&nbsp;&&nbsp;u.userId)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;pointLayer&nbsp;As&nbsp;InMemoryFeatureLayer&nbsp;=&nbsp;DirectCast(Form1.Map1.FindFeatureLayer("PointLayer"),&nbsp;InMemoryFeatureLayer)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;Not&nbsp;pointLayer.InternalFeatures.Contains("user"&nbsp;&&nbsp;u.userId)&nbsp;Then  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointLayer.InternalFeatures.Add("user"&nbsp;&&nbsp;u.userId,&nbsp;feature)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;If  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Next  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Form1.Map1.Refresh(Form1.Map1.Overlays("PointOverlay"))  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;Sub

&nbsp;

Via&nbsp;the&nbsp;debug&nbsp;i&nbsp;can&nbsp;confirm&nbsp;that&nbsp;u.lastPosition.x&nbsp;and&nbsp;.y&nbsp;are&nbsp;valid&nbsp;decimal&nbsp;values&nbsp;and&nbsp;withing&nbsp;the&nbsp;map

However&nbsp;i&nbsp;do&nbsp;not&nbsp;see&nbsp;the&nbsp;circle&nbsp;symbols&nbsp;as&nbsp;i&nbsp;defined&nbsp;it&nbsp;to.

Can&nbsp;you&nbsp;please&nbsp;help&nbsp;me&nbsp;as&nbsp;i&nbsp;am&nbsp;new&nbsp;to&nbsp;this?

&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [July 5, 2010, 1:38am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/2 "2010-07-05T01:38:30Z")

</div>

Ioustinos,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;I&nbsp;think&nbsp;you&nbsp;will&nbsp;be&nbsp;familiar&nbsp;with&nbsp;our&nbsp;MapSuite,&nbsp;everyone&nbsp;is&nbsp;from&nbsp;beginner&nbsp;to&nbsp;expert.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Your&nbsp;problem&nbsp;is&nbsp;caused&nbsp;that&nbsp;you&nbsp;didn’t&nbsp;set&nbsp;the&nbsp;correct&nbsp;PointStyle,&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;show&nbsp;point,&nbsp;not&nbsp;just&nbsp;set&nbsp;point&nbsp;type&nbsp;and&nbsp;symbol&nbsp;type,&nbsp;you&nbsp;also&nbsp;need&nbsp;to&nbsp;set&nbsp;the&nbsp;color&nbsp;of&nbsp;brush,&nbsp;otherwise&nbsp;MapSuiteCore&nbsp;doesn’t&nbsp;know&nbsp;which&nbsp;color&nbsp;you&nbsp;want&nbsp;to&nbsp;draw&nbsp;point,&nbsp;so&nbsp;just&nbsp;add&nbsp;the&nbsp;following&nbsp;code&nbsp;you&nbsp;can&nbsp;see&nbsp;the&nbsp;red&nbsp;points&nbsp;after&nbsp;you&nbsp;call&nbsp;drawOnMap.&nbsp;  
&nbsp;pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.SymbolSolidBrush.Color&nbsp;=&nbsp;GeoColor.SimpleColors.Red&nbsp;  
&nbsp;&nbsp;  
&nbsp;Please&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;more&nbsp;questions.&nbsp;  
&nbsp;Thanks&nbsp;  
&nbsp;James

---

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 5, 2010, 5:39am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/3 "2010-07-05T05:39:50Z")

</div>

I&nbsp;tried&nbsp;what&nbsp;you&nbsp;said&nbsp;but&nbsp;nothing&nbsp;happened.&nbsp;  
&nbsp;Moreover&nbsp;i&nbsp;tried&nbsp;to&nbsp;insert&nbsp;an&nbsp;image&nbsp;instead&nbsp;of&nbsp;a&nbsp;symbol.&nbsp;  
&nbsp;&nbsp;  
&nbsp;pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.PointType&nbsp;=&nbsp;PointType.Bitmap&nbsp;  
&nbsp;pointLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle.Image&nbsp;=&nbsp;New&nbsp;GeoImage("C:\MapData\icons\user.jpeg")&nbsp;  
&nbsp;&nbsp;  
&nbsp;Still&nbsp;nothing.&nbsp;  
&nbsp;Is&nbsp;there&nbsp;any&nbsp;chance&nbsp;there&nbsp;is&nbsp;a&nbsp;problme&nbsp;with&nbsp;the&nbsp;coordinates&nbsp;translation?&nbsp;The&nbsp;geographical&nbsp;coordinates&nbsp;system?&nbsp;  
&nbsp;This&nbsp;is&nbsp;the&nbsp;link&nbsp;from&nbsp;which&nbsp;i&nbsp;acquired&nbsp;the&nbsp;longitude&nbsp;and&nbsp;latitude&nbsp;values&nbsp;  
&nbsp;[itouchmap.com/latlong.html](http://itouchmap.com/latlong.html)&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [July 5, 2010, 9:16pm UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/4 "2010-07-05T21:16:05Z")

</div>

Iousinos,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Because&nbsp;you&nbsp;said&nbsp;you&nbsp;can&nbsp;confirm&nbsp;the&nbsp;points&nbsp;are&nbsp;valid&nbsp;decimal&nbsp;values&nbsp;and&nbsp;within&nbsp;the&nbsp;map,&nbsp;so&nbsp;I&nbsp;use&nbsp;any&nbsp;points&nbsp;inside&nbsp;the&nbsp;current&nbsp;extent&nbsp;of&nbsp;map&nbsp;to&nbsp;test,&nbsp;they’re&nbsp;working&nbsp;if&nbsp;add&nbsp;that&nbsp;code.&nbsp;  
&nbsp;&nbsp;  
&nbsp;So&nbsp;I&nbsp;think&nbsp;maybe&nbsp;the&nbsp;problem&nbsp;is&nbsp;caused&nbsp;by&nbsp;points&nbsp;coordinates,&nbsp;could&nbsp;you&nbsp;check&nbsp;each&nbsp;of&nbsp;them&nbsp;and&nbsp;let&nbsp;me&nbsp;know&nbsp;if&nbsp;they&nbsp;are&nbsp;within&nbsp;the&nbsp;current&nbsp;extent&nbsp;of&nbsp;map&nbsp;RectangleShape(22.835,&nbsp;41.2921,&nbsp;25.8892,&nbsp;40.4029)?&nbsp;Or&nbsp;you&nbsp;can&nbsp;list&nbsp;some&nbsp;of&nbsp;the&nbsp;points’&nbsp;coordinates&nbsp;and&nbsp;I&nbsp;can&nbsp;test&nbsp;them?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;  
&nbsp;James&nbsp;

---

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 6, 2010, 3:47am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/5 "2010-07-06T03:47:24Z")

</div>

Finally&nbsp;made&nbsp;it.&nbsp;The&nbsp;last&nbsp;post&nbsp;was&nbsp;caused&nbsp;due&nbsp;to&nbsp;an&nbsp;error&nbsp;of&nbsp;mine&nbsp;  
&nbsp;Thanks

---

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 6, 2010, 4:05am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/6 "2010-07-06T04:05:33Z")

</div>

If&nbsp;you&nbsp;could&nbsp;please&nbsp;direct&nbsp;me&nbsp;on&nbsp;  
&nbsp;1)&nbsp;How&nbsp;to&nbsp;add&nbsp;a&nbsp;handler&nbsp;method&nbsp;when&nbsp;those&nbsp;icons&nbsp;are&nbsp;clicked&nbsp;  
&nbsp;&nbsp;  
&nbsp;2)&nbsp;How&nbsp;to&nbsp;attach&nbsp;a&nbsp;tooltip&nbsp;on&nbsp;those&nbsp;icon&nbsp;to&nbsp;open&nbsp;every&nbsp;time&nbsp;they&nbsp;are&nbsp;clicked&nbsp;as&nbsp;in&nbsp;Google&nbsp;Maps&nbsp;for&nbsp;example.&nbsp;(if&nbsp;there&nbsp;is&nbsp;such&nbsp;thing)&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks!

---

<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:** [July 6, 2010, 3:20pm UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/7 "2010-07-06T15:20:06Z")

</div>

We&nbsp;have&nbsp;a&nbsp;Code&nbsp;Community&nbsp;project&nbsp;_Dragging&nbsp;Icon&nbsp;(advanced)_&nbsp;that&nbsp;&nbsp;deals&nbsp;with&nbsp;various&nbsp;aspects&nbsp;of&nbsp;icons.&nbsp;Please,&nbsp;take&nbsp;a&nbsp;look&nbsp;at&nbsp;that&nbsp;and&nbsp;see&nbsp;what&nbsp;you&nbsp;think.

[code.thinkgeo.com/projects/show/draggingicon2](http://code.thinkgeo.com/projects/show/draggingicon2)

For&nbsp;tooltip,&nbsp;I&nbsp;would&nbsp;recommend&nbsp;the&nbsp;following&nbsp;links&nbsp;in&nbsp;the&nbsp;Discussion&nbsp;Forum&nbsp;that&nbsp;show&nbsp;how&nbsp;to&nbsp;create&nbsp;tooltips&nbsp;for&nbsp;the&nbsp;Desktop&nbsp;edition:

[gis.thinkgeo.com/Support/Discussion...fault.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6769/afv/topic/Default.aspx)

[gis.thinkgeo.com/Support/Discussion...fault.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6204/afv/topic/Default.aspx)

---

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 7, 2010, 4:16am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/8 "2010-07-07T04:16:27Z")

</div>

Great&nbsp;those&nbsp;were&nbsp;both&nbsp;very&nbsp;helpfull.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Another&nbsp;basic&nbsp;question&nbsp;thought…When&nbsp;i&nbsp;click&nbsp;one&nbsp;of&nbsp;the&nbsp;features&nbsp;on&nbsp;a&nbsp;layer&nbsp;i&nbsp;want&nbsp;to&nbsp;change&nbsp;its&nbsp;color&nbsp;or&nbsp;icon…How&nbsp;can&nbsp;i&nbsp;do&nbsp;that?

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [July 7, 2010, 7:55pm UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/9 "2010-07-07T19:55:01Z")

</div>

Ioustinos,

Thanks&nbsp;for&nbsp;your&nbsp;feedback.  
&nbsp;  
Following&nbsp;HowDoI&nbsp;samples&nbsp;provided&nbsp;with&nbsp;our&nbsp;package&nbsp;are&nbsp;doing&nbsp;exactly&nbsp;what&nbsp;you&nbsp;are&nbsp;requesting,&nbsp;just&nbsp;take&nbsp;a&nbsp;look&nbsp;if&nbsp;you&nbsp;are&nbsp;interested.  
_HowDoI\Styles\Use&nbsp;predefined&nbsp;geographic&nbsp;and&nbsp;standard&nbsp;colors_  
_HowDoI\Feature&nbsp;Layers\&nbsp;Change&nbsp;the&nbsp;look&nbsp;of&nbsp;a&nbsp;feature&nbsp;layer._  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale

---

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 8, 2010, 5:58am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/10 "2010-07-08T05:58:43Z")

</div>

Yes&nbsp;i&nbsp;have&nbsp;seen&nbsp;these&nbsp;samples.&nbsp;  
&nbsp;My&nbsp;question&nbsp;is&nbsp;whether&nbsp;i&nbsp;can&nbsp;change&nbsp;only&nbsp;one&nbsp;feature’s&nbsp;icon&nbsp;when&nbsp;this&nbsp;will&nbsp;be&nbsp;clicked.&nbsp;  
&nbsp;Or&nbsp;do&nbsp;i&nbsp;have&nbsp;to&nbsp;create&nbsp;another&nbsp;feature&nbsp;layer&nbsp;(thus&nbsp;deifferent&nbsp;style)&nbsp;which&nbsp;will&nbsp;hold&nbsp;that&nbsp;one&nbsp;feature&nbsp;which&nbsp;will&nbsp;be&nbsp;a&nbsp;replicate&nbsp;of&nbsp;the&nbsp;original??

---

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 8, 2010, 7:15am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/11 "2010-07-08T07:15:36Z")

</div>

To&nbsp;clarify&nbsp;what&nbsp;i&nbsp;need.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;want&nbsp;to&nbsp;have&nbsp;a&nbsp;feature&nbsp;layer.&nbsp;Everything&nbsp;is&nbsp;exactly&nbsp;the&nbsp;same&nbsp;for&nbsp;each&nbsp;feature&nbsp;of&nbsp;course&nbsp;but&nbsp;there&nbsp;are&nbsp;15&nbsp;color&nbsp;variations.&nbsp;  
&nbsp;Do&nbsp;i&nbsp;need&nbsp;to&nbsp;create&nbsp;one&nbsp;layer&nbsp;for&nbsp;each&nbsp;color??&nbsp;  
&nbsp;Moreover&nbsp;the&nbsp;features&nbsp;should&nbsp;changes&nbsp;colors.&nbsp;  
&nbsp;Do&nbsp;i&nbsp;have&nbsp;to&nbsp;remove&nbsp;them&nbsp;from&nbsp;one&nbsp;featureLayer&nbsp;and&nbsp;add&nbsp;them&nbsp;to&nbsp;the&nbsp;other?&nbsp;  
&nbsp;And&nbsp;i&nbsp;need&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;search&nbsp;for&nbsp;one&nbsp;feature&nbsp;by&nbsp;id…If&nbsp;i&nbsp;have&nbsp;10&nbsp;layers&nbsp;i&nbsp;would&nbsp;need&nbsp;to&nbsp;search&nbsp;in&nbsp;all&nbsp;of&nbsp;them.&nbsp;Right?

---

<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:** [July 8, 2010, 6:19pm UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/12 "2010-07-08T18:19:35Z")

</div>

You&nbsp;don't&nbsp;have&nbsp;to&nbsp;create&nbsp;a&nbsp;new&nbsp;layer&nbsp;to&nbsp;display&nbsp;differently&nbsp;some&nbsp;features&nbsp;from&nbsp;others.&nbsp;I&nbsp;don't&nbsp;know&nbsp;what&nbsp;kind&nbsp;of&nbsp;data&nbsp;you&nbsp;have,&nbsp;but&nbsp;for&nbsp;example,&nbsp;you&nbsp;could&nbsp;use&nbsp;the&nbsp; **ValueStyle&nbsp;** to&nbsp;display&nbsp;based&nbsp;on&nbsp;a&nbsp;column&nbsp;value&nbsp;see&nbsp;the&nbsp;sample&nbsp;"Draw&nbsp;features&nbsp;based&nbsp;on&nbsp;values"&nbsp;in&nbsp;the&nbsp;_Styles_&nbsp;category&nbsp;of&nbsp;the&nbsp;"How&nbsp;Do&nbsp;I"&nbsp;samples.&nbsp;Or&nbsp;it&nbsp;could&nbsp;be&nbsp;based&nbsp;on&nbsp;what&nbsp;value&nbsp;range&nbsp;using&nbsp;the&nbsp; **ClassStyle** ,&nbsp;see&nbsp;"Draw&nbsp;thematic&nbsp;features"&nbsp;for&nbsp;that.&nbsp;Actually,&nbsp;we&nbsp;have&nbsp;a&nbsp;very&nbsp;flexible&nbsp;and&nbsp;extensible&nbsp;way&nbsp;to&nbsp;display&nbsp;feratures&nbsp;based&nbsp;on&nbsp;any&nbsp;criteria.&nbsp;&nbsp;&nbsp;For&nbsp;example,&nbsp;I&nbsp;would&nbsp;also&nbsp;check&nbsp;some&nbsp;projects&nbsp;in&nbsp;the&nbsp;Code&nbsp;Community&nbsp;that&nbsp;show&nbsp;how&nbsp;to&nbsp;extent&nbsp; **Styles**.

You&nbsp;can&nbsp;check&nbsp;those&nbsp;projects&nbsp;below,.&nbsp;They&nbsp;show&nbsp;some&nbsp;very&nbsp;customized&nbsp;way&nbsp;to&nbsp;extent&nbsp;Style&nbsp;but&nbsp;I&nbsp;think&nbsp;you&nbsp;will&nbsp;see&nbsp;how&nbsp;you&nbsp;can&nbsp;adapt&nbsp;that&nbsp;for&nbsp;your&nbsp;situation:

-_Feature&nbsp;Centric&nbsp;Style_:&nbsp;[code.thinkgeo.com/projects/show/featurecentricstyle](http://code.thinkgeo.com/projects/show/featurecentricstyle)

-_Time&nbsp;Based&nbsp;Point&nbsp;Style_:&nbsp;[code.thinkgeo.com/projects/s...pointstyle](http://code.thinkgeo.com/projects/show/timebasedpointstyle)

-_Time&nbsp;Line_:&nbsp;[code.thinkgeo.com/projects/show/timeline](http://code.thinkgeo.com/projects/show/timeline)

If&nbsp;that&nbsp;still&nbsp;does&nbsp;not&nbsp;help&nbsp;very&nbsp;much,&nbsp;tell&nbsp;us&nbsp;more&nbsp;specifically&nbsp;about&nbsp;your&nbsp;case.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Ioustinos](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/f0a364/32.png) [@Ioustinos](https://community.thinkgeo.com/u/Ioustinos)\
**Post date:** [July 12, 2010, 12:40pm UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/13 "2010-07-12T12:40:23Z")

</div>

Nope,&nbsp;those&nbsp;examples&nbsp;were&nbsp;not&nbsp;helpful.&nbsp;At&nbsp;least&nbsp;not&nbsp;clear&nbsp;enough&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;one&nbsp;feature&nbsp;layer&nbsp;with&nbsp;many&nbsp;feature.&nbsp;  
&nbsp;At&nbsp;some&nbsp;point,&nbsp;while&nbsp;the&nbsp;program&nbsp;runs,&nbsp;the&nbsp;user&nbsp;selects&nbsp;one&nbsp;feature.&nbsp;&nbsp;i&nbsp;want&nbsp;that&nbsp;ONE&nbsp;of&nbsp;the&nbsp;features&nbsp;to&nbsp;change&nbsp;color.&nbsp;or&nbsp;icon.&nbsp;  
&nbsp;&nbsp;  
&nbsp;It&nbsp;does&nbsp;not&nbsp;get&nbsp;more&nbsp;simple&nbsp;than&nbsp;that.

---

<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:** [July 12, 2010, 4:43pm UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/14 "2010-07-12T16:43:35Z")

</div>

Actually,&nbsp;there&nbsp;is&nbsp;a&nbsp;Code&nbsp;Community&nbsp;project,&nbsp;_Select&nbsp;At&nbsp;TrackShape&nbsp;_which&nbsp;is&nbsp;very&nbsp;similar&nbsp;to&nbsp;what&nbsp;you&nbsp;are&nbsp;looking&nbsp;for.&nbsp;[code.thinkgeo.com/projects/show/selectwithtrackshape](http://code.thinkgeo.com/projects/show/selectwithtrackshape)

Just&nbsp;change&nbsp;the&nbsp;TrackMode&nbsp;to&nbsp;TrackMode.Point&nbsp;in&nbsp;the&nbsp;Load&nbsp;event:

winformsMap1.TrackOverlay.TrackMode&nbsp;=&nbsp;TrackMode.Point;

&nbsp;

&nbsp;And&nbsp;in&nbsp;the&nbsp;TrackEnded&nbsp;event,&nbsp;change&nbsp;the&nbsp;code&nbsp;&nbsp;to&nbsp;the&nbsp;following&nbsp;and&nbsp;you&nbsp;will&nbsp;see&nbsp;the&nbsp;app&nbsp;working&nbsp;as&nbsp;expected:

&nbsp;

`        void winformsMap1_TrackEnded(object sender, TrackEndedTrackInteractiveOverlayEventArgs e)        {            //RectangleShape rectangleShape = (RectangleShape)e.TrackShape;            PointShape pointShape = (PointShape)e.TrackShape;            ShapeFileFeatureLayer worldLayer = (ShapeFileFeatureLayer)winformsMap1.FindFeatureLayer("WorldLayer");            InMemoryFeatureLayer spatialQueryResultLayer = (InMemoryFeatureLayer)winformsMap1.FindFeatureLayer("SpatialQueryResultLayer");            //Spatial query to find the features intersecting the rectangle from the track rectangle.            Collection<Feature> spatialQueryResults;            worldLayer.Open();            //spatialQueryResults = worldLayer.QueryTools.GetFeaturesIntersecting(rectangleShape,ReturningColumnsType.NoColumns);            spatialQueryResults = worldLayer.QueryTools.GetFeaturesContaining(pointShape, ReturningColumnsType.NoColumns);            worldLayer.Close();            //Adds the selected features to the InMemoryfeatureLayer            spatialQueryResultLayer.Open();            spatialQueryResultLayer.EditTools.BeginTransaction();            spatialQueryResultLayer.InternalFeatures.Clear();            foreach (Feature feature in spatialQueryResults)            {                spatialQueryResultLayer.EditTools.Add(feature);            }            spatialQueryResultLayer.EditTools.CommitTransaction();            spatialQueryResultLayer.Close();            //Refreshes the layers to show new result.            winformsMap1.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear();            winformsMap1.Refresh(winformsMap1.TrackOverlay);            winformsMap1.Refresh(winformsMap1.Overlays["SpatialQueryResultOverlay"]);        }`

---

<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:** [July 12, 2010, 4:52pm UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/15 "2010-07-12T16:52:21Z")

</div>

I&nbsp;need&nbsp;to&nbsp;mention&nbsp;that&nbsp;the&nbsp;solution&nbsp;I&nbsp;just&nbsp;presented&nbsp;is&nbsp;working&nbsp;only&nbsp;for&nbsp;polygon&nbsp;based&nbsp;layer.&nbsp;For&nbsp;a&nbsp;point&nbsp;or&nbsp;line&nbsp;based&nbsp;layer,&nbsp;the&nbsp;technique&nbsp;will&nbsp;be&nbsp;a&nbsp;little&nbsp;different&nbsp;and&nbsp;that&nbsp;would&nbsp;an&nbsp;issue&nbsp;pretty&nbsp;similar&nbsp;to&nbsp;what&nbsp;we&nbsp;can&nbsp;see&nbsp;in&nbsp;another&nbsp;post:&nbsp;[gis.thinkgeo.com/Support/Discussion...fault.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/7791/afv/topic/Default.aspx).&nbsp;This&nbsp;is&nbsp;a&nbsp;post&nbsp;for&nbsp;the&nbsp;Web&nbsp;edition&nbsp;but&nbsp;the&nbsp;spatial&nbsp;querying&nbsp;logic&nbsp;is&nbsp;the&nbsp;same.

I&nbsp;let&nbsp;you&nbsp;know&nbsp;that&nbsp;we&nbsp;will&nbsp;post&nbsp;new&nbsp;Code&nbsp;Community&nbsp;projects&nbsp;specifically&nbsp;for&nbsp;the&nbsp;Desktop&nbsp;edition&nbsp;that&nbsp;show&nbsp;how&nbsp;to&nbsp;select&nbsp;the&nbsp;feature&nbsp;the&nbsp;user&nbsp;clicked&nbsp;on&nbsp;whether&nbsp;the&nbsp;layer&nbsp;is&nbsp;polygon,&nbsp;line&nbsp;or&nbsp;point&nbsp;based.&nbsp;Since&nbsp;this&nbsp;is&nbsp;a&nbsp;pretty&nbsp;popular&nbsp;request,&nbsp;this&nbsp;will&nbsp;be&nbsp;well&nbsp;presented&nbsp;for&nbsp;everybody&nbsp;to&nbsp;take&nbsp;advantage&nbsp;of&nbsp;in&nbsp;the&nbsp;Code&nbsp;Community.

---

<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:** [July 14, 2010, 11:29am UTC](https://community.thinkgeo.com/t/problem-adding-features/1327/16 "2010-07-14T11:29:58Z")

</div>

There&nbsp;is&nbsp;a&nbsp;new&nbsp;Code&nbsp;Community&nbsp;project&nbsp;posted&nbsp;today&nbsp;on&nbsp;that&nbsp;subject.&nbsp;Notice&nbsp;that&nbsp;in&nbsp;this&nbsp;project,&nbsp;we&nbsp;are&nbsp;using&nbsp;the&nbsp;MapClick&nbsp;event&nbsp;instead&nbsp;of&nbsp;the&nbsp;TrackEnded&nbsp;event&nbsp;but&nbsp;the&nbsp;code&nbsp;is&nbsp;basically&nbsp;the&nbsp;same&nbsp;and&nbsp;this&nbsp;method&nbsp;works&nbsp;for&nbsp;selecting&nbsp;the&nbsp;feature&nbsp;the&nbsp;user&nbsp;clicked&nbsp;on&nbsp;regardless&nbsp;of&nbsp;their&nbsp;type&nbsp;(polygon,&nbsp;line&nbsp;or&nbsp;point&nbsp;based).&nbsp;You&nbsp;can&nbsp;check&nbsp;it&nbsp;out_&nbsp;Get&nbsp;Feature&nbsp;Clicked&nbsp;On_:&nbsp;[code.thinkgeo.com/projects/show/featureclicked](http://code.thinkgeo.com/projects/show/featureclicked)
