Legend customization with print service, using custom map template

10-09-2015 11:09 AM
Occasional Contributor

This is similar to a question in another recent post of mine – but since this is dealing with generating maps using a print service, I figure it warranted a separate post.

I have a map that’s showing a feature layer.  The feature layer has been symbolized in the code using a class breaks renderer.  I’ve also set up custom map templates and a custom print service, to have control over the details of how an exported map will look.  There are two things that I’m having trouble figuring out: 

1 - In the exported map, the name of the feature class (also the layer name in the service) shows up in the legend…  I don’t want that there.  Interestingly, it does not show up in the Legend Dijit.  Just in an exported image.


2 - I’d like to know if there is a way to force the legend to display multiple columns, since I have a portrait layout and only 3 or 4 classes will fit in one column before the legend goes off the page.  Is there a setting somewhere in the renderer that I can use?  Do I set that up in the custom mxd?  It is saved with no layers in it, so I'm not sure how any settings I make there would carry through to when it's used with the print service.


19 Replies
New Contributor

Hi Michael, I wonder if there is an update on this issue. I have the exactly the same question: if I have too many layers, the Legend can not fit all the layers into the printout on AGS.  

0 Kudos
Esteemed Contributor

Do your layers have many symbology categories that take up a large amount of room for 1 layer?  Or do you just have a mapservice(s) that have too many layers to fit in the legend?  Or do both scenarios apply for you?

Did you test changing the Layout tab settings such as fitting strategy and gap pt sizes to get make text and symbols smaller so they can fit into the legend area?

0 Kudos
Frequent Contributor

There will only ever be one layer in the legend.  It's a shaded polygon map like Zoe's example.    It fits pretty well, but it's a little tall.  It would fit if we can figure out how to remove the name of the layer, which is the first part of Zoe's question and still not resolved. 

We have a call into ESRI on this.  If we get a resolution, I'll post it here.

0 Kudos
Regular Contributor II

So if you want to create a Map Template to use on WAB Web Maps is there a step-by-step for how to set that up? I'm so lost... but I need to do this ASAP...

0 Kudos
Occasional Contributor

I haven't used custom map templates for printing with Web AppBuilder before (I used the JavaScript API for this web map).  I do know that you can add a print widget and use the "out-of-the-box" map templates.

Here is the Print Widget documentation for Web AppBuilder:

Print widget—Web AppBuilder for ArcGIS | ArcGIS

Taking a closer look at the Print Widget documentation, I think you can tell it to use your own custom print service... assuming you are able to create one.  I have ArcGIS for Server at my workplace, so I was able to create custom mxd templates and publish a print service using that.  I don't know of any other way to create custom mxds and print services without ArcGIS Server.

If you do have ArcGIS for Server, here is a tutorial page on how to publish a print service:

ArcGIS Help (10.2, 10.2.1, and 10.2.2)

If I'm correct, once you have your mxds created and located in the layout templates folder, and after the print service has been published, then all you'd need to do in Web App Builder is change the service URL in the Print Widget to that of the new one you've created.

Regular Contributor II

I did setup the Print Service on our Print Server.

Even changed the settings in the WAB.

I'm still getting a blank legend.

Not sure where to go next.

0 Kudos
Occasional Contributor

Is there already a legend in the mxd?  Here's how my template mxd looks when I just open it in ArcMap (I've clicked on the legend so you can see its extent in teal):


If it's possible, it could be helpful to share the URL of your web app, so others could see exactly what it's doing.

0 Kudos
New Contributor II

Hi Zoe, have you figured out a way to solve your question 1? I am in the same situation where I need to hide layer names in the legend and have limited control over what goes into the legend.

0 Kudos
MVP Regular Contributor

Also see this ESRI technical Support Article:

How To: Configure legend properties for custom print templates from Portal for ArcGIS


0 Kudos
MVP Regular Contributor

If you still have issues fitting the dynamic legend in the printout, this is a good workaround:

In a separate mxd from the source mxd to be published (and in a different directory as well), make a legend that reflects all your desired layers.

In the legend properties, enable the fixed frame and text wrapping options, as discussed above.

Resize your legend to the desired size by the click-and-drag method on the layout UI.

Convert legend to graphic and save as jpg.

Insert picture into the layout from the source mxd to be published (which contains no layers), and save the image as part of the mxd by right-clicking>properties on the image.

In summary,

The problem w having Dynamic legend is that if have too many layers displayed, they may not all reflect in the legend.
In the case of many layers, I believe it is better to go with pic of legend.
If instead you have a few layers to display, dynamic legend is most likely ok.

0 Kudos