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?
Solved! Go to Solution.
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
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
DOH!!! Right in front of my darn face. Thank you so much.