I work with ArcGIS API for Javascript to display mutli layers on the map (can be up to thousand of layers), mostly MapImageLayer, a few FeatureLayer, TitleLayer and StreamLayer. My method is add all of them to the map and set visible attribute is false. But when I opened the page it was very lag and slowly performance. Please give me some advice, thank you.
When you say multiple layers, I assume you are creating each layer (eg: layer = new arcgisdynamicmapservice(url);) and then adding them individually using map.addLayer()?
I would suggest that you create each layer and set the property for each layer (visibility etc.), and push it into an array and add everything in one go using map.addLayers().
Considering I don't have much to work with, I assumed that the above solution could fix your issue, please post code snippets for further assistance.
Thank you very much, I will try it
With the visibility of the layers set to false by default, does it decrease the load time/improve performance?