Select to view content in your preferred language

Unable to generate Web-Style symbol using 4.28 version of the symbolUtils SDK

95
0
Tuesday
AllenHuang
Occasional Contributor

I am attempting to build a custom legend widget using the 4.28 SDK. I could generate all the standard simple symbols except for Web-Style symbol. The following is the code I used.

symbolUtils.renderPreviewHTML(new WebStyleSymbol({
  name: "Armadillo",
  styleUrl: "https://cdn.arcgis.com/sharing/rest/content/items/1fbb242c54e4415d9b8e8a343ca7a9d0/data"
}),
{
  node: document.getElementById('markerTest'),
  size: 16 
}); 

 

Here is the error message

AllenHuang_0-1754659479419.png

The error seem to have started at g.previewWebStyleSymbol @ previewWebStyleSymbol.js:5 

I found that this code only works with SDK 4.32 or later. Any SDK earlier would, renderPreviewHTML will not generate html segement for the symbol.

But the standard legend widget is still able to render all the symbol previews. So it would seem that there should be another way to generate symbols with the older SDK version. Does anyone know how to generate a webstyle symbols HTML in the older version of the SDK

0 Kudos
0 Replies