browser crashes when loading legends at startup

المشرف العام

Administrator
طاقم الإدارة
After much perusing for solutions, I've decided to post my problem as a question. I'm trying to load the legends that are built into the ArcGIS Service Layers I'm using. I'm loading about 7 Dynamic Service Layers and 7 Feature Layers. Each one of the Dynamic Service Layers has it's own legend whereas, each of the Feature Layers is sharing the same very long legend that shows all the color references for all the different layers.

According to the documentation on legends, it should be pretty simple. My code snippet is small but I really believe I'm missing something here. If people whine for more, I can include more later.

var legend = new Legend({ map: map}, "key");legend.startup();The legend contents load to a div called "key". From what I can tell before the browser freezes and crashes, is that some legend contents are loading to the div. This is where it gets hung up. It seems like there are too many legend contents in different places or that it cannot locate one or some of the legend contents on the server. Is there something that I'm missing when it comes to loading legends?

This is the error I get..."Cannot read property '_layers' of undefined"

EDIT After trying to isolate some of the layers to see which ones are causing an issue. I still get the error when I'm trying to load more than 4 legends from different layers. Is there a way to make loading the legends more efficient? How do you only load one legend at a time?



أكثر...
 
أعلى