Adding an item to a web map
Once you have passed the credentials of your GIS or organizational account to the GIS
object, you can access the items in your account and add them to a map. First, we can visualize all the items within your organization. To do this, we will import the IPython.display
library and then we will use the content.search
method to find all items with 'SF'
in the description. After we have found all the items that have 'SF'
in them, we can loop over each item and display them:
from IPython.display import display items = gis.content.search('SF') for item in items: display(item)
The preceding code is implemented as follows:

Next, we can use a list comprehension to find SF_BusStops
and add it to our sf_map
object we created earlier:
add_item = [bus_item for bus_item in items if bus_item.title == "SF_BusStops"] sf_map.add_layer(add_item[0])
Following screenshot represents the preceding code in Jupyter:

If you scroll up in Jupyter back to the top where we created our sf_map...