WAB change symbology

4663
5
Jump to solution
01-18-2016 06:38 AM
OndrejFialík
New Contributor II

Hello,

how can I dynamically change the symbology on layers? I need to temporarily change the symbology for the selected layer.

Thanks

Ondra

1 Solution

Accepted Solutions
GirishYadav
Occasional Contributor

Ondrej,

If the layer is GraphicsLayer or FeatureLayer then simply use .setRenderer(renderer) method to change the renderer.

FeatureLayer | API Reference | ArcGIS API for JavaScript

And if its ArcGISDynamicServiceMapLayer then you need to use .setLayerDrawingOptions() method.

ArcGISDynamicMapServiceLayer | API Reference | ArcGIS API for JavaScript

-Girish

View solution in original post

5 Replies
MichaelRobb
Occasional Contributor III

Hi,

It would be nice to have a more detailed post of what you are asking, but I will attempt to guess...

If you are referring to changing the symbology on a publishing level (not a user having the ability to change the symoboloy)

Symbology can be changed on the Web Map level. 

Left click on the layer in the web Map >> Change Style

1.png

Ref:

Change style—ArcGIS Online Help | ArcGIS

OndrejFialík
New Contributor II

I need change style in WebAppBuilder application. Seeking a way the user can edit the layer style via widget.

I use jimu/dijit/SymbolChooser for create SimpleRenderer bud i dont know how change layer style.

0 Kudos
GirishYadav
Occasional Contributor

Ondrej,

If the layer is GraphicsLayer or FeatureLayer then simply use .setRenderer(renderer) method to change the renderer.

FeatureLayer | API Reference | ArcGIS API for JavaScript

And if its ArcGISDynamicServiceMapLayer then you need to use .setLayerDrawingOptions() method.

ArcGISDynamicMapServiceLayer | API Reference | ArcGIS API for JavaScript

-Girish

OndrejFialík
New Contributor II

Hi Girish,

thanks!!!

LayerDrawingOptions is what I was looking for.

Ondra

0 Kudos
KisakyeM
New Contributor III

@OndrejFialík did you ever get this to work? Do you mind sharing the code that you used?

0 Kudos