Layer name not showed in the legend when using the Web Map Printing Service (PrintTemplate in ArcGIS API for JavaScript 3.2.1)

603
1
08-28-2017 10:47 AM
YuyanHuang
New Contributor

For our web application - RMMS, we are using the PrintTemplate class in ArcGIS API for Javascript 3.2.1 to implement our "Export Map" function. The problem is that there is no layer name in the legend when we export the map, just like what is showed below

There are actually two layers on the Map - the "IDNR Conservation Opportunity Areas" layer and the "Counties" layer, but only the second layer's (the "Counties" layer's) name is showed. We cannot figure out a way to make the first layer's name show on the Map. We designed two printing templates - Landscape and Portrait in ArcMap by modifying the default templates and we published all templates on our server (ArcGIS REST 10.22) - Task: Export Web Map Task. Since the first layer changes with user input, we can only design an empty legend box of certain size in our templates. One problem we find is that when there is no layer added to the template, we cannot specify the property of legend items, which includes the setting of showing layer name or not. The default setting of Legend Item is not to show layer name (the box before "Show Layer Name" is not checked by default). Every time a new layer with multiple symbols is added, we have to manually open the "Legend Item" dialog window for a certain layer, click the "General" tab and check the box before "Show Layer Name". However, we cannot do this for the Web Map Printing Service. The whole printing task is done by the back-end of the API, which remains a black box to us. 

We also compared the PrintingTools published on our server - Task: Export Web Map Task with the PrintingTools published on the sample server - Task: Export Web Map Task  using the same data layer and the same default template (A3 Landscape). We find out that there is still no layer name showed for the first layer - "Corps Mitigation Banks" using our printing server. However, the layer name showed up by using the sample printing server. 

Map Printed out by the PrintingTools on Our Server (no layer name for the first layer)

Map Printed out by the PrintingTools on the Sample Server (layer name - "Corps Mitigation Banks" showed)

We haven't changed the default template - A3 landscape at all before publishing. We also compared the two data transfer json files and found no difference. The only difference we found is the version difference. Our version is 10.22 while the sample server's version is 10.41. We didn't find a working sample server of 10.22 by google searching, so we cannot say for sure it is the old version that is causing the trouble. 

Any ideas how we should solve this problem? 

Tags (1)
0 Kudos
1 Reply
PieterHoltzhausen1
New Contributor II

I have the same problem. Legend only gets updated from one map service and not all

0 Kudos