Zoom declutter

The "to-do" list for Virtual Radar Server is as long as my arm, but if you want to pile more work onto it then this is for you.
dsfh2992
Posts: 156
Joined: Tue Oct 06, 2015 9:57 pm

Zoom declutter

Post by dsfh2992 » Tue Nov 03, 2015 11:06 pm

I am tracking over 3000 simultaneous aircraft at times on adsbexchange.com. I'd like to have a feature where when zoomed out far, instead of showing every single aircraft (which kills the browser), VRS only shows a few, or regions which have aircraft. Just a suggestion.

Thanks,
Dan

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Zoom declutter

Post by agw » Tue Nov 03, 2015 11:22 pm

There's a library (or it might be rolled into Google Maps now) that lets you display a single marker with a counter instead of a whole bunch of markers when you're zoomed out. I keep meaning to look into adding that as it does just become a mess if you zoom out on even a modest number of aircraft when they're all clumped together in one part of the globe.

I'll add it to the list :)

The thing that kills the browser though is probably VRS writing a 3000 row table for the aircraft list. I tried to get that building as fast as possible but 3000 rows is going to be pushing it a bit. Perhaps when the number of aircraft exceeds some threshold it should just replace the list with a message asking you to zoom back in a bit and/or switch on the "Show only visible aircraft in the list" setting.

dsfh2992
Posts: 156
Joined: Tue Oct 06, 2015 9:57 pm

Re: Zoom declutter

Post by dsfh2992 » Tue Nov 03, 2015 11:52 pm

I have "show only visible aircraft" on by default. I think I may edit the files to remove the "list all" link completely - it's just unusable with that many aircraft.

When zoomed way out long enough for it to attempt to draw all the aircraft, it usually stops updating (probably overloaded). Updating does not start even if you then zoom in. Could the update rate be slowed depending on zoom level? That might be a way to fix it....

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Zoom declutter

Post by agw » Thu Nov 05, 2015 9:19 pm

You can remove the "show only visible" link without editing files, you can set a global option to hide it. Just put this line after the opening <script> tag in one of your custom content plugin scripts:

Code: Select all

VRS.globalOptions.listPluginShowHideAircraftNotOnMap = false;
The way the update works is that it sets a one-off timer. When the timer is up it fetches the aircraft list from the server, processes it and then sets another one-off timer. It won't have two overlapping updates. When it stops updating do you get a JavaScript error in the console?

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Zoom declutter

Post by agw » Thu Nov 05, 2015 10:25 pm

One thing that might speed things up when you have a lot of markers on screen (in lieu of amalgamating markers) is you could get the browser to draw the labels for the marker instead of having them drawn by the server. The downside is that they're uglier, the upside is that the browser can cache those markers more efficiently than it can cache the markers with text drawn on them.

If you're running under Mono then browser-side marker text is switched on by default, Mono has issues with drawing text on images. Under Windows you can switch them on by adding this after the <script> tag in a custom content plugin script:

Code: Select all

VRS.globalOptions.aircraftMarkerSuppressTextOnImages = true;
The name of the option is a little misleading - the text is still shown, it's just not a part of the marker any more.

dsfh2992
Posts: 156
Joined: Tue Oct 06, 2015 9:57 pm

Re: Zoom declutter

Post by dsfh2992 » Fri Nov 06, 2015 6:57 am

Ok, this is good stuff. Let me experiment with this.


Thanks,
Dan

dsfh2992
Posts: 156
Joined: Tue Oct 06, 2015 9:57 pm

Re: Zoom declutter

Post by dsfh2992 » Fri Nov 06, 2015 7:06 am

agw wrote:Just put this line after the opening <script> tag in one of your custom content plugin scripts:

Code: Select all

VRS.globalOptions.listPluginShowHideAircraftNotOnMap = false;
So, do you mean I should insert that line into a ".js" file in the "site root folder" defined in the custom content plugin?

dsfh2992
Posts: 156
Joined: Tue Oct 06, 2015 9:57 pm

Re: Zoom declutter

Post by dsfh2992 » Fri Nov 06, 2015 9:32 pm

OK, I see that's what you meant. Did it, and it works.

Here is what I'm getting when I zoom out, and a ton of aircraft start to fill the screen and I zoom back in. This is the JavaScript console on the latest release version of Chrome:

Image

It seems to load another similar error line about once every 30 seconds or so while in the "frozen" state.... I have to do a "reload" on the browser to get the planes moving again.

--Dan

agw
Posts: 2241
Joined: Fri Feb 17, 2012 3:20 am

Re: Zoom declutter

Post by agw » Sat Nov 14, 2015 2:35 pm

I've taken a look at the site and I can reproduce it. It's Chrome reporting that the headers are too long. I'm not quite sure why it only does this when you're zooming back in after having zoomed out, the headers are the same size regardless of the map's zoom level, however there IS a lot of stuff in the headers when you have a lot of aircraft.

The large headers are a hangover from the old version of the site, I'll change it for the next release so that the site sends the known aircraft IDs in a post body, which should hopefully cure the problem. I'll let you know when that version is in preview.

dsfh2992
Posts: 156
Joined: Tue Oct 06, 2015 9:57 pm

Re: Zoom declutter

Post by dsfh2992 » Wed Nov 25, 2015 11:54 pm

Thanks. I will install it right away once it's out.

--Dan

Post Reply