I'm very new to ArcGIS and I'm developing a custom widget in the ArcGIS WebApp Builder that will allow me to change the style attribute of a specific layer in my map.
To manually change the style attribute I would open the map, hover over a layer and click 'Change style':
Then I would select the style attribute from the list that appears:
At the moment my JavaScript widget allows the user to pick from a list of (manually entered) layers and style attributes:
The function that is called when the user clicks 'Update' resembles the following:
_updateAttribute: function() {
var lyr = document.getElementById("layer");
var att = document.getElementById("attribute");
var selectedLayer = lyr.options[lyr.selectedIndex].value;
var selectedAttribute = att.options[att.selectedIndex].value;
// Pseudo-code;
// map.layer(selectedLayer).Attribute = selectedAttribute;
}
Is there a way to carry out the operation represented by my pseudo-code?