# Issue with Trackoverly.Clear()

**URL:** <https://community.thinkgeo.com/t/issue-with-trackoverly-clear/6693>\
**Category:** Android\
**Created:** [January 11, 2016, 7:56am UTC](https://community.thinkgeo.com/t/issue-with-trackoverly-clear/6693 "2016-01-11T07:56:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/p/b2d939/32.png) [@Patrick](https://community.thinkgeo.com/u/Patrick)\
**Post date:** [January 11, 2016, 7:56am UTC](https://community.thinkgeo.com/t/issue-with-trackoverly-clear/6693/1 "2016-01-11T07:56:11Z")

</div>

Hi,  
  
  
  
I’m&nbsp;currently&nbsp;testing&nbsp;your&nbsp;sample&nbsp;“draweditfeatures”&nbsp;with&nbsp;MS&nbsp;9.0.201.0.  
  
Clearing&nbsp;the&nbsp;trackoverly&nbsp;is&nbsp;not&nbsp;working&nbsp;properly.  
  
  
  
here&nbsp;are&nbsp;steps&nbsp;to&nbsp;reproduce:  
  
1.&nbsp;Start&nbsp;drawing&nbsp;a&nbsp;polygon&nbsp;&nbsp;=\>&nbsp;a&nbsp;polygon&nbsp;is&nbsp;drawn&nbsp;=\>&nbsp;OK  
  
2.&nbsp;click&nbsp;on&nbsp;the&nbsp;delete&nbsp;tool&nbsp;=\>&nbsp;the&nbsp;polygon&nbsp;is&nbsp;deleted&nbsp;=\>&nbsp;OK  
  
3.&nbsp;Start&nbsp;drawing&nbsp;a&nbsp;new&nbsp;polygon&nbsp;=\>&nbsp;the&nbsp;first&nbsp;polygon&nbsp;is&nbsp;displayed&nbsp;again&nbsp;and&nbsp;new&nbsp;vertices&nbsp;are&nbsp;added&nbsp;to&nbsp;it&nbsp;=\>&nbsp;KO  
  
  
  
I&nbsp;think&nbsp;that&nbsp;androidMap.TrackOverlay.TrackShapeLayer.Clear()&nbsp;does&nbsp;not&nbsp;clear&nbsp;everything.  
  
  
  
Can&nbsp;you&nbsp;check&nbsp;and&nbsp;provide&nbsp;a&nbsp;fixed&nbsp;code&nbsp;to&nbsp;really&nbsp;clean&nbsp;the&nbsp;trackOverlay&nbsp;?  
  
  
  
Thank&nbsp;you  
  
Patrick.

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [January 12, 2016, 1:34am UTC](https://community.thinkgeo.com/t/issue-with-trackoverly-clear/6693/2 "2016-01-12T01:34:09Z")

</div>

Hi&nbsp;Patrick,&nbsp;  
  
  
  
Thanks&nbsp;for&nbsp;your&nbsp;information.&nbsp;I&nbsp;think&nbsp;it’s&nbsp;should&nbsp;be&nbsp;an&nbsp;operational&nbsp;problem&nbsp;of&nbsp;our&nbsp;sample,&nbsp;and&nbsp;it&nbsp;will&nbsp;be&nbsp;fixed&nbsp;in&nbsp;the&nbsp;next&nbsp;version.  
  
  
  
The&nbsp;reason&nbsp;is&nbsp;that&nbsp;the&nbsp;track&nbsp;is&nbsp;not&nbsp;ended&nbsp;when&nbsp;draws&nbsp;a&nbsp;new&nbsp;polygon&nbsp;2nd.&nbsp;You&nbsp;can&nbsp;long&nbsp;press&nbsp;the&nbsp;map&nbsp;to&nbsp;fire&nbsp;the&nbsp;track&nbsp;end&nbsp;action.&nbsp;Or&nbsp;you&nbsp;can&nbsp;call&nbsp;the&nbsp;LongPress(args)&nbsp;method&nbsp;explicitly&nbsp;as&nbsp;the&nbsp;following&nbsp;code:&nbsp;  
  
  
  
OnCreate(Bundle&nbsp;bundle)&nbsp;method:

> `androidMap.TrackOverlay.VertexAdded += (sender, e) => { endVertex = e.AddedVertex; };`

  
  
  

> `private void TrackButtonClick(object sender, EventArgs e) `  
> `{ `  
> `  ``ImageButton button = (ImageButton)sender; `  
> `  ``foreach (ImageButton tempButton in GetButtons())`  
> `  ``{ `  
> `    ``tempButton.SetBackgroundResource(Resource.Drawable.buttonbackground); `  
> `  ``}   androidMap.TrackOverlay.LongPress(new InteractionArguments(){`WorldX&nbsp;=&nbsp;endVertex.X,&nbsp;WorldY&nbsp;=&nbsp;endVertex.Y});  
> `  ``button.SetBackgroundResource(Resource.Drawable.buttonselectedbackground); `  
> `  ``switch (button.Id) `  
> `  ``{`  
> `    ``case Resource.Drawable.Cursor:`  
> `      ``…`  
> `      ``androidMap.TrackOverlay.TrackMode = TrackMode.None; …           break; `  
> `      ``… `  
> `  ``}`  
> ` ``}`

  
  
  
Regards,  
  
Peter
