When initially populating the map I have some layers that may not be visible at the outset, but want to load so they can be enabled if needed by the user.
Example:
LayerOverlay newOverlay = new LayerOverlay();
“Add some features to it”
“Now I don’t want to see it initially, but maybe later”
newOverlay.IsVisible = false;
“Add it to the map”
MapView.Overlays.Add(“NewLayer”, newOverlay);
“Later when I try to find the overlay to turn it on”
Overlay foundOverlay = MapView.Overlays[“NewLayer”];
foundOverlay.IsVisible = true;
This overlay does not show on the map, layers initially loaded with the IsVisible = true all work as I would expect.
Am I missing a step here (I did try the MapView.RefreshAsync(), but this is not needed for the initial ones set as true, and infact just refreshes the map twice.
This one has me baffled. I suspect that I will need to load all layers as visible, then later set the hidden ones as needed.