使用 Python API 时 ArcGIS Online Dashboard 未加载

问题描述

我正在尝试创建一个 WebMap,它将用作 ArcGIS 仪表板中的小部件。我是通过 ArcGIS API for Python 执行此操作的。我成功创建了仪表盘,我可以在 ArcGIS Online 的内容中看到它。但是,当我点击仪表板时,没有加载任何内容,我看到的只是一个空白屏幕。

每当我尝试使用此 API 创建 WebMap 时,都会遇到同样的问题。当我点击 WebMap 时,我只看到一个空白屏幕。但是,我可以通过单击“在 MapView Classic 中打开”来解决此问题。当然,仪表板经典选项中没有打开,所以我被这个问题困住了。提前致谢。

#Creating WebMap that will become a widget in the dashboard

from arcgis.mapping import WebMap

search = g.content.search(title,item_type="Feature Layer")
map = WebMap()
item = search[0]
map.add_layer(item)
props = {'title': title,'snippet': 'hwa','tags': 'python',"renderer": "autocast","field_name": "Threat",}
map.save(props)

g.content.search(title,item_type='Web Map')[0].share(everyone=True)
g.content.search(title,item_type='Feature Layer')[0].share(everyone=True)
g.content.search(title,item_type='CSV')[0].share(everyone=True)


#Creating Dashboard

from arcgis.apps.dashboard import Dashboard,add_column,add_row
dashboard = Dashboard()
dashboard.layout = add_row(WebMap (map))
dashboard.save("Sample Dashboard")

g.content.search(query="title:Sample Dashboard1",item_type='Dashboard') 
[0].share(everyone=True)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)