AIS
This commit is contained in:
@@ -48,16 +48,6 @@ let airTraffic: AirTrafficLayer
|
||||
let aisLayer: AISLayer
|
||||
let range: RangeLayer
|
||||
|
||||
const hourTickIndices = computed(() => {
|
||||
const indices: number[] = []
|
||||
let lastHour = -1
|
||||
radarFrames.value.forEach((f, i) => {
|
||||
const h = new Date(f.time * 1000).getHours()
|
||||
if (h !== lastHour) { indices.push(i); lastHour = h }
|
||||
})
|
||||
return indices
|
||||
})
|
||||
|
||||
function buildWindSrc(lat: number, lon: number, zoom: number) {
|
||||
return `https://embed.windy.com/embed2.html?lat=${lat.toFixed(4)}&lon=${lon.toFixed(4)}&detailLat=${lat.toFixed(4)}&detailLon=${lon.toFixed(4)}&zoom=${Math.round(zoom)}&level=surface&overlay=wind&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=kt&metricTemp=%C2%B0C&radarRange=-1`
|
||||
}
|
||||
@@ -98,29 +88,15 @@ function seekRadar(index: number) {
|
||||
}
|
||||
}
|
||||
|
||||
function onSliderInput(e: Event) {
|
||||
seekRadar(Number((e.target as HTMLInputElement).value))
|
||||
}
|
||||
|
||||
function frameLabel(frame: { time: number }) {
|
||||
return new Date(frame.time * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
|
||||
}
|
||||
|
||||
function hourLabel(frame: { time: number }) {
|
||||
return new Date(frame.time * 1000).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false })
|
||||
}
|
||||
|
||||
function tickPercent(index: number) {
|
||||
return (index / (radarFrames.value.length - 1)) * 100
|
||||
}
|
||||
|
||||
function toggleAT() {
|
||||
if(atActive.value) {
|
||||
aisLayer.hide()
|
||||
airTraffic.hide()
|
||||
range.hide()
|
||||
} else {
|
||||
aisLayer.show()
|
||||
airTraffic.show()
|
||||
range.show()
|
||||
}
|
||||
atActive.value = !atActive.value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user