0

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':

enter image description here

Then I would select the style attribute from the list that appears:

enter image description here

At the moment my JavaScript widget allows the user to pick from a list of (manually entered) layers and style attributes:

enter image description here

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?

asked Aug 23, 2018 at 16:13

1 Answer 1

-1

this sample actually shows what you want to do (click "Explore in the Sandbox" to see live demo)

answered Aug 23, 2018 at 22:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.