When a map layer has multiple classes or symbology symbols, such as a soil layer, it does not appear on the Legend in a print result from the Print dijit in the Javascript web API web map viewer.
For example, a soil layer may have 30 different soil types. However, usually a user will zoom to a block or a neighborhood, with only one or a few different soil types present on the map. Currently, soil is not displayed at all in the Legend in the Javascript viewer.
However, in the Legend options on the MXD in ArcMap 10.2.2 I noticed there is a checkbox that at first I thought would solve this problem. .... First, right click on the Legend, in the MXD, go to Properties... and the Items tab, then select the specific layer (i.e. Soil). The top checkbox states "Only show classes that are visible in the current map extent." It does exactly what we would want, in the map MXD. So for saving a map in ArcMap to a PDF or to print, this works great. But what if we want this service to be accessed through a javascript api web map? The Soil legend simply doesn't show up, because it has 30 different symbols. I thought I could click this checkbox in the Legend in the Print Template MXD, but no, you can't. It's greyed out.
I called ESRI Tech Support and they said that indeed, it is not supported. But that it is a good idea to implement and to submit to ArcGIS Ideas.
Does anyone else think this is useful? And understand what I am requesting? I have a submitted a duplicate post here I apologize but I looked briefly and didnt' see anything like it.
Thank you,
Kevin
I just came across this need today on a AGOL map that I'm making.
Also, there appears to be several other similar posts on ArcGIS Ideas that maybe should be consolidated/moved to this one (and their vote score added together)
Embedded Webmap legend to display only features in current extent
Would also be nice to more easily create more templates. And have Print task work for multiple pages. To print content on a second page or more. This would also allow printing of a "legend" page or pages(s). (Put the legend element in that print template MXD and then hit that via the print task; but first, print Widget in WAB or API must support this) Thus, we could create a template containing the legend that can fill up a whole page and run on to multiple pages to show just the symbology symbols. We used to have a static mxd we'd print and attach to paper maps for all our armory symbols at the National Guard. Because yes, with utilities, government, or other large enterprises, you're going to have a lot of symbols! Or with data like SSURGO, NWI et al. I have not gotten around to doing this yet in python but if it is simple, I put forth that it be integrated into the API or Server as a standard workflow option.
Its been 5 years since this was first posted... how has this not been fixed yet?
This still don't was fixed? I'm using version 3.34.
This is not a function of the API, but the Web Map Print Service from your server. The print templates need to be set up to filter the symbology for the visible area. This works with print services published from ArcGIS Pro and with the default Utilities Print Services from 10.7 and up. This is obviously for vector layers only and not raster layers.
In ArcMap I created the field to legend and I marked the field "Only show classes that are visible in the current map extent", when I view my map by ArcMap it is wirking well but when I try to access my map by API, its return together all legends.
Can you help with this?
When creating a custom service in ArcGIS Pro the print service does not honour the checked option in the PAGX file for the Legend display to 'Only show features visible in the map extent'.
As @FC_Basson notes above, "This is not a function of the API, but the Web Map Print Service from your server. The print templates need to be set up to filter the symbology for the visible area. This works with print services published from ArcGIS Pro and with the default Utilities Print Services from 10.7 and up."
How can the functionality be implemented for a custom print service? I am using ArcGIS Pro 2.7.1 and ArcGIS Enterprise 10.8.1
Thanks in advance!
Are you using 'feature layer' or 'map image layer aka map service layer' in your webmap?
Support to show legend patches only for the visible extent has been around for a very long time for 'feature layers' - it doesn't matter if you publish your print service from arcgis pro or arcmap.
This support for 'map image layer' came in 10.7.1. There are a few things you need to have:
Please let me know if it helps. Otherwise, please send me reproducible steps and I can take a look at this.
Tanu
Per @TanuHoque, this has been implemented.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.