ThinkGeo.com    |     Documentation    |     Premium Support

Retrieving a tracked polygon

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


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


2) The user draws a polygon and double clicks.


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


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


What am I missing?



Ted:


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


In the TrackEnded event, I added following code:


 


Map1.EditOverlay.EditLayer.InternalFeatures.RemoveAt(Map1.EditOverlay.EditLayer.InternalFeatures.Count - 1)


Map1.RefreshEditOverlay()


 


Rose



Thank you.   That worked.

Rose, 
  
 Thanks for sharing. 
  
 ThinkGeo Support