ESRI Leafley creating FeatureLayer with data in an array

546
1
Jump to solution
11-10-2021 08:59 AM
Labels (1)
bushrasyed
New Contributor

Hello, I am currently attempting to parse an array of assets and their locations and insert it into an ESRI feature layer that I can add to my map.

This is what the objects in the array look like:

bushrasyed_0-1636563290213.png

I was wondering if it would be possible to convert the array into a Feature collection, or if it needs to be a JSON object? If it is possible what steps could I take?

 

This is my current map, where assets is the array I want to convert into a feature collection:

bushrasyed_1-1636563508893.png

 

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
GavinRehkemper
Esri Contributor

I do not see any geometry information (for example, latitude/longitude) in your screenshot - do you have that info for each asset? If not, that would be the first step. Then you can add them using Leaflet (for example, L.Marker). If you want to transform it into a GeoJSON FeatureCollection, you can use L.geoJSON - that would work too.

View solution in original post

0 Kudos
1 Reply
GavinRehkemper
Esri Contributor

I do not see any geometry information (for example, latitude/longitude) in your screenshot - do you have that info for each asset? If not, that would be the first step. Then you can add them using Leaflet (for example, L.Marker). If you want to transform it into a GeoJSON FeatureCollection, you can use L.geoJSON - that would work too.

0 Kudos