Hello,
I want to add a Feature Layer Collection to an existing WebMap. My WebMap already has layers, but I want to add the ones on my Feature Layer Collection. I tried using 'add_layer' but I get the following error:
AttributeError: 'list' object has no attribute 'add_layer'
# get webmap
dispatchers_map = gis.content.search(f'title:{name_project} Dispatcher Map',
'Web Map',
outside_org=False)
# get feature layer collection
f_layer = gis.content.search(f'title:{pr_layer}',
'Feature layer',
outside_org=False)
# add flc to webmap
dispatchers_map.add_layer(f_layer)
Thanks
Solved! Go to Solution.
I found the way 🙂
# using WebMap to use my web map
dispatcher_map = WebMap(disp_map)
print(dispatcher_map)
# add_layer
dispatcher_map.add_layer(f_layer[0])
# properties
webmap_item_properties = {'title':'name of existing Web Map'}
# update web map
dispatcher_map.update(webmap_item_properties)
I found the way 🙂
# using WebMap to use my web map
dispatcher_map = WebMap(disp_map)
print(dispatcher_map)
# add_layer
dispatcher_map.add_layer(f_layer[0])
# properties
webmap_item_properties = {'title':'name of existing Web Map'}
# update web map
dispatcher_map.update(webmap_item_properties)