Added Splash Screens for PWA
This commit is contained in:
@@ -269,6 +269,10 @@ export default defineComponent({
|
||||
showLegend: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
compact: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
|
||||
},
|
||||
@@ -649,8 +653,9 @@ export default defineComponent({
|
||||
|
||||
// ── Fit bounds ────────────────────────────────────────────────────────
|
||||
|
||||
const fitBounds = (padding = 60): void => {
|
||||
const fitBounds = (): void => {
|
||||
if (!props.flights.length) return
|
||||
const padding = props.compact ? 25 : 60
|
||||
|
||||
const lngs = props.flights.flatMap(f => [f.departure_airport.longitude_deg, f.arrival_airport.longitude_deg])
|
||||
const lats = props.flights.flatMap(f => [f.departure_airport.latitude_deg, f.arrival_airport.latitude_deg])
|
||||
@@ -673,7 +678,6 @@ export default defineComponent({
|
||||
minLng = Math.min(...lngs)
|
||||
maxLng = Math.max(...lngs)
|
||||
}
|
||||
|
||||
map!.fitBounds([[minLng, minLat], [maxLng, maxLat]], { padding, duration: 0 })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user