add panoramax token
This commit is contained in:
parent
f66e5e3f7b
commit
1a3df2ed75
12 changed files with 1132 additions and 61 deletions
|
@ -492,13 +492,26 @@ class DemoMainResource:
|
|||
|
||||
// Function to check if an event needs a reality check (created more than 1 hour ago)
|
||||
function checkIfNeedsRealityCheck(event) {
|
||||
|
||||
|
||||
// Check if the event is a traffic event
|
||||
// Skip if event already has a reality check
|
||||
if (event.properties['reality_check']) {
|
||||
return false;
|
||||
}
|
||||
// Only for traffic events
|
||||
if (!event.properties.what || !event.properties.what.startsWith('traffic')) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
// Must have a creation date
|
||||
const createDate = event.properties.createdate;
|
||||
if (!createDate) {
|
||||
return false;
|
||||
}
|
||||
const createTime = new Date(createDate).getTime();
|
||||
if (isNaN(createTime)) {
|
||||
return false;
|
||||
}
|
||||
const currentTime = new Date().getTime();
|
||||
const oneHourInMs = 60 * 60 * 1000;
|
||||
return (currentTime - createTime) > oneHourInMs;
|
||||
}
|
||||
|
||||
// Function to fit map to events bounds
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue