My UI is set up with 2 lists. The first list shows the symbols of a selected feature layer. The second list shows options of what a symbol can be changed to.
For example, if the layer's renderer has a single picturemarkersymbol, the image displays in one list and the second list will show a series of graphics the user can select from.
Another example, if the layer's renderer has a collection of symbols (some picturemarkersymbols, some simplemakersymbols), all of the symbols are represented in the first list and the second list shows a series of images.
The idea is to select 1 from the first list and 1 from the second list. When the user submits, the new symbols should replace the old symbol.
I have everything done except for updating the symbols. Breaking down my code, and simplifying it, I have:
var path = jqueryUnorderedList.find('img')[0].attributes['src'].value;
map.getLayer(id).renderer.symbol.setUrl(path);
Nothing happens. The original PMS still exist on the map. What am I missing?
Also, what's the proper way to change renderer's completely? If I have a SMS and want to change to a PMS, do I need to setRenderer on the layer? I tried that too... nothing happens. Nothing on the map changes and nothing shows in the F12 console log.
Thank you for the help!
Solved! Go to Solution.
Did you try and run yourfeaturelayername.redraw(); after you set the render?
Also this is what I use to set the render of a featurelayer:
Did you try and run yourfeaturelayername.redraw(); after you set the render?
Also this is what I use to set the render of a featurelayer:
That was it. I was missing the redraw. I didn't know it existed.
I am using the setRenderer too if the symbol is a SMS. If the symbol is already a PMS, I just setUrl... both need redraw... apparently.
Thanks!
No problem, I had the same issue until I decided to redraw