How to get a map service with multiple legends loaded?

المشرف العام

Administrator
طاقم الإدارة
So, this is based on a previously unanswered question I have where I'm trying to get legends loaded from a feature service that contains multiple legends within the same layer. The browser loads forever and sometimes gets some of the legends loaded and then crashes at a certain point. It looks like all the legends are contained in the same layer on the feature service. You can see my development website with all the firebug notices here.


I've also tested other feature services with multiple legends and not had this issue. I'm not sure if it has to do with the shear quantity of legends mine contains or what. I think there are at least 10 legends in the single feature layer.


You can also see where I've got this little test of the sample server on JSFiddle, although the results are a little funny looking. If you copy and paste the code into ArcGIS Sandbox, it should work though. Sidenote, why does the legend look different when I go to the reference link?

Anyhoo, what I'm really trying to figure out here is why loading the legends crashes the browser. Here's the simple code I'm using. Do I need to reconfigure the map server? Or can I specify to only load one legend at a time so as to not overload the browser?

var legend = new esri.dijit.Legend({ map: map, }, "loadlegend"); legend.startup();

أكثر...
 
أعلى