|
|
@ -6,49 +6,49 @@ function useFiltering(location) { |
|
|
|
const initialDate = moment().add(1, "days").format("YYYY-MM-DDTHH:mm:ss"); |
|
|
|
const finalDate = moment().subtract(2, "days").format("YYYY-MM-DDTHH:mm:ss"); |
|
|
|
|
|
|
|
// console.log(initialDate+"/"+finalDate);
|
|
|
|
console.log(initialDate+"/"+finalDate); |
|
|
|
|
|
|
|
const filters = [ |
|
|
|
{ |
|
|
|
name: "floodZones", |
|
|
|
socketUrl: new WebSocket( |
|
|
|
endpoint + |
|
|
|
`type=FLOODZONES_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15` |
|
|
|
`type=FLOODZONES_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50` |
|
|
|
), |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "rain", |
|
|
|
socketUrl: new WebSocket( |
|
|
|
endpoint + |
|
|
|
`type=RAIN_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15` |
|
|
|
`type=RAIN_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50` |
|
|
|
), |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "riverFlood", |
|
|
|
socketUrl: new WebSocket( |
|
|
|
endpoint + |
|
|
|
`type=RIVERFLOOD_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15` |
|
|
|
`type=RIVERFLOOD_FORM&time=${finalDate}/${initialDate}&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50` |
|
|
|
), |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "pluviometer", |
|
|
|
socketUrl: new WebSocket( |
|
|
|
endpoint + |
|
|
|
`type=PLUVIOMETER_REGISTRATION&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15` |
|
|
|
`type=PLUVIOMETER_REGISTRATION&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=50` |
|
|
|
), |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "susceptibilityAreas", |
|
|
|
socketUrl: new WebSocket( |
|
|
|
endpoint + |
|
|
|
`type=FLOODZONES_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=10` |
|
|
|
`type=FLOODZONES_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=20` |
|
|
|
), |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "automaticPluviometer", |
|
|
|
socketUrl: new WebSocket( |
|
|
|
endpoint + |
|
|
|
`type=PLUVIOMETERS_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=15` |
|
|
|
`type=PLUVIOMETERS_OFFICIAL&lat=${location.lat}&lon=${location.long}&buffer=50000&limit=20` |
|
|
|
), |
|
|
|
}, |
|
|
|
]; |
|
|
|