How to add custom legend labels with UniqueValueInfos?

701
1
Jump to solution
02-20-2019 02:13 PM
KelseyNovacek
New Contributor

I am using the CSVLayer - Project points on the fly JavaScript API sample as a base for a web map that will use a web enabled CSV file and custom images for the symbology.  I am at a loss of how to add custom labels to the legend to replace the numbers that are the default for each image i supply. 

0 Kudos
1 Solution

Accepted Solutions
KelseyNovacek
New Contributor

Got from ESRI to resolve my question.

Using the same example for reference :

At line 118 an array was added to store the values of the items in the legend I wish to display.

For example:

Line 118:  var arr = ["cat", "apple", "dog", "yes", "pear"]

At line 124 the returned value was changed to reference the array.

Line 124:  value: arr, // Category number

At line 68 the reference field was changed to reference the field in the CSV file whos values match the array values to be displayed in the legend. 

View solution in original post

0 Kudos
1 Reply
KelseyNovacek
New Contributor

Got from ESRI to resolve my question.

Using the same example for reference :

At line 118 an array was added to store the values of the items in the legend I wish to display.

For example:

Line 118:  var arr = ["cat", "apple", "dog", "yes", "pear"]

At line 124 the returned value was changed to reference the array.

Line 124:  value: arr, // Category number

At line 68 the reference field was changed to reference the field in the CSV file whos values match the array values to be displayed in the legend. 

0 Kudos