# Retrieving a tracked polygon

**URL:** <https://community.thinkgeo.com/t/retrieving-a-tracked-polygon/362>\
**Category:** WinForms\
**Created:** [April 17, 2009, 1:10pm UTC](https://community.thinkgeo.com/t/retrieving-a-tracked-polygon/362 "2009-04-17T13:10:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [April 17, 2009, 1:10pm UTC](https://community.thinkgeo.com/t/retrieving-a-tracked-polygon/362/1 "2009-04-17T13:10:24Z")

</div>

I'm&nbsp;sure&nbsp;I'm&nbsp;overlooking&nbsp;something&nbsp;simple,&nbsp;but&nbsp;I&nbsp;cannot&nbsp;find&nbsp;an&nbsp;easy&nbsp;way&nbsp;to&nbsp;let&nbsp;a&nbsp;user&nbsp;draw&nbsp;a&nbsp;polygon&nbsp;and&nbsp;my&nbsp;application&nbsp;retrieve&nbsp;it.

1)&nbsp;I'm&nbsp;setting&nbsp;TrackMode&nbsp;on&nbsp;the&nbsp;edit&nbsp;overlay&nbsp;to&nbsp;Polygon.

2)&nbsp;The&nbsp;user&nbsp;draws&nbsp;a&nbsp;polygon&nbsp;and&nbsp;double&nbsp;clicks.

3)&nbsp;I&nbsp;catch&nbsp;the&nbsp;TrackEnded&nbsp;event,&nbsp;and&nbsp;I&nbsp;can&nbsp;get&nbsp;the&nbsp;Shape&nbsp;that&nbsp;was&nbsp;drawn&nbsp;from&nbsp;the&nbsp;event&nbsp;argument.

Unfortunately,&nbsp;this&nbsp;shape&nbsp;gets&nbsp;added&nbsp;as&nbsp;a&nbsp;feature&nbsp;into&nbsp;the&nbsp;EditOverlay.EditLayer.FeatureSource.&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;do&nbsp;not&nbsp;want&nbsp;it&nbsp;there,&nbsp;and&nbsp;once&nbsp;it&nbsp;is&nbsp;there,&nbsp;I&nbsp;cannot&nbsp;for&nbsp;the&nbsp;life&nbsp;of&nbsp;me&nbsp;figure&nbsp;out&nbsp;how&nbsp;to&nbsp;clear&nbsp;out&nbsp;this&nbsp;overlay&nbsp;so&nbsp;the&nbsp;drawn&nbsp;shape&nbsp;is&nbsp;no&nbsp;longer&nbsp;present&nbsp;on&nbsp;the&nbsp;screen.

What&nbsp;am&nbsp;I&nbsp;missing?

---

<div class="post-metadata">

**Author:** ![Rose](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rose](https://community.thinkgeo.com/u/Rose)\
**Post date:** [April 17, 2009, 1:25pm UTC](https://community.thinkgeo.com/t/retrieving-a-tracked-polygon/362/2 "2009-04-17T13:25:00Z")

</div>

Ted:

Here&nbsp;is&nbsp;how&nbsp;I&nbsp;removed&nbsp;the&nbsp;last&nbsp;added&nbsp;overlay,&nbsp;not&nbsp;sure&nbsp;if&nbsp;there&nbsp;is&nbsp;a&nbsp;better&nbsp;way&nbsp;to&nbsp;do&nbsp;this.

In&nbsp;the&nbsp;TrackEnded&nbsp;event,&nbsp;I&nbsp;added&nbsp;following&nbsp;code:

&nbsp;

Map1.EditOverlay.EditLayer.InternalFeatures.RemoveAt(Map1.EditOverlay.EditLayer.InternalFeatures.Count&nbsp;-&nbsp;1)

Map1.RefreshEditOverlay()

&nbsp;

Rose

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [April 17, 2009, 1:41pm UTC](https://community.thinkgeo.com/t/retrieving-a-tracked-polygon/362/3 "2009-04-17T13:41:39Z")

</div>

Thank&nbsp;you.&nbsp;&nbsp;&nbsp;That&nbsp;worked.

---

<div class="post-metadata">

**Author:** ![Lee](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@Lee](https://community.thinkgeo.com/u/Lee)\
**Post date:** [April 20, 2009, 4:46am UTC](https://community.thinkgeo.com/t/retrieving-a-tracked-polygon/362/4 "2009-04-20T04:46:00Z")

</div>

Rose,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;sharing.&nbsp;  
&nbsp;&nbsp;  
&nbsp;ThinkGeo&nbsp;Support
