A Bit of Confusion

im a beginner in coding and dont know much. anyway im making a route log/visualizer for infinite flight. but the coordinates for the airport isnt correct for some reason. ive adjusted the values but they still arent working.

i know that the coordinates are wrong but i dont know how to fix it. ive tried every ai.

The Current Code

export interface Airport {
icao: string
name: string
city: string
country: string
latitude: number
longitude: number
flag: string
}

export const AIRPORTS: Record<string, Airport> = {
// Top 100 International Airports
KATL: {
icao: “KATL”,
name: “Hartsfield–Jackson Atlanta International Airport”,
city: “Atlanta”,
country: “United States”,
latitude: 33.6407,
longitude: -84.4277,
flag: “:united_states:”,
},
ZBAA: {
icao: “ZBAA”,
name: “Beijing Capital International Airport”,
city: “Beijing”,
country: “China”,
latitude: 40.0799,
longitude: 116.6031,
flag: “:china:”,
},
OMDB: {
icao: “OMDB”,
name: “Dubai International Airport”,
city: “Dubai”,
country: “UAE”,
latitude: 25.2532,
longitude: 55.3657,
flag: “:united_arab_emirates:”,
},
RJTT: {
icao: “RJTT”,
name: “Tokyo Haneda Airport”,
city: “Tokyo”,
country: “Japan”,
latitude: 35.5494,
longitude: 139.7798,
flag: “:japan:”,
},
KLAX: {
icao: “KLAX”,
name: “Los Angeles International Airport”,
city: “Los Angeles”,
country: “United States”,
latitude: 33.9425,
longitude: -118.4081,
flag: “:united_states:”,
},
EGLL: {
icao: “EGLL”,
name: “London Heathrow Airport”,
city: “London”,
country: “United Kingdom”,
latitude: 51.47,
longitude: -0.4543,
flag: “:united_kingdom:”,
},
LFPG: {
icao: “LFPG”,
name: “Paris Charles de Gaulle Airport”,
city: “Paris”,
country: “France”,
latitude: 49.0097,
longitude: 2.5479,
flag: “:france:”,
},
KORD: {
icao: “KORD”,
name: “Chicago O’Hare International Airport”,
city: “Chicago”,
country: “United States”,
latitude: 41.9742,
longitude: -87.9073,
flag: “:united_states:”,
},
KDFW: {
icao: “KDFW”,
name: “Dallas/Fort Worth International Airport”,
city: “Dallas”,
country: “United States”,
latitude: 32.8998,
longitude: -97.0403,
flag: “:united_states:”,
},
EDDF: {
icao: “EDDF”,
name: “Frankfurt am Main Airport”,
city: “Frankfurt”,
country: “Germany”,
latitude: 50.0379,
longitude: 8.5622,
flag: “:germany:”,
},
EHAM: {
icao: “EHAM”,
name: “Amsterdam Airport Schiphol”,
city: “Amsterdam”,
country: “Netherlands”,
latitude: 52.3105,
longitude: 4.7683,
flag: “:netherlands:”,
},
LTFM: {
icao: “LTFM”,
name: “Istanbul Airport”,
city: “Istanbul”,
country: “Turkey”,
latitude: 41.2619,
longitude: 28.7279,
flag: “:türkiye:”,
},
WSSS: {
icao: “WSSS”,
name: “Singapore Changi Airport”,
city: “Singapore”,
country: “Singapore”,
latitude: 1.3644,
longitude: 103.9915,
flag: “:singapore:”,
},
RKSI: {
icao: “RKSI”,
name: “Seoul Incheon International Airport”,
city: “Seoul”,
country: “South Korea”,
latitude: 37.4602,
longitude: 126.4407,
flag: “:south_korea:”,
},
ZGGG: {
icao: “ZGGG”,
name: “Guangzhou Baiyun International Airport”,
city: “Guangzhou”,
country: “China”,
latitude: 23.3924,
longitude: 113.2988,
flag: “:china:”,
},
VIDP: {
icao: “VIDP”,
name: “Delhi Indira Gandhi International Airport”,
city: “Delhi”,
country: “India”,
latitude: 28.5562,
longitude: 77.1,
flag: “:india:”,
},
ZSPD: {
icao: “ZSPD”,
name: “Shanghai Pudong International Airport”,
city: “Shanghai”,
country: “China”,
latitude: 31.1443,
longitude: 121.8083,
flag: “:china:”,
},
VHHH: {
icao: “VHHH”,
name: “Hong Kong International Airport”,
city: “Hong Kong”,
country: “Hong Kong”,
latitude: 22.308,
longitude: 113.9185,
flag: “:hong_kong_sar_china:”,
},
CYYZ: {
icao: “CYYZ”,
name: “Toronto Pearson International Airport”,
city: “Toronto”,
country: “Canada”,
latitude: 43.6777,
longitude: -79.6248,
flag: “:canada:”,
},
LEMD: {
icao: “LEMD”,
name: “Madrid-Barajas Adolfo Suárez Airport”,
city: “Madrid”,
country: “Spain”,
latitude: 40.4839,
longitude: -3.568,
flag: “:spain:”,
},
OTHH: {
icao: “OTHH”,
name: “Doha Hamad International Airport”,
city: “Doha”,
country: “Qatar”,
latitude: 25.2731,
longitude: 51.608,
flag: “:qatar:”,
},
YSSY: {
icao: “YSSY”,
name: “Sydney Kingsford Smith Airport”,
city: “Sydney”,
country: “Australia”,
latitude: -33.9399,
longitude: 151.1753,
flag: “:australia:”,
},
SBGR: {
icao: “SBGR”,
name: “São Paulo/Guarulhos International Airport”,
city: “São Paulo”,
country: “Brazil”,
latitude: -23.4356,
longitude: -46.4731,
flag: “:brazil:”,
},
MMMX: {
icao: “MMMX”,
name: “Mexico City International Airport”,
city: “Mexico City”,
country: “Mexico”,
latitude: 19.4363,
longitude: -99.072,
flag: “:mexico:”,
},
KMIA: {
icao: “KMIA”,
name: “Miami International Airport”,
city: “Miami”,
country: “United States”,
latitude: 25.7959,
longitude: -80.287,
flag: “:united_states:”,
},
EDDM: {
icao: “EDDM”,
name: “Munich Franz Josef Strauß Airport”,
city: “Munich”,
country: “Germany”,
latitude: 48.3538,
longitude: 11.7861,
flag: “:germany:”,
},
LIRF: {
icao: “LIRF”,
name: “Rome Fiumicino Airport”,
city: “Rome”,
country: “Italy”,
latitude: 41.8003,
longitude: 12.2389,
flag: “:italy:”,
},
VTBS: {
icao: “VTBS”,
name: “Bangkok Suvarnabhumi Airport”,
city: “Bangkok”,
country: “Thailand”,
latitude: 13.6811,
longitude: 100.7472,
flag: “:thailand:”,
},
KJFK: {
icao: “KJFK”,
name: “New York John F. Kennedy International Airport”,
city: “New York”,
country: “United States”,
latitude: 40.6413,
longitude: -73.7781,
flag: “:united_states:”,
},
KIAD: {
icao: “KIAD”,
name: “Washington Dulles International Airport”,
city: “Washington”,
country: “United States”,
latitude: 38.9531,
longitude: -77.4565,
flag: “:united_states:”,
},
KBOS: {
icao: “KBOS”,
name: “Boston Logan International Airport”,
city: “Boston”,
country: “United States”,
latitude: 42.3656,
longitude: -71.0096,
flag: “:united_states:”,
},
KDEN: {
icao: “KDEN”,
name: “Denver International Airport”,
city: “Denver”,
country: “United States”,
latitude: 39.8561,
longitude: -104.6737,
flag: “:united_states:”,
},
OMAA: {
icao: “OMAA”,
name: “Abu Dhabi International Airport”,
city: “Abu Dhabi”,
country: “UAE”,
latitude: 24.433,
longitude: 54.6511,
flag: “:united_arab_emirates:”,
},
LOWW: {
icao: “LOWW”,
name: “Vienna International Airport”,
city: “Vienna”,
country: “Austria”,
latitude: 48.1103,
longitude: 16.5697,
flag: “:austria:”,
},
LSZH: {
icao: “LSZH”,
name: “Zurich Kloten Airport”,
city: “Zurich”,
country: “Switzerland”,
latitude: 47.4647,
longitude: 8.5492,
flag: “:switzerland:”,
},
EBBR: {
icao: “EBBR”,
name: “Brussels Airport”,
city: “Brussels”,
country: “Belgium”,
latitude: 50.9014,
longitude: 4.4844,
flag: “:belgium:”,
},
ESSA: {
icao: “ESSA”,
name: “Stockholm Arlanda Airport”,
city: “Stockholm”,
country: “Sweden”,
latitude: 59.6519,
longitude: 17.9186,
flag: “:sweden:”,
},
ENGM: {
icao: “ENGM”,
name: “Oslo Gardermoen Airport”,
city: “Oslo”,
country: “Norway”,
latitude: 60.1939,
longitude: 11.1004,
flag: “:norway:”,
},
EFHK: {
icao: “EFHK”,
name: “Helsinki Vantaa Airport”,
city: “Helsinki”,
country: “Finland”,
latitude: 60.3172,
longitude: 24.9633,
flag: “:finland:”,
},
CYVR: {
icao: “CYVR”,
name: “Vancouver International Airport”,
city: “Vancouver”,
country: “Canada”,
latitude: 49.1967,
longitude: -123.1815,
flag: “:canada:”,
},
CYUL: {
icao: “CYUL”,
name: “Montreal Trudeau International Airport”,
city: “Montreal”,
country: “Canada”,
latitude: 45.4706,
longitude: -73.7408,
flag: “:canada:”,
},
RPLL: {
icao: “RPLL”,
name: “Manila Ninoy Aquino International Airport”,
city: “Manila”,
country: “Philippines”,
latitude: 14.5086,
longitude: 121.0194,
flag: “:philippines:”,
},
WIII: {
icao: “WIII”,
name: “Jakarta Soekarno-Hatta International Airport”,
city: “Jakarta”,
country: “Indonesia”,
latitude: -6.1256,
longitude: 106.6558,
flag: “:indonesia:”,
},
FAOR: {
icao: “FAOR”,
name: “Johannesburg OR Tambo International Airport”,
city: “Johannesburg”,
country: “South Africa”,
latitude: -26.1367,
longitude: 28.2411,
flag: “:south_africa:”,
},
SAEZ: {
icao: “SAEZ”,
name: “Buenos Aires Ezeiza International Airport”,
city: “Buenos Aires”,
country: “Argentina”,
latitude: -34.8222,
longitude: -58.5358,
flag: “:argentina:”,
},
SPJC: {
icao: “SPJC”,
name: “Lima Jorge Chávez International Airport”,
city: “Lima”,
country: “Peru”,
latitude: -12.0219,
longitude: -77.1143,
flag: “:peru:”,
},
SKBO: {
icao: “SKBO”,
name: “Bogotá El Dorado International Airport”,
city: “Bogotá”,
country: “Colombia”,
latitude: 4.7016,
longitude: -74.1469,
flag: “:colombia:”,
},
SCEL: {
icao: “SCEL”,
name: “Santiago Arturo Merino Benítez International Airport”,
city: “Santiago”,
country: “Chile”,
latitude: -33.393,
longitude: -70.7858,
flag: “:chile:”,
},
LTFJ: {
icao: “LTFJ”,
name: “Istanbul Sabiha Gökçen International Airport”,
city: “Istanbul”,
country: “Turkey”,
latitude: 40.8986,
longitude: 29.3092,
flag: “:türkiye:”,
},
LIMC: {
icao: “LIMC”,
name: “Milan Malpensa Airport”,
city: “Milan”,
country: “Italy”,
latitude: 45.6306,
longitude: 8.7281,
flag: “:italy:”,
},
LEBL: {
icao: “LEBL”,
name: “Barcelona El Prat Airport”,
city: “Barcelona”,
country: “Spain”,
latitude: 41.2971,
longitude: 2.0833,
flag: “:spain:”,
},
EDDB: {
icao: “EDDB”,
name: “Berlin Brandenburg Airport”,
city: “Berlin”,
country: “Germany”,
latitude: 52.3667,
longitude: 13.5033,
flag: “:germany:”,
},
LFLL: {
icao: “LFLL”,
name: “Lyon-Saint Exupéry Airport”,
city: “Lyon”,
country: “France”,
latitude: 45.7256,
longitude: 5.0811,
flag: “:france:”,
},
LFMN: {
icao: “LFMN”,
name: “Nice Côte d’Azur Airport”,
city: “Nice”,
country: “France”,
latitude: 43.6584,
longitude: 7.2158,
flag: “:france:”,
},
EKCH: {
icao: “EKCH”,
name: “Copenhagen Kastrup Airport”,
city: “Copenhagen”,
country: “Denmark”,
latitude: 55.6181,
longitude: 12.6561,
flag: “:denmark:”,
},
LKPR: {
icao: “LKPR”,
name: “Prague Václav Havel Airport”,
city: “Prague”,
country: “Czech Republic”,
latitude: 50.1008,
longitude: 14.26,
flag: “:czechia:”,
},
EPWA: {
icao: “EPWA”,
name: “Warsaw Chopin Airport”,
city: “Warsaw”,
country: “Poland”,
latitude: 52.1657,
longitude: 20.9671,
flag: “:poland:”,
},
LHBP: {
icao: “LHBP”,
name: “Budapest Ferenc Liszt International Airport”,
city: “Budapest”,
country: “Hungary”,
latitude: 47.4369,
longitude: 19.2556,
flag: “:hungary:”,
},
LROP: {
icao: “LROP”,
name: “Bucharest Henri Coandă International Airport”,
city: “Bucharest”,
country: “Romania”,
latitude: 44.5711,
longitude: 26.085,
flag: “:romania:”,
},
LGAV: {
icao: “LGAV”,
name: “Athens Eleftherios Venizelos International Airport”,
city: “Athens”,
country: “Greece”,
latitude: 37.9364,
longitude: 23.9445,
flag: “:greece:”,
},
EIDW: {
icao: “EIDW”,
name: “Dublin Airport”,
city: “Dublin”,
country: “Ireland”,
latitude: 53.4213,
longitude: -6.2701,
flag: “:ireland:”,
},
EGPH: {
icao: “EGPH”,
name: “Edinburgh Airport”,
city: “Edinburgh”,
country: “United Kingdom”,
latitude: 55.95,
longitude: -3.3725,
flag: “:united_kingdom:”,
},
EGCC: {
icao: “EGCC”,
name: “Manchester Airport”,
city: “Manchester”,
country: “United Kingdom”,
latitude: 53.3537,
longitude: -2.275,
flag: “:united_kingdom:”,
},
EGBB: {
icao: “EGBB”,
name: “Birmingham Airport”,
city: “Birmingham”,
country: “United Kingdom”,
latitude: 52.4539,
longitude: -1.748,
flag: “:united_kingdom:”,
},
EGPF: {
icao: “EGPF”,
name: “Glasgow International Airport”,
city: “Glasgow”,
country: “United Kingdom”,
latitude: 55.8719,
longitude: -4.4331,
flag: “:united_kingdom:”,
},
LSGG: {
icao: “LSGG”,
name: “Geneva Airport”,
city: “Geneva”,
country: “Switzerland”,
latitude: 46.2381,
longitude: 6.1089,
flag: “:switzerland:”,
},
LFSB: {
icao: “LFSB”,
name: “Basel-Mulhouse Airport”,
city: “Basel”,
country: “Switzerland”,
latitude: 47.5897,
longitude: 7.5294,
flag: “:switzerland:”,
},
ELLX: {
icao: “ELLX”,
name: “Luxembourg Airport”,
city: “Luxembourg”,
country: “Luxembourg”,
latitude: 49.6233,
longitude: 6.2044,
flag: “:luxembourg:”,
},
LJLJ: {
icao: “LJLJ”,
name: “Ljubljana Jože Pučnik Airport”,
city: “Ljubljana”,
country: “Slovenia”,
latitude: 46.2237,
longitude: 14.4576,
flag: “:slovenia:”,
},
LDZA: {
icao: “LDZA”,
name: “Zagreb Franjo Tuđman Airport”,
city: “Zagreb”,
country: “Croatia”,
latitude: 45.7429,
longitude: 16.0688,
flag: “:croatia:”,
},
LYBE: {
icao: “LYBE”,
name: “Belgrade Nikola Tesla Airport”,
city: “Belgrade”,
country: “Serbia”,
latitude: 44.8184,
longitude: 20.3091,
flag: “:serbia:”,
},
LWSK: {
icao: “LWSK”,
name: “Skopje International Airport”,
city: “Skopje”,
country: “North Macedonia”,
latitude: 41.9617,
longitude: 21.6214,
flag: “:north_macedonia:”,
},
LATI: {
icao: “LATI”,
name: “Tirana International Airport”,
city: “Tirana”,
country: “Albania”,
latitude: 41.4147,
longitude: 19.7206,
flag: “:albania:”,
},
LBSF: {
icao: “LBSF”,
name: “Sofia Airport”,
city: “Sofia”,
country: “Bulgaria”,
latitude: 42.6952,
longitude: 23.4114,
flag: “:bulgaria:”,
},
EVRA: {
icao: “EVRA”,
name: “Riga International Airport”,
city: “Riga”,
country: “Latvia”,
latitude: 56.9236,
longitude: 23.9711,
flag: “:latvia:”,
},
EYVI: {
icao: “EYVI”,
name: “Vilnius International Airport”,
city: “Vilnius”,
country: “Lithuania”,
latitude: 54.6341,
longitude: 25.2858,
flag: “:lithuania:”,
},
EETN: {
icao: “EETN”,
name: “Tallinn Airport”,
city: “Tallinn”,
country: “Estonia”,
latitude: 59.4133,
longitude: 24.8328,
flag: “:estonia:”,
},
UGTB: {
icao: “UGTB”,
name: “Tbilisi International Airport”,
city: “Tbilisi”,
country: “Georgia”,
latitude: 41.6692,
longitude: 44.9547,
flag: “:georgia:”,
},
UBBB: {
icao: “UBBB”,
name: “Baku Heydar Aliyev International Airport”,
city: “Baku”,
country: “Azerbaijan”,
latitude: 40.4675,
longitude: 50.0467,
flag: “:azerbaijan:”,
},
UDYZ: {
icao: “UDYZ”,
name: “Yerevan Zvartnots International Airport”,
city: “Yerevan”,
country: “Armenia”,
latitude: 40.1473,
longitude: 44.3959,
flag: “:armenia:”,
},
OOMS: {
icao: “OOMS”,
name: “Muscat International Airport”,
city: “Muscat”,
country: “Oman”,
latitude: 23.5933,
longitude: 58.2844,
flag: “:oman:”,
},
OKBK: {
icao: “OKBK”,
name: “Kuwait International Airport”,
city: “Kuwait City”,
country: “Kuwait”,
latitude: 29.2267,
longitude: 47.9689,
flag: “:kuwait:”,
},
OBBI: {
icao: “OBBI”,
name: “Bahrain International Airport”,
city: “Manama”,
country: “Bahrain”,
latitude: 26.2708,
longitude: 50.6336,
flag: “:bahrain:”,
},
OERK: {
icao: “OERK”,
name: “Riyadh King Khalid International Airport”,
city: “Riyadh”,
country: “Saudi Arabia”,
latitude: 24.9576,
longitude: 46.6988,
flag: “:saudi_arabia:”,
},
OEJN: {
icao: “OEJN”,
name: “Jeddah King Abdulaziz International Airport”,
city: “Jeddah”,
country: “Saudi Arabia”,
latitude: 21.6796,
longitude: 39.1564,
flag: “:saudi_arabia:”,
},
OJAI: {
icao: “OJAI”,
name: “Amman Queen Alia International Airport”,
city: “Amman”,
country: “Jordan”,
latitude: 31.7226,
longitude: 35.9931,
flag: “:jordan:”,
},
LLBG: {
icao: “LLBG”,
name: “Tel Aviv Ben Gurion Airport”,
city: “Tel Aviv”,
country: “Israel”,
latitude: 32.0114,
longitude: 34.8867,
flag: “:israel:”,
},
OIIE: {
icao: “OIIE”,
name: “Tehran Imam Khomeini International Airport”,
city: “Tehran”,
country: “Iran”,
latitude: 35.4161,
longitude: 51.1522,
flag: “:iran:”,
},
OPKC: {
icao: “OPKC”,
name: “Karachi Jinnah International Airport”,
city: “Karachi”,
country: “Pakistan”,
latitude: 24.9056,
longitude: 67.1608,
flag: “:pakistan:”,
},
OPLA: {
icao: “OPLA”,
name: “Lahore Allama Iqbal International Airport”,
city: “Lahore”,
country: “Pakistan”,
latitude: 31.5217,
longitude: 74.4036,
flag: “:pakistan:”,
},
VCBI: {
icao: “VCBI”,
name: “Colombo Bandaranaike International Airport”,
city: “Colombo”,
country: “Sri Lanka”,
latitude: 7.1808,
longitude: 79.8842,
flag: “:sri_lanka:”,
},
VNKT: {
icao: “VNKT”,
name: “Kathmandu Tribhuvan International Airport”,
city: “Kathmandu”,
country: “Nepal”,
latitude: 27.6966,
longitude: 85.3591,
flag: “:nepal:”,
},
VGHS: {
icao: “VGHS”,
name: “Dhaka Hazrat Shahjalal International Airport”,
city: “Dhaka”,
country: “Bangladesh”,
latitude: 23.8433,
longitude: 90.3978,
flag: “:bangladesh:”,
},
VVNB: {
icao: “VVNB”,
name: “Hanoi Noi Bai International Airport”,
city: “Hanoi”,
country: “Vietnam”,
latitude: 21.2212,
longitude: 105.8067,
flag: “:vietnam:”,
},
VVTS: {
icao: “VVTS”,
name: “Ho Chi Minh Tan Son Nhat International Airport”,
city: “Ho Chi Minh City”,
country: “Vietnam”,
latitude: 10.8188,
longitude: 106.6519,
flag: “:vietnam:”,
},
WMKK: {
icao: “WMKK”,
name: “Kuala Lumpur International Airport”,
city: “Kuala Lumpur”,
country: “Malaysia”,
latitude: 2.7456,
longitude: 101.7072,
flag: “:malaysia:”,
},
WMKP: {
icao: “WMKP”,
name: “Penang International Airport”,
city: “Penang”,
country: “Malaysia”,
latitude: 5.2971,
longitude: 100.2769,
flag: “:malaysia:”,
},
YPPH: {
icao: “YPPH”,
name: “Perth International Airport”,
city: “Perth”,
country: “Australia”,
latitude: -31.9403,
longitude: 115.9669,
flag: “:australia:”,
},
NZAA: {
icao: “NZAA”,
name: “Auckland Airport”,
city: “Auckland”,
country: “New Zealand”,
latitude: -37.0082,
longitude: 174.785,
flag: “:new_zealand:”,
},
NZWN: {
icao: “NZWN”,
name: “Wellington International Airport”,
city: “Wellington”,
country: “New Zealand”,
latitude: -41.3272,
longitude: 174.805,
flag: “:new_zealand:”,
},
// Additional 100 International Airports
NZCH: {
icao: “NZCH”,
name: “Christchurch International Airport”,
city: “Christchurch”,
country: “New Zealand”,
latitude: -43.4894,
longitude: 172.532,
flag: “:new_zealand:”,
},
NFFN: {
icao: “NFFN”,
name: “Nadi International Airport”,
city: “Nadi”,
country: “Fiji”,
latitude: -17.7554,
longitude: 177.4431,
flag: “:fiji:”,
},
AYPY: {
icao: “AYPY”,
name: “Port Moresby Jacksons International Airport”,
city: “Port Moresby”,
country: “Papua New Guinea”,
latitude: -9.4439,
longitude: 147.22,
flag: “:papua_new_guinea:”,
},
PHNL: {
icao: “PHNL”,
name: “Honolulu Daniel K. Inouye International Airport”,
city: “Honolulu”,
country: “United States”,
latitude: 21.3099,
longitude: -157.8581,
flag: “:united_states:”,
},
PANC: {
icao: “PANC”,
name: “Anchorage Ted Stevens International Airport”,
city: “Anchorage”,
country: “United States”,
latitude: 61.1744,
longitude: -149.9962,
flag: “:united_states:”,
},
KSEA: {
icao: “KSEA”,
name: “Seattle-Tacoma International Airport”,
city: “Seattle”,
country: “United States”,
latitude: 47.4502,
longitude: -122.3088,
flag: “:united_states:”,
},
KSFO: {
icao: “KSFO”,
name: “San Francisco International Airport”,
city: “San Francisco”,
country: “United States”,
latitude: 37.6213,
longitude: -122.379,
flag: “:united_states:”,
},
KPDX: {
icao: “KPDX”,
name: “Portland International Airport”,
city: “Portland”,
country: “United States”,
latitude: 45.5898,
longitude: -122.5951,
flag: “:united_states:”,
},
KSAN: {
icao: “KSAN”,
name: “San Diego International Airport”,
city: “San Diego”,
country: “United States”,
latitude: 32.7336,
longitude: -117.1897,
flag: “:united_states:”,
},
KPHX: {
icao: “KPHX”,
name: “Phoenix Sky Harbor International Airport”,
city: “Phoenix”,
country: “United States”,
latitude: 33.4343,
longitude: -112.0116,
flag: “:united_states:”,
},
KSLC: {
icao: “KSLC”,
name: “Salt Lake City International Airport”,
city: “Salt Lake City”,
country: “United States”,
latitude: 40.7884,
longitude: -111.9778,
flag: “:united_states:”,
},
KLAS: {
icao: “KLAS”,
name: “Las Vegas Harry Reid International Airport”,
city: “Las Vegas”,
country: “United States”,
latitude: 36.084,
longitude: -115.1537,
flag: “:united_states:”,
},
KMSP: {
icao: “KMSP”,
name: “Minneapolis–Saint Paul International Airport”,
city: “Minneapolis”,
country: “United States”,
latitude: 44.8848,
longitude: -93.2223,
flag: “:united_states:”,
},
KDTW: {
icao: “KDTW”,
name: “Detroit Metropolitan Wayne County Airport”,
city: “Detroit”,
country: “United States”,
latitude: 42.2124,
longitude: -83.3534,
flag: “:united_states:”,
},
KCVG: {
icao: “KCVG”,
name: “Cincinnati/Northern Kentucky International Airport”,
city: “Cincinnati”,
country: “United States”,
latitude: 39.0488,
longitude: -84.6678,
flag: “:united_states:”,
},
KCLE: {
icao: “KCLE”,
name: “Cleveland Hopkins International Airport”,
city: “Cleveland”,
country: “United States”,
latitude: 41.4117,
longitude: -81.8498,
flag: “:united_states:”,
},
KCLT: {
icao: “KCLT”,
name: “Charlotte Douglas International Airport”,
city: “Charlotte”,
country: “United States”,
latitude: 35.2144,
longitude: -80.9431,
flag: “:united_states:”,
},
KMCO: {
icao: “KMCO”,
name: “Orlando International Airport”,
city: “Orlando”,
country: “United States”,
latitude: 28.4294,
longitude: -81.3089,
flag: “:united_states:”,
},
KTPA: {
icao: “KTPA”,
name: “Tampa International Airport”,
city: “Tampa”,
country: “United States”,
latitude: 27.9755,
longitude: -82.5332,
flag: “:united_states:”,
},
KSTL: {
icao: “KSTL”,
name: “St. Louis Lambert International Airport”,
city: “St. Louis”,
country: “United States”,
latitude: 38.7487,
longitude: -90.37,
flag: “:united_states:”,
},
KMCI: {
icao: “KMCI”,
name: “Kansas City International Airport”,
city: “Kansas City”,
country: “United States”,
latitude: 39.2976,
longitude: -94.7139,
flag: “:united_states:”,
},
KIND: {
icao: “KIND”,
name: “Indianapolis International Airport”,
city: “Indianapolis”,
country: “United States”,
latitude: 39.7173,
longitude: -86.2944,
flag: “:united_states:”,
},
KBNA: {
icao: “KBNA”,
name: “Nashville International Airport”,
city: “Nashville”,
country: “United States”,
latitude: 36.1245,
longitude: -86.6782,
flag: “:united_states:”,
},
KRDU: {
icao: “KRDU”,
name: “Raleigh-Durham International Airport”,
city: “Raleigh”,
country: “United States”,
latitude: 35.8776,
longitude: -78.7875,
flag: “:united_states:”,
},
KPIT: {
icao: “KPIT”,
name: “Pittsburgh International Airport”,
city: “Pittsburgh”,
country: “United States”,
latitude: 40.4915,
longitude: -80.2329,
flag: “:united_states:”,
},
KPHL: {
icao: “KPHL”,
name: “Philadelphia International Airport”,
city: “Philadelphia”,
country: “United States”,
latitude: 39.8719,
longitude: -75.2411,
flag: “:united_states:”,
},
KBWI: {
icao: “KBWI”,
name: “Baltimore/Washington International Airport”,
city: “Baltimore”,
country: “United States”,
latitude: 39.1754,
longitude: -76.6683,
flag: “:united_states:”,
},
KEWR: {
icao: “KEWR”,
name: “Newark Liberty International Airport”,
city: “Newark”,
country: “United States”,
latitude: 40.6925,
longitude: -74.1687,
flag: “:united_states:”,
},
KLGA: {
icao: “KLGA”,
name: “LaGuardia Airport”,
city: “New York”,
country: “United States”,
latitude: 40.7769,
longitude: -73.874,
flag: “:united_states:”,
},
KBUF: {
icao: “KBUF”,
name: “Buffalo Niagara International Airport”,
city: “Buffalo”,
country: “United States”,
latitude: 42.9405,
longitude: -78.7322,
flag: “:united_states:”,
},
KBDL: {
icao: “KBDL”,
name: “Bradley International Airport”,
city: “Hartford”,
country: “United States”,
latitude: 41.9389,
longitude: -72.6832,
flag: “:united_states:”,
},
KPWM: {
icao: “KPWM”,
name: “Portland International Jetport”,
city: “Portland”,
country: “United States”,
latitude: 43.6462,
longitude: -70.3093,
flag: “:united_states:”,
},
KBIL: {
icao: “KBIL”,
name: “Billings Logan International Airport”,
city: “Billings”,
country: “United States”,
latitude: 45.8077,
longitude: -108.543,
flag: “:united_states:”,
},
PAFA: {
icao: “PAFA”,
name: “Fairbanks International Airport”,
city: “Fairbanks”,
country: “United States”,
latitude: 64.8151,
longitude: -147.856,
flag: “:united_states:”,
},
PAJN: {
icao: “PAJN”,
name: “Juneau International Airport”,
city: “Juneau”,
country: “United States”,
latitude: 58.355,
longitude: -134.5763,
flag: “:united_states:”,
},
CYWG: {
icao: “CYWG”,
name: “Winnipeg James Armstrong Richardson International Airport”,
city: “Winnipeg”,
country: “Canada”,
latitude: 49.91,
longitude: -97.2394,
flag: “:canada:”,
},
CYEG: {
icao: “CYEG”,
name: “Edmonton International Airport”,
city: “Edmonton”,
country: “Canada”,
latitude: 53.3097,
longitude: -113.58,
flag: “:canada:”,
},
CYYC: {
icao: “CYYC”,
name: “Calgary International Airport”,
city: “Calgary”,
country: “Canada”,
latitude: 51.1225,
longitude: -114.0133,
flag: “:canada:”,
},
CYOW: {
icao: “CYOW”,
name: “Ottawa Macdonald–Cartier International Airport”,
city: “Ottawa”,
country: “Canada”,
latitude: 45.3225,
longitude: -75.6692,
flag: “:cyprus:”,
},
CYHZ: {
icao: “CYHZ”,
name: “Halifax Stanfield International Airport”,
city: “Halifax”,
country: “Canada”,
latitude: 44.8808,
longitude: -63.5086,
flag: “:canada:”,
},
CYYT: {
icao: “CYYT”,
name: “St. John’s International Airport”,
city: “St. John’s”,
country: “Canada”,
latitude: 47.6186,
longitude: -52.7519,
flag: “:canada:”,
},
CYQB: {
icao: “CYQB”,
name: “Quebec Jean Lesage International Airport”,
city: “Quebec City”,
country: “Canada”,
latitude: 46.7911,
longitude: -71.3933,
flag: “:canada:”,
},
TXKF: {
icao: “TXKF”,
name: “Bermuda L.F. Wade International Airport”,
city: “Hamilton”,
country: “Bermuda”,
latitude: 32.364,
longitude: -64.6789,
flag: “:bermuda:”,
},
MYNN: {
icao: “MYNN”,
name: “Nassau Lynden Pindling International Airport”,
city: “Nassau”,
country: “Bahamas”,
latitude: 25.039,
longitude: -77.4663,
flag: “:bahamas:”,
},
TJSJ: {
icao: “TJSJ”,
name: “San Juan Luis Muñoz Marín International Airport”,
city: “San Juan”,
country: “Puerto Rico”,
latitude: 18.4394,
longitude: -66.0018,
flag: “:puerto_rico:”,
},
MDPC: {
icao: “MDPC”,
name: “Punta Cana International Airport”,
city: “Punta Cana”,
country: “Dominican Republic”,
latitude: 18.5674,
longitude: -68.3634,
flag: “:dominican_republic:”,
},
MDSD: {
icao: “MDSD”,
name: “Santo Domingo Las Américas International Airport”,
city: “Santo Domingo”,
country: “Dominican Republic”,
latitude: 18.4297,
longitude: -69.6689,
flag: “:dominican_republic:”,
},
MTPP: {
icao: “MTPP”,
name: “Port-au-Prince Toussaint Louverture International Airport”,
city: “Port-au-Prince”,
country: “Haiti”,
latitude: 18.58,
longitude: -72.2925,
flag: “:haiti:”,
},
MUHA: {
icao: “MUHA”,
name: “Havana José Martí International Airport”,
city: “Havana”,
country: “Cuba”,
latitude: 22.9892,
longitude: -82.4091,
flag: “:cuba:”,
},
MKJP: {
icao: “MKJP”,
name: “Kingston Norman Manley International Airport”,
city: “Kingston”,
country: “Jamaica”,
latitude: 17.9357,
longitude: -76.7875,
flag: “:jamaica:”,
},
MKJS: {
icao: “MKJS”,
name: “Montego Bay Sangster International Airport”,
city: “Montego Bay”,
country: “Jamaica”,
latitude: 18.5037,
longitude: -77.9133,
flag: “:jamaica:”,
},
TTPP: {
icao: “TTPP”,
name: “Port of Spain Piarco International Airport”,
city: “Port of Spain”,
country: “Trinidad and Tobago”,
latitude: 10.5953,
longitude: -61.3372,
flag: “:trinidad_tobago:”,
},
TNCA: {
icao: “TNCA”,
name: “Aruba Queen Beatrix International Airport”,
city: “Oranjestad”,
country: “Aruba”,
latitude: 12.5014,
longitude: -70.0152,
flag: “:aruba:”,
},
TNCC: {
icao: “TNCC”,
name: “Curaçao Hato International Airport”,
city: “Willemstad”,
country: “Curaçao”,
latitude: 12.1889,
longitude: -68.9598,
flag: “:curaçao:”,
},
}

export function getAirport(icao: string): Airport | null {
return AIRPORTS[icao.toUpperCase()] || null
}

export function getAllAirports(): Airport {
return Object.values(AIRPORTS).sort((a, b) => a.city.localeCompare(b.city))
}

export function searchAirports(query: string): Airport {
const searchTerm = query.toLowerCase()
return Object.values(AIRPORTS)
.filter(
(airport) =>
airport.icao.toLowerCase().includes(searchTerm) ||
airport.name.toLowerCase().includes(searchTerm) ||
airport.city.toLowerCase().includes(searchTerm) ||
airport.country.toLowerCase().includes(searchTerm),
)
.sort((a, b) => a.city.localeCompare(b.city))
}

if some one can give a fixed code it would be the best!

You will have code somewhere that converts the lat/lng to specific coordinates on the map, and the reason it’s incorrect is probably that the map is using a different projection than your code is expecting

You can read more about map projections here. Once you know which one your map uses, you should be able to get an AI tool to help correct your coordinate function