iaincollins / icarus

ICARUS Terminal for Elite Dangerous

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Highlight which systems are already mapped in EDSM in Route view

iaincollins opened this issue · comments

Several CMDRs have requested the ability to be able to see which systems have already been mapped (at least as far as EDSM knows) in the Route plan view.

As routes can be hundreds of light years and many systems there are technical considerations as to how to do this, how to cache the result and how and when to invalidate the cache.

The simplest approach would be to do this for every system when a new route is plotted, and to cache the results until a new route is set, although this may impose an unreasonable number of requests in sequence on the EDSM API for long routes (e.g. with hundreds of hops).

An ideal approach would be to use intersectionObserver to fetch the data as the user scrolls the list of systems in the route, and to cache that data in memory; and update that cache when the user lands in the system (and/or uses FSS inside the system). This would only fetch data for routes as actually needed; although it would take a second or two to add that information to the display as the user scrolls.

An initial version of this has now been implemented.

It just fetches data for all systems (and caches the responses). EDSM appears to be fine with this; I'll revise the approach if it turns out to be problematic but so far it works well.

The list view highlights systems that are not mapped in ESDM or have incomplete data (these are treated the same way to encourage folks to go map them!).

For systems that have been mapped, the number of stars and planets found is displayed.

This will go out in the next release.