Select to view content in your preferred language

GeoJSON Labels when Field is an Object

01-23-2023 11:44 AM
New Contributor II


I am trying to make a GeoJSON Layer from a source I do not control. I have a property in the GeoJSON (example below) that is actually an Object, not a string/number, etc, and I am attempting to display labels on the map, but can only access the root objects.

The labelingInfo is the class I am trying to get working properly. As you can see in the linked code pen example, I am unable to get the core_details (or hopefully, core_details.device_type) to display. Any help would be greatly appreciated!

            "geometry": {
                "coordinates": [
            "properties": {
                "core_details": {
                    "description""Arrow Panel, Display Down",
                "custom": {
                    "location_details": {


0 Kudos
2 Replies
New Contributor

Did you ever figure this out? Is it possible. I have seen some GEOJson examples that have an object but not how to access it.

0 Kudos
Esri Regular Contributor

It's not possible to use fields inside an object directly.  However, you can use RequestInterceptor to flatten the field structure so that you can use the field data from inside field objects.

See for example -- which uses RequestInterceptor to create new fields like "core_details__device_type".


cc: @JulianDurantini , @ScottSurber 

[Update] Looks like @UndralBatsukh already answered this in the original issue post --


0 Kudos