Select to view content in your preferred language

Equivalent -- Experience Builder -- Add Data Widget

216
2
Jump to solution
08-07-2024 04:02 PM
spence_amzn
Occasional Contributor

Hi folks,

I am hitting a brick wall and cannot for the likes of me find the functionality (native) to be able to add a "Add Data" widget like functionality to dynamically add feature layers to a map? Anyway have tips and/or a pointer to look at?

spence_amzn_0-1723071743974.png

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
GeoGalvanic
Occasional Contributor

If you already have the item id for the layer you're trying to add, the process is pretty simple using a portalItem.

PortalItem | API Reference | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer

 

If you want users to be able to search for layers in your portal, you can use the portal class and it's queryItems method to grab a list of portalItems

Portal | API Reference | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer

Then you just need to go about adding the portalItem to the map.

 

If you want users to be able to upload features from files, you'd need to handle the uploading portion and then parse the file contents into a layer. 
Feature Layer has good documentation for creating from an array of client side graphics.

FeatureLayer | API Reference | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer

View solution in original post

2 Replies
GeoGalvanic
Occasional Contributor

If you already have the item id for the layer you're trying to add, the process is pretty simple using a portalItem.

PortalItem | API Reference | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer

 

If you want users to be able to search for layers in your portal, you can use the portal class and it's queryItems method to grab a list of portalItems

Portal | API Reference | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer

Then you just need to go about adding the portalItem to the map.

 

If you want users to be able to upload features from files, you'd need to handle the uploading portion and then parse the file contents into a layer. 
Feature Layer has good documentation for creating from an array of client side graphics.

FeatureLayer | API Reference | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer

spence_amzn
Occasional Contributor

DOH!!! Right in front of my darn face. Thank you so much.

0 Kudos