How can i use "UniqueValueRenderer" for GeoJSONLayer

1265
4
07-11-2020 01:11 AM
PhiPham
New Contributor

i used GeoJSONLayer to render *.geojson file and i want to display unique value of type. However i see ESRI document( UniqueValueRenderer ) not support for GeoJSONLayer.
How can i reach it? or any solution for display unique type on ClassBreaksRenderer 
type example: ["AB", "CDE, "DEFGH, "VC", "NM"]
Thank for help

0 Kudos
4 Replies
YannCabon
Esri Contributor

Hi,

UniqueValueRenderer works with GeoJSONLayer as well. This is missing in the documentation, we'll update.

Thanks!

Yann

leeyork
New Contributor

Hi, 

Is it updated? I got the same question.

0 Kudos
YannCabon
Esri Contributor
JimBarry
Esri Regular Contributor

Here's a repo that digs into using the GeoJSONLayer a bit more:

GitHub - JimBarry/arcgis-basic-geojsonlayer: ArcGIS JS API v4.11 introduced a new GeoJSONLayer. Usin... 

Specifically this sample here, that uses the UniqueValueRenderer on codepen.io that pulls in a .geojson file hosted on the ArcGIS Open Data site:

https://codepen.io/JimBarry/pen/RmWQbP 

Extra bonus is that this sample above uses the same UniqueValueRenderer object with both the GeoJSONLayer and the FeatureLayer.

0 Kudos