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.
-
2Are 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.PolyGeo– PolyGeo ♦2019年12月02日 19:51:53 +00:00Commented Dec 2, 2019 at 19:51
1 Answer 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.
-
1Here is a code snippet that uses the share() method: community.esri.com/thread/…artwork21– artwork212019年12月02日 20:30:16 +00:00Commented 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 notGustavo– Gustavo2019年12月02日 22:00:41 +00:00Commented 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.Gustavo– Gustavo2019年12月02日 22:05:43 +00:00Commented 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 accordinglyamadbear– amadbear2019年12月02日 22:09:00 +00:00Commented Dec 2, 2019 at 22:09
-
1Sorry, 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.Gustavo– Gustavo2019年12月02日 22:17:33 +00:00Commented Dec 2, 2019 at 22:17
Explore related questions
See similar questions with these tags.