Select to view content in your preferred language

CSV Layer JS Id

1098
2
Jump to solution
10-26-2016 08:32 AM
ChristopherSchreiber
Frequent Contributor

Hello all,

I have been working on adding a layer to a map that is based on a CSV table. I am using v3.18 of Esri's JS API to do this. I am having an issue that when I set the "id" of the CSV layer to "Incidents" it still shows up in the layer-list as "csv". 

Layer:

       csvLayer: new CSVLayer("/csv/Incidents_test.csv", {
              copyright: "Knowledge Center",
              id: "Incidents",
              refreshInterval: 2,
              infoTemplate: kcPopup.csvPopup
          })

What shows in the Layer-list widget:

I am guessing that somewhere the "id" property is being overwritten. I am not sure where though.

Thanks!

Chris

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Chris,

   Sure all you need to do is supply a title property in the LayerList layers constructor:

            var myWidget = new LayerList({
               map: map,
               layers: [{
                 layer: csv,
                 id: "Incidents",
                 subLayers: true,
                 title: "Blah Blah"
               }]
            },"layerList");

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Chris,

   Sure all you need to do is supply a title property in the LayerList layers constructor:

            var myWidget = new LayerList({
               map: map,
               layers: [{
                 layer: csv,
                 id: "Incidents",
                 subLayers: true,
                 title: "Blah Blah"
               }]
            },"layerList");
0 Kudos
ChristopherSchreiber
Frequent Contributor

Thanks Robert, 

I was using the "layers" array but I was not including the "Title" property. That is what I was missing.

Chris

0 Kudos