1

I want to change layer color with every click of a button. So far I have been able to do lots working with the layer object alone, for example schools= this.map.getLayer("schools"). However, there are no methods for dealing with the symbology on the layer object.

I've seen documentation for changing symbology of graphics layers, however. But I'm not sure how to implement that from where I am now. How do I reference a graphics layer from my layer and access the fill methods? Or am I misunderstanding these objects to begin with?

2

You need to use a renderer.

Use this example provided by ESRI: https://developers.arcgis.com/javascript/3/jssamples/renderer_legend.html

Here is a fiddle of it:

https://jsfiddle.net/kreza/g9omqj3j/54/

Might need to pan to get items to refresh but it should get you going.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.