I am having trouble getting each individual layer within an ArcGISDynamicMapServiceLayer to display an InfoTemplate on popup using ArcGIS API for JavaScript 3.24. There are seven layers within the ArcGISDynamicMapServiceLayer, two of which have parent layers. All the layers not within a parent layer display correctly. However, none of the sub layers will display their InfoTemplate.
My question is, what is the proper format of the infoTemplates object when an ArcGISDynamicMapServiceLayer contains sub layers?
Here is a screen shot of the layerInfos from the service:
...and here is the format I'm following:
var infoTemplates = {
0: {
infoTemplate: new InfoTemplate("test", "${*}"),
layerUrl: null
},
2: {
infoTemplate: new InfoTemplate("test", "${*}"),
layerUrl: null
},
3: {
infoTemplate: new InfoTemplate("test", "${*}"),
layerUrl: null
},
4: {
infoTemplate: new InfoTemplate("test", "${*}"),
layerUrl: null
},
5: {
infoTemplate: new InfoTemplate("test", "${*}"),
layerUrl: null
},
6: {
infoTemplate: new InfoTemplate("test", "${*}"),
layerUrl: null
},
7: {
infoTemplate: new InfoTemplate("test", "${*}"),
layerUrl: null
}
};
map.addLayer(
new ArcGISDynamicMapServiceLayer(someURL, {
id: someID,
infoTemplates: infoTemplates,
})
);