Aircraft Symbol - Change Dependent on Altitude

Want to post something that doesn't quite fit into the other forums? This is the place for that.
Post Reply
Squadgy
Posts: 3
Joined: Sat Sep 01, 2018 7:45 pm

Aircraft Symbol - Change Dependent on Altitude

Post by Squadgy » Sat Oct 06, 2018 7:00 pm

Good evening

I'm attempting to set up VRS so that the main focus of my display is traffic at lower levels (typically below 5000ft). I know that I can set a filter to only display traffic below that altitude, however what I'd really like to do, is to have higher level traffic displayed as a different symbol (for instance an small circle) rather than an aircraft symbol - so I retain awareness that they are operating above the level I am interested in. Ideally, also I'd like the data block not to be displayed for such aircraft.

Does anyone know if this might be possible ?

Many thanks

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

Re: Aircraft Symbol - Change Dependent on Altitude

Post by agw » Sun Oct 07, 2018 10:58 pm

If you're not daunted by writing some JavaScript then you can use the custom plugin to set the aircraft marker for all aircraft over a given altitude. There is a thread detailing how to create custom aircraft markers here:

viewtopic.php?f=11&t=805&p=4019&hilit=c ... kers#p4019

However you will still be able to select those aircraft and view their details. They'll just have a custom marker.

Squadgy
Posts: 3
Joined: Sat Sep 01, 2018 7:45 pm

Re: Aircraft Symbol - Change Dependent on Altitude

Post by Squadgy » Tue Oct 09, 2018 8:16 pm

Thanks

I've had a go, but unsure of the syntax . I tried :
new VRS.AircraftMarker({
normalFileName: 'HighLevel.png',
selectedFileName: 'HighLevel.png',
size: { width: 20, height: 20 },
isAircraft: true,
isPre22Icon: true,
matches: function (aircraft) { return aircraft.altitude.val > VRS.Altutude.5000; }
}),
I've put this at the start of the array in aircraftPlotter.js

When running with this amended .js file whilst the base map renders nothing else will.

I suspect my matches: function (aircraft) { return aircraft.altitude.val > VRS.Altutude.5000; } is wrong - What I want to do is have all aircraft over 5000 ft depicted by an icon which I have saved as HighLevel.png which I have stored in C:\Program Files\VirtualRadar\Web\images\markers

Any help appreciated !

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

Re: Aircraft Symbol - Change Dependent on Altitude

Post by agw » Sun Oct 14, 2018 5:23 pm

VRS.Altitude is just a type declaration somewhere - altitude itself is a number, so you would do:

matches: function (aircraft) { return aircraft.altitude.val > 5000; }

You should also avoid copying files into the installation folder. There won't be a checksum for that file so I don't think VRS will serve it (you can try by going to http://127.0.0.1/VirtualRadar/images/ma ... hLevel.png in your web browser - I suspect it won't work).

What you need to do is:

a) Create a folder somewhere on your machine called VRS (e.g. C:/users/sqadgy/documents/VRS) and then under there create one called web, under there one called images and finally under that one called markers. So the path to Markers would be, for example, C:/users/sqadgy/documents/VRS/web/images/markers.
b) Copy your image into the markers folder you just created.
c) In the custom content plugin set the root folder to the Web folder you created - so in the example above you'd set the root to C:/users/sqadgy/documents/VRS/web

VRS will try to serve files out of your custom root folder first. If it can't find the file it wants to serve in there then it'll go to the standard installation folder and try there. After you've set everything up you should be able to go to <blah blah blah>/VirtualRadar/images/markers/HighLevel.png in your browser and see your marker image.

Post Reply