Select to view content in your preferred language

Can't use feature layers that have multiple symbol types / unique value infos

907
3
11-15-2018 02:33 AM
ShakilChoudhury
Regular Contributor

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:

  • Value: CM03 
    Label: Hospital 
    Description: 
    Symbol:Picture Symbol
  • Value: CX01 
    Label: Police Station 
    Description: 
    Symbol:Picture Symbol
  • Value: CX02 
    Label: Fire Station 
    Description: 
    Symbol:Picture Symbol

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.

Tags (1)
3 Replies
RobertScheitlin__GISP
MVP Emeritus

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: ["*"]
});

0 Kudos
DougSims_GT
Regular Contributor

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.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

William,

   You also have to be sure you include any fields used in the renderer as well.

0 Kudos