Files
noise/public/javascripts/global.js
T

45 lines
1.2 KiB
JavaScript

// Client side javascript
"use strict"
import * as map from './map.js'
import * as dt from './datetime.js'
$(async() => {
// global constants
const Stuttgart = [48.779, 9.16]
const MAXROWS_IN_TABLE = 1000
const defaultStartime = '2023-01-01 00:00'
// END global constants
// global variables
let params = { // set defaults
drawlines: false,
nbrentries: 0,
device: '',
coordinates: false,
center: Stuttgart,
zoom: 13,
refresh: 0,
starttime: '2023-01-01T00:00:00Z', //date2ISO(defaultStartime),
endtime: '2023-03-01T00:00:00Z' //date2ISO(emptyTimes.emptyHMtime)
}
// END global variables
async function main() {
// show dat/time at start
dt.showDate(true)
// and show date/time every minute
setInterval(() => dt.showDate(false), 1000)
// show version and version-date
$('#versn').text(`Version: ${sysparams.version} vom ${sysparams.date.slice(0,10)}`)
// show the map
map.showMap(params)
await map.buildMarkers()
}
main().catch(console.error)
})