aircraftMarkerRangeCircleDistanceUnit

Are you having problems with using or developing a plugin? Let me know here.
Post Reply
trigger
Posts: 27
Joined: Sun Jan 19, 2014 10:03 pm

aircraftMarkerRangeCircleDistanceUnit

Post by trigger » Sun Feb 02, 2014 8:06 pm

Hi all,

I've been having a play with VRS Global options Settings and I was trying to set aircraftMarkerRangeCircleDistanceUnit to NauticalMile. It didn't work so I used the example from the help text as below and that failed too.
The page doesn't render. No map, aircraft or information columns.
Here are the contents of my file:
<script type="text/javascript">
if(VRS && VRS.globalDispatch && VRS.serverConfig) {
VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {

VRS.globalOptions.aircraftMarkerAllowAltitudeStalk = false;
VRS.globalOptions.aircraftMarkerAllowRangeCircles = true;
VRS.globalOptions.aircraftMarkerShowRangeCircles = true;
VRS.globalOptions.aircraftMarkerRangeCircleInterval = 20;
VRS.globalOptions.aircraftMarkerRangeCircleCount = 3;
VRS.globalOptions.aircraftMarkerRangeCircleDistanceUnit = StatuteMile;
VRS.globalOptions.aircraftMarkerRangeCircleOddColour = '#FF0000';
VRS.globalOptions.aircraftMarkerRangeCircleEvenColour = '#333333';
});
}
</script>


If I take out the VRS.globalOptions.aircraftMarkerRangeCircleDistanceUnit = StatuteMile; line then the page renders fine with 3 black and red circles.

What have I missed?
Thanks
Dave

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

Re: aircraftMarkerRangeCircleDistanceUnit

Post by agw » Sun Feb 02, 2014 10:14 pm

Yes, the documentation is a little misleading - it shows the name of the value but not the object that it's sitting in. If you change:

Code: Select all

VRS.globalOptions.aircraftMarkerRangeCircleDistanceUnit = StatuteMile;
to

Code: Select all

VRS.globalOptions.aircraftMarkerRangeCircleDistanceUnit = VRS.Distance.StatuteMile;
then it should work. Likewise if you wanted it to be in nautical miles then it'd be VRS.Distance.NauticalMile. You can find the full list of values in enums.js in the standard web site, along with the prefixes for other values. If you have installed VRS into c:\program files (x86)\VirtualRadar then the full path to enums.js would be C:\Program Files (x86)\VirtualRadar\Web\script\vrs\enums.js.

trigger
Posts: 27
Joined: Sun Jan 19, 2014 10:03 pm

Re: aircraftMarkerRangeCircleDistanceUnit

Post by trigger » Mon Feb 03, 2014 9:37 am

Hi Andrew,
Many thanks for the response. I'll give it a go later. I did take a look in enums.js but didn't understand it :lol:
Regards
Dave

trigger
Posts: 27
Joined: Sun Jan 19, 2014 10:03 pm

Re: aircraftMarkerRangeCircleDistanceUnit

Post by trigger » Mon Feb 17, 2014 10:26 pm

Andrew, your suggestion worked - thanks.

Post Reply