Getting value coded of domain from map layer with arcgis javascript api
You can get this from the FeatureLayer
class. There is an attribute called fields
, which is an array of Field
objects. The Field
class has domain
attribute.
The following will output the domains in the console (if any):
var map = new Map(...);
var fl = new FeatureLayer(...);
map.addLayer(fl);
// when layer is ready
fl.on("load", ()=>{
for (var i = 0; i < fl.fields.length; i++) {
console.debug(fl.fields[i].domain);
}
});
Good luck!