Order of Legend Layers in Printed Map

2142
5
12-05-2012 10:08 AM
MarkHoover
Occasional Contributor II
I have an app that uses a Print Service task to print out maps.  Everything works as intended, except for one thing.  The order the layers show up in the legend is determined solely based on the draw order of the layers on the map.  This is not desirable.  I have a UI intended to give the user control over which order the layers appear in the legend.

Using PrintTemplate's layoutOption's layerLegends, I had assumed the order of the layers in this array would determine the order they appear in the legend, but this is not the case.  Is this a bug, or as intended?  Is there some other way I can change the order of the layers in the legend?

Thanks!
0 Kudos
5 Replies
MarkHoover
Occasional Contributor II
Can anyone from Esri verify whether this is a bug or as designed?
0 Kudos
MarkHoover
Occasional Contributor II
Still could really use a response on this.  Here is the layoutOptions proprety I'm referring to:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/printtemplate.htm#layoutOptions
0 Kudos
MarkHoover
Occasional Contributor II
Does anyone know a different avenue I can submit this for Esri to review?  It is important for us to know whether or not this is a bug/if there exists a workaround/if Esri is already aware and plans to fix at next release, etc.
0 Kudos
JohnGravois
Frequent Contributor
based on the description you provided it sounds like the order of the array of layerIds supplied in the layoutOptions does not control layer order in the legend.  Looking at the Export Web Map REST specification, no mention is made that the order of the layers supplied will control the order of layers in the legend.

All this to say that the JavaScript API can't include this functionality until the capability is present in REST.

this sounds like a valid enhancement to me.  the most visible place to log issues like this is the Esri Ideas portal.  We'd also be happy to log the request through technical support, but it would be helpful if you can provide a repro case for internal review.
0 Kudos
MarkHoover
Occasional Contributor II
Ah, wonderful.  Happy to hear it might come down then pike in future versions of the REST/JavaScript APIs.  We will be on the lookout for it.

I'll also go ahead and submit this over at Esri Ideas.

Thank you for the response, it really helps me out to be able to have justification for this functionality currently being unavailable.
0 Kudos