Python - 保存地图 - 使用 ArcGIS - 'NoneType' 对象不可下标

问题描述

webmap_properties = {'title':'My first map of badminton courts in HK','snippet': 'Jupyter notebook saved as a webmap','tags':['automation','python','ArcGIS Notebooks']}
my_first_map.save(webmap_properties)

它说“nonetype”对象不可下标,我该怎么办?

解决方法

你如何声明 my_first_map

这可能有用

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

my_first_map = WebMap()

webmap_properties = {'title':'My first map of badminton courts in HK','snippet': 'Jupyter notebook saved as a webmap','tags':['automation','python','ArcGIS Notebooks']}

my_first_map.save(item_properties=webmap_properties)

无论如何,这里有一些可能会有所帮助的示例: https://developers.arcgis.com/python/sample-notebooks/publishing-web-maps-and-web-scenes/