Hi,
My app displays a collection of Marker objects in a SimpleMarkerOverlay. I have been trying to control the ZOrder of these Markers by using marker.BringToFront() and marker.SendToBack() based on a particular state. What I want is to bring all the Markers with state 1 on top of Markers with a different state. Seems straight forward to me, but the following code does not do what I expect. Would you let me know what you think is wrong here?
Regards,
Steven
private void SetAllMarkerZOrder()
{
int state;
SimpleMarkerOverlay markerOverlay = (SimpleMarkerOverlay)winformsMap1.Overlays["IconMarkerOverlay"];
foreach (Marker m in markerOverlay.Markers)
{
state = int.Parse(m.Tag.ToString());
SetMarkerZOrder(state, m);
}
}
private void SetMarkerZOrder(int state, Marker marker)
{
if (state == 1)
{
marker.BringToFront();
}
else
{
marker.SendToBack();
}
}