Display subtype values as labels

358
4
09-07-2022 11:50 PM
cadgism
Occasional Contributor

Hello,

Good Day to All. 

How can I display Subtype values (not Code) stored in Geodatabase as labels on a feature. Any help will be appreciated. I have the below code, not wrking

var labelClass = {
                // autocasts as new LabelClass()
                symbol: {
                    type: "text",
                    color: color,
                    haloColor: haloColor,
                    haloSize: haloSize,
                    xoffset: xoffset,
                    yoffset: yoffset,
                    font: {
                        size: fsize,
                        weight: "normal"
                    }
                },
                labelPlacement: "below-center",
                useCodedValues: true,
                labelExpressionInfo: {
                    expression: "$feature['BuildingType']"
                    //expression: "$feature['BuildingSubType']"
                }
            };
            LayerName.labelingInfo = [labelClass];

. Thank You

0 Kudos
4 Replies
Noah-Sager
Esri Regular Contributor
0 Kudos
cadgism
Occasional Contributor

Hi @Noah-Sager yes i did. Its in my code above

0 Kudos
Noah-Sager
Esri Regular Contributor

Whoops, I somehow managed not to see that. Is the service that you're using publicly accessible so I could test against it?

0 Kudos
cadgism
Occasional Contributor

Oh sorry about that . Its no public service @Noah-Sager 

0 Kudos