Select to view content in your preferred language

How to Share a Feature Layer as a Web Layer using ArcGIS Pro SDK?

368
5
Friday
AbhijeetNandeshwar1
Occasional Contributor

Hello everyone,

I’m trying to replicate the “Share As Web Layer” functionality (shown in the screenshot) using the ArcGIS Pro SDK.

Here are my questions:

  1. Is there a direct API in ArcGIS Pro SDK to share a feature layer (or raster layer) as a web layer to ArcGIS Online / Enterprise?

  2. If not, is there any workaround through the SDK that mimics the desktop workflow (right-click → Share As Web Layer)?Share as a web layer.png

Any insights, documentation links, or code examples would be very helpful.

Thanks in advance!

@UmaHarano , @Wolf 

0 Kudos
5 Replies
AbhijeetNandeshwar1
Occasional Contributor

Hello,

@UmaHarano , @Wolf , @GKmieliauskas ,

Please could someone help me with this query?
It would be a great help if anyone could provide some insights.

Regards,
Abhijeet

0 Kudos
UmaHarano
Esri Regular Contributor

@AbhijeetNandeshwar1 

I am not aware of a way to accomplish this with the API. 
I recommend posting this request in the Pro ideas site for the API support.

Wolf
by Esri Regular Contributor
Esri Regular Contributor

I am trying to find the script / GP tool that can be used to 'share' or 'publish' a feature layer as a web layer.  Until then you can at least present your users programmatically with the 'share feature layer as web layer' dockpane using this snippet:

IPlugInWrapper wrapper = FrameworkApplication.GetPlugInWrapper("esri_sharing_SharingAsWebLayerPaneBtn");
if ((wrapper is ICommand command) && command.CanExecute(null))
            command.Execute(null);

 

0 Kudos
Wolf
by Esri Regular Contributor
Esri Regular Contributor

After some digging we found this:
An overview of the Publishing toolset—ArcGIS Pro | Documentation
which indicates that it is possible to publish a feature layer as a web layer.  It appears that to accomplish this is very complicated.  I will try to publish a sample that publishes a feature layer as a web layer.  I'll put the sample on this thread as well - if i can get it to work.

AbhijeetNandeshwar1
Occasional Contributor

Thank you @Wolf , I am waiting for you to provide me with a example.

0 Kudos