微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 Python API 时 ArcGIS Online Dashboard 未加载

如何解决使用 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 举报,一经查实,本站将立刻删除。