Khalil,
I have checked my code and can't make any headway. I have a map view with a static overlay containing many MsSql2008FeatureLayers. There was not trouble drawing these to display the map. I added several features to an InMemoryFeatureLayer and added that to the DynamicOverlay and there was no problem displaying that. I press my Erase Highlights button to remove the highlighted features and the message appears. The 'Erase Highlights' button executes the following code:
protected void EraseBtn_Click(object sender, EventArgs e)
{
try
{
ViewFeatureInfo.UpdateByErasingHighlights();
UpdatePanel mapUpdatePanel = (UpdatePanel)NextGenProject.ParentPage.FindControl("MapUPD");
mapUpdatePanel.Update();
}
catch
{
throw;
}
}
public static void UpdateByErasingHighlights()
{
try
{
bool redraw = false;
InMemoryFeatureLayer layer = (InMemoryFeatureLayer)MapControl.MapWindow.DynamicOverlay.Layers[MapControl.Highlighter.HighlightLayerName];
if (layer.InternalFeatures.Count > 0)
{
layer.InternalFeatures.Clear();
redraw = true;
}
layer = (InMemoryFeatureLayer)MapControl.MapWindow.DynamicOverlay.Layers[MapControl.FeaturePicker.PickerLayerName];
if (layer.InternalFeatures.Count > 0)
{
layer.InternalFeatures.Clear();
redraw = true;
}
if (redraw) MapControl.MapWindow.DynamicOverlay.Redraw();
}
catch
{
throw;
}
}
There was no message present when I pressed the 'Erase Highlights' button and this is all of my code that executes. When the map window reappears, the message is present in the upper left corner of the screen. All of my code is wrapped in error handling (such as it is) so no trappable errors occur. Perhaps you could tell me what happens in you code that might cause this message. What collections are searched by the map control?
Charles