Hi All,
I have come across something strange and cant explain it.
I was using the following line of code which worked perfectly well for a set of data:
LayerOverlay staticOverlay = (LayerOverlay)wpfMap1.Overlays[overlayName];
With a different layer it doesnt work. I have found looping though all the overlays and checking if the names match and then assigning the overlay does though??
LayerOverlay staticOverlay = new LayerOverlay();
foreach (Overlay overlay in wpfMap1.Overlays)
{
if (overlay != null)
{
if (overlay.Name == overlayName)
{
staticOverlay = (LayerOverlay)overlay;
}
}
}
Isnt this doing exactly the same thing?
thanks
Phil