Select to view content in your preferred language

UniqueValueRenderer.fromJSON not working when loading JSON from a lyrx file.

99
1
2 weeks ago
Flookfinders
Occasional Contributor

I am trying to use a lyrx file to render a shp file that I have loaded in to the JavaScript SDK using a GeoJSONLayer.  The shape file is being displayed, but it is not being rendered correctly. I have extracted the renderer JSON from the lyrx file and got the JSON in the attached file.

I have then used UniqueValueRenderer.fromJSON method to use this JSON to create the renderer. I then use  this in the GeoJSONLayer. The data is displayed, but it is using the defaultSymbol not the symbols listed in the groups. On investigating the renderer that is created the uniqueValueGroups and uniqueValueInfos are both null.

0 Kudos
1 Reply
JoelBennett
MVP Regular Contributor

The JSON provided does not match the definition of a UniqueValueRenderer object, and therefore cannot be read.  Instead, it provides the definition for a renderer of type "CIMUniqueValueRenderer" for which the SDK doesn't appear to have any support.

0 Kudos