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-symbols-2d/) 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.
Hi @KarthikeyanShanmugam ,
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.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.