How users can add their content from portal to the map?

433
2
Jump to solution
03-24-2021 06:17 PM
by Anonymous User
Not applicable

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. 

 

AdamArcichowski_0-1616634780651.png

 

0 Kudos
1 Solution

Accepted Solutions
LongDinh
Occasional Contributor II

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. 

LongDinh_0-1616648118354.png

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 

View solution in original post

2 Replies
LongDinh
Occasional Contributor II

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. 

LongDinh_0-1616648118354.png

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 

by Anonymous User
Not applicable

Thanks, I see how it works now! 

 

0 Kudos