问题描述
我需要在地图上的工具提示中显示一些数据,例如国家名称下方的病例、死亡人数和报告日期。这是我的地图:
在国家/地区名称下方,我想在工具提示中显示其他数据,这些数据是通过此代码获得的:
I/flutter (20998): reconnect_error: WebSocketException: Connection to 'http://192.168.1.8:3000/socket.io/?EIO=3&transport=websocket#' was not upgraded to websocket
这是我的 json 文件示例:
# Print data from JSON file
with open('DailyUpdatedReport.json') as json_file:
data = json.load(json_file)
for p in data['records']:
print('Date: ' + p['dateRep'])
print('Cases: ' + str(p['cases']))
print('Deaths: ' + str(p['deaths']))
Example Result :
Date: 01/03/2021
Cases: 669001
Deaths: 13073
这是我的 GeoJason 代码示例:
{
"records" : [
{
"dateRep" : "03/05/2021","day" : "03","month" : "05","year" : "2021","cases" : 1732,"deaths" : 11,"countriesAndTerritories" : "Austria","geoId" : "AT","countryterritoryCode" : "AUT","popData2020" : "8901064","continentExp" : "Europe"
},
我认为我应该将 JSON 文件中的国家代码与 GeoJson 文件中的国家代码匹配,但我不知道如何匹配。请帮忙
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)