How can users add their own data from their My Content or from a URL. Is there any classes in JS API4 that do this ?
Kind of like how the Add Data Widget works in WAB.
Solved! Go to Solution.
Hi AdamArcichowski,
You can select the drop drown in 'My Organisation' and select 'My Content' to populate a list of the user's content in Portal.
For URLs, go to the URL tab.
As for JS API4, you should be able to do something the below with the Map and Layer objects:
const layer = new FeatureLayer({ // URL to the service url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0" });
this._map.addLayer(layer )
See https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
You should be able to query the user's content through esri/Portal. See: https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html
Hi AdamArcichowski,
You can select the drop drown in 'My Organisation' and select 'My Content' to populate a list of the user's content in Portal.
For URLs, go to the URL tab.
As for JS API4, you should be able to do something the below with the Map and Layer objects:
const layer = new FeatureLayer({ // URL to the service url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA/MapServer/0" });
this._map.addLayer(layer )
See https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
You should be able to query the user's content through esri/Portal. See: https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html
Thanks, I see how it works now!