SubscribeToFacilities / RequestFacilitiesList returns the same 1234 aiports in the callback 31 times

I already seen this post on the MSFS2020 forums:
[SubscribeToFacilities/RequestFacilitiesList: Only returns the first 1243
airports](https://forums.flightsimulator.com/t/subscribetofacilities-
requestfacilitieslist-only-returns-the-first-1243-airports/343835) but wanted
to echo it here. Anyone have a workaround for this? I’m trying to get a list
of Airports around the user’s aircraft. This would also be a lot easier if
RequestFacilitiesList had a radius like RequestDataOnSimObjectType or if
RequestDataOnSimObjectType could take a SIMBOJECT_TYPE.AIRPORT thanks, Jeff

Hi Jeff, as far as I know this is just broken. When I was trying with that I
even did not receive the airport I was actually closest to…which was the
only one I was interested at. Asobo is planning on implementing something new
for that this year. So I doubt they will bother fixing the current mechanic.
Greets, Ben

Hello @darkclown @BenBaron85 . We were able to reproduce the problem and will
look for a fix. Regards, Sylvain

Hello. This issue will be fixed with SU9. Regards, Sylvain

@FlyingRaccoon when you say this is fixed, do you mean receiving the closest
airport? I am using this to find the airport where the user is sitting at, and
unfortunately I am receiving 41,019 airports on the list (1243 x 33 times)
including airports that are over 3500 miles away. For example, I am sitting at
EGKA and I received all the airports in Canada and beyond… I did a quick
algorithm to compare the lat / lon vs the airplane current position and I am
able to determine what is airport the user is sitting at. However it seems
quiet inefficient having to compare against 41,019 airports to determine where
the user is… I thought SimConnect RequestFacilitiesList is **** supposed
to return the current airports in the reality bubble as explained on the SDK:

Remarks
The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations **_within a certain radius of the user aircraft_**. This radius varies depending on where the aircraft is in the world, **_but is at least large enough to encompass the whole of the reality bubble for airports_** and waypoints, and can be over 200 miles for VOR and NDB stations. As the user aircraft moves facilities will be added to, and removed from, the cache. However, in the interests pf performance, hysteresis is built into the system.


To receive event notifications when a facility is added, use the SimConnect_SubscribeToFacilities function. When this function is first called, a full list from the cache will be sent, thereafter just the additions will be transmitted. No notification is given when a facility is removed from the cache. the Obviously to terminate these notifications use the SimConnect_UnsubscribeToFacilities function.

However this doesn’t seem to be the case since I am getting airports across
the next continent? is it the documentation wrong? or the function is not
working as intended? Thanks in advance for any help. Best Regards, Raul

Hi, For SU9, we fixed RequestFacilitiesList which send X the same message.
From Su9, RequestFacilitiesList sends the entire list of airport but we
couldn’t restore its original behaviour because some addons used the broken
behaviour, we couldn’t change it. So, here is a little recap of what we did
(SU10):

  • RequestFacilitiesList
    • Airport: Still return the all list of airport around the world (~ 40 000)
    • Vor/Ndb/Wpt: Return the list of element around you
  • SubscribeToFacilities
    • Airport: Does nothing because the all list has already been returned
    • Vor/Ndb/Wpt: That has been fixed. Work as expected
  • RequestFacilitiesList _EX1
    • Airport: Return the list of airport around you
    • Vor/Ndb/Wpt: Return the list around of element you
  • SubscribeToFacilities _EX1
    • Airport/Vor/Ndb/Wpt : Send a message each time an airport/vor/ndb/wpt goes in/ goes out the 200 miles around you (according what you want)

So to get the list of airport around you, please use RequestFacilitiesList
_EX1. Best Regards Maxime / Asobo

@Arzop Right that makes sense, thanks for the quick response, so the problem
we have is the documentation is not clear about this behaviour trowing us out
of base. I will change the code to use EX1 instead for efficiency purposes.
Thanks for clarifuing and providing further information. @Boris if you guys
could flag some how to put this in the SDK doc for SU10 it would be great,
currently the description of RequestFacilitiesList _EX1 is just saying
this:

The **SimConnect_RequestFacilitesList_EX1** function is used to request a list of all the facilities of a given type currently held in the facilities cache.

This function is currently a simple alias for SimConnect_RequestFacilitesList, designed to be used with the other *_EX1 functions so that naming consistency can be maintained and code can be easier to track.

While the RequestFacilitiesList has a similar description, so it is confusing
and not clear :slight_smile: Thanks to all for the help. Best Regards, Raul

@Nocturne FYI