I reviewed the code you provided and found that there is a one issue probably causing the problem you mentioned. Please try to update the following code snippet, it should fix your issue. private void clearselection_Click(object sender, EventArgs e) { InMemoryFeatureLayer spatialQueryResultLayer = (InMemoryFeatureLayer)winformsMap1.FindFeatureLayer("spatialQueryResultLayer");
if (spatialQueryResultLayer.InternalFeatures.Count > 0) { spatialQueryResultLayer.InternalFeatures.Clear(); }
Have you set the key for the overlay when you add it to the map control? It would be nice if you could send a self-zipped application to us. You can send the sample either via the discussion forum or send it to our support (support@thinkgeo.com) and asked him to forward to Yale for this post.
Any more questions please feel free to let me know.