AnsweredAssumed Answered

Add Feature Layer to Webmap

Question asked by H.Bouckaert_westernpower on Jun 19, 2018
Latest reply on Aug 30, 2018 by gnomic.admin

Hi 

 

I have upgraded my ArcGIS Pro to version 2.1 because I thought limitations on functions available for the arcgis.gis package in ArcGIS Pro 2.0 were the problem. Now, with ArcGIS Pro 2.1 I am using arcgis.gis 1.2.5 (which is the highest version available with ArcGIS Pro 2.1), but all the examples I see online are for arcgis.gis 1.4.2. So this is my first question - is there any way to use the latest version of arcgis.gis within ArcGIS Pro?  The vast majority of functions in arcgis.gis 1.4.2 seems to be unavailable in arcgis.gis 1.2.5.   

 

Basically all I would like to do is add feature layers to a webmap. 

 

Ideally I would like to clone a web map, and then change the URLs and other item properties so that the new webmap has the same layout compared to the old one but uses different feature services. The best examples I have come across are: 

 

Add Feature Service Item to WebMap 

 

This example uses a dictionary, but it is never explained where "base.json" in the code is coming from to load into the dictionary so I cannot replicate this code. The other example is: https://community.esri.com/thread/193550-web-map-created-with-python-api-and-feature-services-not-displaying-features

But here (all the way below) a function is used "clone_items" and also webmap.layers[0] is used, neither of which are available to use with my arcgis.gis 1.2.5 (which is all that is available in ArcGIS Pro 2.1).

 

So given I am limited to working with arcgis.gis 1.2.5 (because I want to use anaconda within an ArcGIS Pro environment), how can I add feature layers to a webmap?

 

All functions available for use with a webmap object (in this case named "northam_wm") are listed below, but none of them seem to allow adding a feature layer.  

 

 

I have spent several hours on this now and it looks like this cannot be done. Surely even the earlier arcgis.gis API 1.5.0 should be able to handle this? A code example would be greatly appreciated. 

 

Thanks

 

Hugo  

Outcomes