Select to view content in your preferred language

No Legend Labels in Exported Map

571
1
06-18-2019 02:05 PM
ShawnMoore
Emerging Contributor

I'm using the ARCGIS JS API (4.11) to create a map with points. I've added a Print Widget to the map and when I generate the printable pdf, the legend does not show with labels. When I use an earlier version of the api (4.06) I see "Override 1", "Override 2", etc. as the legend labels.

I've even tried using the utility.arggisonline.com print service (only as a test), but get the same problem. Any ideas on why the print widget doesn't show labels but the map does?  (codepen link below)

The map: 

The exported pdf using the Print widget - no labels for the Legend.

Here is a code pen illustrating the problem.   I've tried to distill this down to a fairly simple small'ish example (with hardcoded json data as the source data). 

Anyone see any obvious problems?  (note: to view the pdf, you might have to right click it and save it locally after you click export.)

Here's the code pen link:  https://codepen.io/snmoore/pen/XLjzMb

Thanks in advance for any input or suggestions!

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Shawn,

   You need a label property in your renderer unique values objects. Right now you have a value property and you need a label property.

      {
            value: "Special Needs",
            label: "Special Needs",
            symbol: {
                type: "simple-marker",  // autocasts as new SimpleFillSymbol()
                color: [221, 93, 153],
                size: "20px",
                outline: { // autocasts as new SimpleLineSymbol()
                    color: [111, 45, 75],
                    width: 1
                }
            }
        }