Set has_metar flags, pruning data
This commit is contained in:
7
ui/public/icons/nometar.svg
Normal file
7
ui/public/icons/nometar.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<g transform="matrix(1.99926,0,0,1.97614,-28.3993,-25.2946)">
|
||||
<ellipse cx="39.22" cy="38.107" rx="25.015" ry="25.307" style="fill:rgb(105,105,105);"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 624 B |
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { getAirports } from '@/api/airport';
|
||||
import { getAirports, updateAirport } from '@/api/airport';
|
||||
import { Airport, AirportOrderField } from '@/api/airport.types';
|
||||
import { getMetars } from '@/api/metar';
|
||||
import { LatLngBounds, icon } from 'leaflet';
|
||||
@@ -70,7 +70,15 @@ export default function MapTiles() {
|
||||
|
||||
function metarIcon(airport: Airport) {
|
||||
let iconUrl = '/icons/unkn.svg';
|
||||
if (!airport.has_metar) {
|
||||
// TEMP REMOVE THIS
|
||||
if (airport.has_metar && airport.latest_metar == undefined) {
|
||||
const a = {
|
||||
...airport,
|
||||
has_metar: false
|
||||
}
|
||||
updateAirport({ airport: a });
|
||||
}
|
||||
if (!airport.has_metar && airport.latest_metar == undefined) {
|
||||
iconUrl = '/icons/nometar.svg';
|
||||
} else if (airport.latest_metar?.flight_category == 'VFR') {
|
||||
iconUrl = '/icons/vfr.svg';
|
||||
|
||||
Reference in New Issue
Block a user