From 5d2250cd992e8fa4571da6843c74d31d002599db Mon Sep 17 00:00:00 2001 From: meikelm Date: Wed, 10 Jul 2024 00:18:52 -0700 Subject: [PATCH] speed up navaid layer loading --- src/WEDMap/WED_NavaidLayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WEDMap/WED_NavaidLayer.cpp b/src/WEDMap/WED_NavaidLayer.cpp index d851e008f..3b079f8f5 100644 --- a/src/WEDMap/WED_NavaidLayer.cpp +++ b/src/WEDMap/WED_NavaidLayer.cpp @@ -414,8 +414,10 @@ void WED_NavaidLayer::parse_atc_dat(MFMemFile * str) if (p.x() < n.lonlat.x()) n.lonlat = p; // place label on leftmost edge of the airspace } + Bbox2 box(n.lonlat); + box.expand(0.02, 0.02 / cos(n.lonlat.y() * M_PI / 180.0)); for (auto nav = mNavaids.cbegin(); nav != mNavaids.cend(); nav++) - if (LonLatDistMeters(nav->lonlat, n.lonlat) < 2000.0) + if (box.contains(nav->lonlat)) { n.lonlat.y_ += 0.02; // avoid two labels right ontop of each other break;