My layer looks like this:
Drawing Info:
Renderer:Unique Value Renderer:
Field 1: BLPU_CLASS
Field 2: null
Field 3: null
Field Delimiter: ,
Default Symbol: N/A
Default Label: null
UniqueValueInfos:
Transparency: 0
Labeling Info:
When using the feature layer like so:
var layer = new FeatureLayer({
url: "https://.../arcgis/rest/services/External_Maps/All_Data_Points/MapServer/6",
title: "...",
visible: false
});
I get this error in my console:
[esri.layers.FeatureLayer] [outFields] Invalid field: BLPU_CLASS
This occurs for any layer like above, with multiple symbol types on the layer. They appear in the layerlist but nothing is shown when I toggle the layer in question. Layers that only have one symbol type work fine as intended.
Shakil,
Try adding the outFields property to the constructor:
var layer = new FeatureLayer({
url: "https://.../arcgis/rest/services/External_Maps/All_Data_Points/MapServer/6",
title: "...",
visible: false,
outFields: ["*"]
});
I get a similar error with the same type of layer (multiple symbol types on the layer), but the layer it complains about for me is 'Creator'.
I have specified outFields in the constructor and still get this problem. Although I am not outputting all fields as shown in the example, I am only specifying a certain subset of fields that I need for popups to work properly.
William,
You also have to be sure you include any fields used in the renderer as well.