feature layer title showing up twice in legend

275
3
Jump to solution
10-03-2018 09:39 AM
JaredPilbeam2
MVP Regular Contributor

These feature layers I'm working with were created from a File Geodatabase:

https://willcountygis.maps.arcgis.com/home/item.html?id=14a8dfb2cb6048f29691c5dc1405c4b5 


Here's how it looks in the legend:

If I rename a feature layer in the web map it doesn't save. So I save it and create another web map. I use that layers' service URL in my script and the title in the legend still is there twice, as it looks in the image above. 

It seems like it should be simple, but how do I change the title to just "Route 66", for example?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Jared,

  Then just specify the name of the layer in the constructor then:

                var rt66 = new FeatureLayer({
                    url: "https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/Will_County_Tourist_Attractions/Fe...",
                    name: "blah blah"
                })

View solution in original post

0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Jared,

   When you say: 

I use that layers' service URL in my script

What exactly do you mean? Are you adding the layer to the map using a FeatureLayer and the url?

0 Kudos
JaredPilbeam2
MVP Regular Contributor

Robert,

here's how it is in the script for the Route 66 layer:

var rt66 = new FeatureLayer({
                    url: "https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/Will_County_Tourist_Attractions/Fe...",
                })‍‍‍

EDIT: the service url came from the Overview tab of the feature layer's AGOL page:

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Jared,

  Then just specify the name of the layer in the constructor then:

                var rt66 = new FeatureLayer({
                    url: "https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/Will_County_Tourist_Attractions/Fe...",
                    name: "blah blah"
                })
0 Kudos