GNak,
In Map Suite Web Edition, we have 2 categories of MarkerOverlay, one maintains FeatureSource such as InMemoryMarkerOverlay and FeatureSourceMarkerOverlay while another one maintains a collection of concrete markers such as SimpleMarkerOverlay.
For InMemoryMarkerOverlay, Features is a collection which maintains a Dictionary, you need to find the key of the feature to delete the feature while SimpleMarkerOverlay can delete the marker by Feature Id.
Here is a method to help you delete the marker in different MarkerOverlay. Ps: feature Id and Marker Overlay Id can be got from MarkerOverlayClickEventArgs;
private void DeleteMarker(string featureId, string markerOverlayId)
{
InMemoryMarkerOverlay inMemoryMarkerOverlay = Map1.CustomOverlays[markerOverlayId] as InMemoryMarkerOverlay;
SimpleMarkerOverlay simpleMarkerOverlay = Map1.CustomOverlays[markerOverlayId] as SimpleMarkerOverlay;
if (inMemoryMarkerOverlay != null)
{
string clickedKey = String.Empty;
foreach (string key in inMemoryMarkerOverlay.Features.GetKeys())
{
Feature feature = inMemoryMarkerOverlay.Features[key];
if (featureId == feature.Id)
{
clickedKey = key;
break;
}
}
if (!String.IsNullOrEmpty(clickedKey))
{
inMemoryMarkerOverlay.Features.Remove(clickedKey);
}
}
else if (simpleMarkerOverlay != null)
{
simpleMarkerOverlay.Markers.Remove(featureId);
}
}
Any queries please let me know.
Thanks,
Howard