Reduce lag and improve performance when load multi layers with Arcgis API

753
3
06-04-2018 12:31 AM
Trung_KiênTrần
New Contributor

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.

Tags (2)
0 Kudos
3 Replies
HezronPhilip
New Contributor II

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.

0 Kudos
Trung_KiênTrần
New Contributor

Thank you very much, I will try it

0 Kudos
smitha_thekkarath
New Contributor

With the visibility of the layers set to false by default, does it decrease the load time/improve performance?

0 Kudos