Hello
I am trying to render the list of the available webstyle symbols (https://developers.arcgis.com/javascript/latest/visualization/symbols-color-ramps/esri-web-style-sym...) outside the map. Is there any api which I can access to get the webstyle symbol thumbnail and the name.
Any suggestions would be helpful.
Thank you.
Solved! Go to Solution.
You can use the symbolUtils.RenderPreviewHTML method to generate a preview image of any symbol in any DOM element. Here is a simple codepen showing it in action. https://codepen.io/sagewall/pen/XWyparb
I'd also recommend looking at this Adjust marker placement in polygon symbols sample, specifically the initializeWebStyles function on line 271. This demonstrates how you can use esri/request to fetch the Web Style JSON, and use that to find the name and image for each symbol in the style. Hope this helps!
You can use the symbolUtils.RenderPreviewHTML method to generate a preview image of any symbol in any DOM element. Here is a simple codepen showing it in action. https://codepen.io/sagewall/pen/XWyparb
I'd also recommend looking at this Adjust marker placement in polygon symbols sample, specifically the initializeWebStyles function on line 271. This demonstrates how you can use esri/request to fetch the Web Style JSON, and use that to find the name and image for each symbol in the style. Hope this helps!
Thank you @Sage_Wall @AnneFitz . Both of them worked.