This project is read-only.

Add layer to map without showing it?

Aug 3, 2011 at 9:56 PM

Is it possible to add a layer to the map (and legend) that doesn't get loaded or shown right away, but instead when the user checks it on the legend it loads and shows it?


For example when a user of my application is loading a project they may have say 20 large tif files described in their project.  It is SUPER slow loading that many large files all at once, and it would be much easier/faster if the files would load up in the legend and then the user can manually select which of the files they would like to see on the map.

Aug 10, 2011 at 12:52 PM

yourLayer.IsVisible = false;

Aug 10, 2011 at 6:29 PM

Adding a layer triggers a map refresh which can be expensive if adding lots of large layers.  You can disable that behavior by calling Layers.SuspendEvents() on your Map control.  There is also a call to ResumeEvents().  I leave the events permanently suspended in my application and just refresh the map when I need to.