0

I have a python script where I'm trying to add a feature layer to a webmap. The script completes without any errors but the feature layer doesn't get added.

Here's the code in question:

from arcgis.gis import GIS
from arcgis.mapping import WebMap

print("Logging in...")
gis = GIS("https://fotnf.maps.arcgis.com/", "XXXXXXX", "YYYYYYYY")
print(f"Connected to {gis.properties.portalHostname} as {gis.users.me.username}")

webmap_item = gis.content.get('e1405425e52d43689cfdaecd43e0239d')
feature_layer = gis.content.get('cc5eb6737f5441c48f2ea1c5ab42935e')
webmap = WebMap(webmap_item)

print("Adding layer")
webmap.add_layer(feature_layer)
print("Done")

Here's a screenshot of the Content pane in arcgis online. The code is attempting to add the Join_2_12_23 feature layer to the Test Mesa map. enter image description here

The version of the arcgis python package is 2.1.0.3

opike
  • 7,053
  • 14
  • 68
  • 95

0 Answers0