...
 
Commits (2)
......@@ -56,11 +56,16 @@ export default {
const data = all.filter(sensor => {
return filterExtended ? sensor.extended : true
}).map(sensor => {
const sensorData = latest.find(o => +o.id === +sensor.id)
const kitType = sensor.id > 1000000 ? "MUV-kit" : "HOLU-kit"
const idPrefix = sensor.id > 1000000 ? "HLL_MUV_device_" : ""
const sensorData = latest.find(o => o.id.toString().replace(idPrefix, "") === sensor.id.toString())
const sensorDataReturn = {
id: sensor.id.toString(),
name: `HOLU-kit ${sensor.id.toString()}: ${sensor.tag} - ${sensor.name}`,
id: idPrefix + sensor.id,
name: `${kitType} ${sensor.id.toString()}: ${sensor.tag} - ${sensor.name}`,
source: "holu",
type: sensor.extended ? "extended" : "basic",
coordinates: [sensor.longitude, sensor.latitude],
......@@ -124,17 +129,23 @@ export default {
},
stationMeta: function(station, parameter) {
const stationMeta = {
name: station.name,
description: (station.type === "extended" ? (
let description
if(station.name.includes('HOLU')) {
description = (station.type === "extended" ? (
'<span>Dit is een extended HOLU-meetstation. Dit prototype meet PM2.5 en PM10 en ook NO2 en O3. Als onderdeel van de pilot wordt er onderzoek gedaan naar de kwaliteit van de data afkomstig van deze meetstations.<br /><a class="more" href="https://hollandseluchten.waag.org/holu-sensorkit/">Lees meer over de HOLU kit</a></span>'
) : (
'<span>Dit is een basic HOLU-meetstation. Dit prototype meet PM2.5 en PM10. Als onderdeel van de pilot wordt er onderzoek gedaan naar de kwaliteit van de data afkomstig van deze meetstations.<br /><a class="more" href="https://hollandseluchten.waag.org/holu-sensorkit/">Lees meer over de HOLU kit</a></span>'
)
)
} else {
description = '<span>Dit is een MUV monitoring station.</span>'
}
return stationMeta
return {
name: station.name,
description: description
}
},
stationData: async function(station, parameter, start, end, granularity) {
......@@ -149,7 +160,12 @@ export default {
let data = []
if(parameter === "pm25" || parameter === "pm10") {
const responseRaw = await fetch(`https://data.waag.org/api/getHourlyValuesSensor?sensor_id=${station.id}&start=${start}&end=${end}`)
let rawURL = `https://data.waag.org/api/getHourlyValuesSensor?sensor_id=${station.id}&start=${start}&end=${end}`
if(station.id.includes('MUV')) {
rawURL = `https://data.waag.org/api/muv/ms/hourly?sensor_id=${station.id.replace('HLL_MUV_device_','')}&start=${start}&end=${end}`
}
const responseRaw = await fetch(rawURL)
const jsonRaw = await responseRaw.json()
let dataRaw = jsonRaw.map(m => {
......
Subproject commit 265ec7f4d1d1d7905e512e20106b7e7ebaa129cf
Subproject commit 6adf8df0033d295a7de74fec2db6e706b8b99575