Select to view content in your preferred language

Has anyone successfully sent a legend from a layer inside a group layer on arcgis server to the javascript API's print widget?

2555
3
10-16-2014 06:04 PM
NathanielRoth
New Contributor III

I inherited a javascript webmap system, that works quite well with one exception we've never gotten the legend to print correctly through the print widget. It appears to be because ArcGIS server doesn't handle passing legends to the print widget if the layer being printed is within a layer group in the service published to the server.

Anyone else run into this? Any solutions?

0 Kudos
3 Replies
DallasShearer
Occasional Contributor

I have successfully used the legend widget with map services that are 2 and 3 layer groups deep. What version of ArcGIS server are you using? I believe version 9.3 and below do not have the legend interface. If i remember correctly it wasn't introduced until 9.3.1. If you are at version 10 or above you can access the REST service for the published map service and navigate the legend link and see if the legend is being produced from ArcGIS server.

0 Kudos
AlexeiB
Occasional Contributor

Hi Dallas,

How did you style the legend in the template? I am able to send the layers into my custom print template but it looks horrendous. The legend is very big and I can only make it 1 column wide. Do you have any ideas how I can make the legend inside my print template 2 or 3 columns?

Thank you,

Alexei

0 Kudos
DallasShearer
Occasional Contributor

You would normally control the column count for the legend with the highlighted control below but it's going to be tricky to do while passing to through ArcGIS server.Especially since the control is disabled when it is not loaded with a layer. Maybe do some trial and error with this. Or it may be better to just develop your own legend that is printed on a separate page that pulls it's data from the legend interface on your REST page.

Capture.PNG

0 Kudos