1

I already know how to share a layer, or create a empty webmap (and add layers after its creation) through Python on ArcGIS Pro. However I could not find a way to share a Web Map trough Python.

By that I mean uploading a map to AGOL, with all the current layers (either these layers being online or local). The way to do this on ArcGIS Pro is very straight forward (you just press Share as a Web Map, fill 3 fields and that is it), but I wonder if its possible to do through Python.

I'm write the code trough a Python Toolbox in ArcGIS Pro.

asked Dec 2, 2019 at 18:40
1
  • 2
    Are you trying to do this using ArcPy, the ArcGIS API for Python or another Python library? From your tags and text I don’t think it is possible to tell. Commented Dec 2, 2019 at 19:51

1 Answer 1

1

So, I believe what you want would be found in the ArcGIS API for Python. There is a "share()" method under the "Item" class. Please have a look at the documentation here and see if this helps. https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.share. If you haven't done so already, you can use Jupyter Notebooks that comes installed with Pro to use interactive scripting with AGO.

answered Dec 2, 2019 at 20:22
6
  • 1
    Here is a code snippet that uses the share() method: community.esri.com/thread/… Commented Dec 2, 2019 at 20:30
  • artwork21: Thanks for your answer. However, it only shares a layer in that example (which I actually use in my code). I'm looking for web maps. I thought it would be straightforward (replace the layer to a map or something), but it is not Commented Dec 2, 2019 at 22:00
  • amadbear: I dont quite follow. Reading it looks like it only changes the sharing properties of the item. Changing the sharing to groups and everyone does not make sense if the map is not even available in first place. Commented Dec 2, 2019 at 22:05
  • Gustavo: so naturally, you'd have to create the item in AGO first, which would 1) be available to the user account that did the creation, and 2) generate a itemid that you could use afterward to share accordingly Commented Dec 2, 2019 at 22:09
  • 1
    Sorry, I guess I did not communicate properly then. I don't want to actually share, but instead upload. I wrote "Share" because that is how the ArcGIS Pro calls it, when you want to upload an offline Map on AGOL. My goal is to do exactly what the "Share as a Web Layer" thing does, but in Python. Commented Dec 2, 2019 at 22:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.