Allow displaying ONLY symbology in map extent for Print task Legend in JavaScript API viewer

4139
9
12-16-2014 10:46 AM
Status: Implemented
KevinMacLeod1
Occasional Contributor III

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

9 Comments
MatthewKing

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)

Portal/Online - Print Templates: add option to place legend on separate page or extent based legend ... 

Embedded Webmap legend to display only features in current extent 

layerlist symbology only if visible in extent 

https://community.esri.com/ideas/13817 

by Anonymous User

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.

ericmeyers1

Its been 5 years since this was first posted... how has this not been fixed yet?

4_AssetDesenvolvimento

This still don't was fixed? I'm using version 3.34.

FC_Basson

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.

4_AssetDesenvolvimento

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?

Yuhash
by

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!

TanuHoque

@Yuhash 

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:

  1. your print service must be published
    • from arcgis pro (2.4 or newer) and
    • on a 10.7.1 or a newer server
  2. your map service must follow the same rule i.e.
    • it must be published from arcgis pro (2.4 or newer) and
    • must be running on a 10.7.1 or newer server

 

Please let me know if it helps. Otherwise, please send me reproducible steps and I can take a look at this.

Tanu

AmyNiessen
Status changed to: Implemented

Per @TanuHoque, this has been implemented.