Changed opacity so planes just fade away

I don’t particularly like the way opacity is handled, so I changed it. Outline color is sufficient to distinguish adsb from mlat flights, so I set opacity to 1.0 for all flights. Then I can adjust it downward for old planes:


        var opacity = 1.0;
        if (this.seen_pos > 15) {
           opacity = (45 - (this.seen - 15)) / 45;
        }

This looks much better to me, and no plane just suddenly disappears from the screen. They fade away.

I also changed the ground color to brown instead of green, which is already used for altitudes around 8-12,000 feet.

Here’s an image showing the brown color and two different levels of opacity on aging planes.

http://victorspictures.com/img/s9/v95/p623538268-3.jpg

This sounds interesting. Could you elaborate which file and which function you edited or added the code to?

The file is planeObject.js

Do a search for


var opacity =

That’s where it goes. Opacity ranges from 0 (transparent) to 1 (opaque). So what I did was to treat anything under 15 seconds old as current. After 15 seconds, they start aging. Since planes disappear when older than 58 seconds, this code should be safe. However, there really should be a check to ensure this.seen is not greater than 60, since that would cause a negative opacity.

For ground color, the file is config.js. The color that works for me is:


ground  : { h: 10, s: 50, l: 36 },

I’m probably going to also add some code to distinguish TISB messages that have no MLAT. These would be messages that my receiver probably can’t pick up. In my case, they’re usually near ground messages near Houston or San Antonio. On the other hand, I may not color them differently, because they generally fade away quickly anyway.

Thank you, that works fine for me! I made one little change (used this.seen_pos in second line instead of this.seen):


        if (this.seen_pos > 15) {
           opacity = (45 - (this.seen_pos - 15)) / 45;

And I added a line of code in the same function to make the outline fade away as well:


this.icon.strokeOpacity = opacity;

The stroke fades for me without that. Having said that, I may have made other changes to the stroke that obviates the need for this change. Anyway, how do you like the fading planes?

Yeah and I have lignumaqua’s changes and a not-so-recent dump1090-mutability still with Google maps. And I do like the fading planes I must say! Thanks for the idea!

I don’t find the variable, opacity, in my version of planeObject.js

I am using Dump1090-mutability 1.15. I checked the original file as well as the one in use. I’ve only made one change to planeObject.js that concerned ShowAltitudesByColor, otherwise it is the same as the original.

What modification introduced the variable, opacity?

I have not used Dump1090-mutability. I was referring to PiAware 3.x. I understand it is based on Dump1090-mutability, but I don’t know what version.

I have not used Dump1090-mutability. I was referring to PiAware 3.x. I understand it is based on Dump1090-mutability, but I don’t know what version.

Well, that 'splains it. :smiley: