Hello, first I want to say thank you for this lovely UI!
At the moment, I am trying to bring the Corona Footer back (Germany). I want to get my data through this URL: Data
Which delivers me this code:
{
"objectIdFieldName": "ObjectId",
"uniqueIdField": {
"name": "ObjectId",
"isSystemMaintained": true
},
"globalIdFieldName": "",
"fields": [
{
"name": "AdmUnitId",
"type": "esriFieldTypeInteger",
"alias": "AdmUnitId",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "BundeslandId",
"type": "esriFieldTypeInteger",
"alias": "BundeslandId",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzFall",
"type": "esriFieldTypeInteger",
"alias": "AnzFall",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzTodesfall",
"type": "esriFieldTypeInteger",
"alias": "AnzTodesfall",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzFallNeu",
"type": "esriFieldTypeInteger",
"alias": "AnzFallNeu",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzTodesfallNeu",
"type": "esriFieldTypeInteger",
"alias": "AnzTodesfallNeu",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzFall7T",
"type": "esriFieldTypeInteger",
"alias": "AnzFall7T",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzGenesen",
"type": "esriFieldTypeInteger",
"alias": "AnzGenesen",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzGenesenNeu",
"type": "esriFieldTypeInteger",
"alias": "AnzGenesenNeu",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzAktiv",
"type": "esriFieldTypeInteger",
"alias": "AnzAktiv",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "AnzAktivNeu",
"type": "esriFieldTypeInteger",
"alias": "AnzAktivNeu",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
},
{
"name": "Inz7T",
"type": "esriFieldTypeDouble",
"alias": "Inz7T",
"sqlType": "sqlTypeFloat",
"domain": null,
"defaultValue": null
},
{
"name": "ObjectId",
"type": "esriFieldTypeOID",
"alias": "ObjectId",
"sqlType": "sqlTypeInteger",
"domain": null,
"defaultValue": null
}
],
"features": [
{
"attributes": {
"AdmUnitId": 0,
"BundeslandId": 0,
"AnzFall": 7297320,
"AnzTodesfall": 112925,
"AnzFallNeu": 58912,
"AnzTodesfallNeu": 346,
"AnzFall7T": 215078,
"AnzGenesen": 6581800,
"AnzGenesenNeu": 49900,
"AnzAktiv": 602600,
"AnzAktivNeu": 8700,
"Inz7T": 258.6,
"ObjectId": 101
}
},
{
"attributes": {
"AdmUnitId": 8127,
"BundeslandId": 8,
"AnzFall": 19455,
"AnzTodesfall": 286,
"AnzFallNeu": 78,
"AnzTodesfallNeu": 0,
"AnzFall7T": 434,
"AnzGenesen": 18500,
"AnzGenesenNeu": 100,
"AnzAktiv": 700,
"AnzAktivNeu": 0,
"Inz7T": 219.3,
"ObjectId": 355
}
}
]
}
Is there a way that I can display “AnzFallNeu”, “AnzTodesfallNeu” and “AnzGenesen” from the first attributes section and “Inz7T” from the second one in the footer?
I guess I have to get it in here somehow, don’t I?
state_display: >
[[[
if (entity && entity.attributes.embedCode != undefined) {
let data = entity.attributes.embedCode,
total = data.match(/Totalt[^,]*?(\d+)[^,]*?(\d+)[^,]*?(\d+)/),
spacer = ' <font color="#2f3436">|</font> ';
return `
<ha-icon icon="mdi:virus"></ha-icon> <b>Coronavirus</b>${spacer}
<ha-icon icon="mdi:chart-bar"></ha-icon> <b>${(parseFloat(total[1]) / 10327589 * 100).toFixed(2)}%</b> av Sverige${spacer}
<ha-icon icon="mdi:emoticon-sad"></ha-icon> <b>${total[1]}</b> fall${spacer}
<ha-icon icon="mdi:grave-stone"></ha-icon> <b>${total[3]}</b> avlidna${spacer}
<ha-icon icon="mdi:map-marker-radius"></ha-icon> <b>${data.match(/Skåne[^,]*?(\d+)/)[1]}</b> fall i Skåne
`;
}
]]]
I tried now pretty much everything but can’t get it to work. Can somebody help me? Thanks!