Print Widget - Include legend set to false - Ignored in Print Template

121
1
3 weeks ago
GertConradie
New Contributor III

Hi

 

I use the standard print widget https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html )  In combination with a custom print service and a custom MXD print template.

When I un-tick the "Include legend" option to false/unselected, I still get legend items for all operational layers submitted as part of the JSON Export Web Map request.

I can see that the list of legend options array is empty when unticked: 

 

"legendOptions": { "operationalLayers": [] }

 

 Compared to when selected/true:

 

"legendOptions": {
			"operationalLayers": [{
				"id": "customLayers",
				"subLayerIds": [8]
			}, {
				"id": "colorsLayer",
				"subLayerIds": [0]
			}, {
				"id": "labelLayers",
				"subLayerIds": [1]
			}]
		}

 

 

The PDF generated from my custom template make no difference though - all the operational layers appear in the legend when that setting is ticked or not.

If I unselect the "Add a new item to the legend when a new layer is added to the map", then nothing appear on the legend. - It seems like that setting is used for all layers added, but only when no specific legend information are summited to the print services.  (When I experiment by submitting JSON manually and ask for legend content for a subset of the operational layers, then only those layers appear in the legend.)

Is it possible to NOT have a legend from the standard print widget?

I attached some screenshots for context 

 

 

0 Kudos
1 Reply
Noah-Sager
Esri Regular Contributor

Hi @GertConradie, thanks for the question. With the default service, the print widget can include or not include the legend: https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=widgets-print

My hunch is that this issue is related to how the custom print service was configured prior to publishing. Here is some information about sharing a custom print service from Pro: https://enterprise.arcgis.com/en/server/latest/publish-services/windows/tutorial-publish-additional-...

 

 

0 Kudos