Skip to content

Commit

Permalink
speed up navaid layer loading
Browse files Browse the repository at this point in the history
  • Loading branch information
meikelm committed Jul 10, 2024
1 parent 7c28c45 commit 5d2250c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/WEDMap/WED_NavaidLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5d2250c

Please sign in to comment.