Custom Marker Based on Multiple Hex Codes

Are you having problems with using or developing a plugin? Let me know here.
Post Reply
Squadgy
Posts: 15
Joined: Sat Sep 01, 2018 7:45 pm

Custom Marker Based on Multiple Hex Codes

Post by Squadgy » Sun Jun 02, 2019 9:32 am

Good morning

I am using the custom script to display a specific aircraft marker based on the Hex code (ICAO). I have this working for one Hex code, however I can't work out the syntax to allow other Hex codes to be added. Here's the script :
<script type="text/javascript">
if(VRS && VRS.globalDispatch && VRS.serverConfig) {
VRS.globalDispatch.hook(VRS.globalEvent.bootstrapCreated, function(bootStrap) {
if(VRS.globalOptions && VRS.globalOptions.aircraftMarkers) {
VRS.globalOptions.aircraftMarkers.unshift(
//-----------------------------------------------------------------------------------------------------------------

new VRS.AircraftMarker({
normalFileName: 'qcop.png',
selectedFileName: 'qcops.png',
size: { width: 40, height: 40 },
matches: function (aircraft) { return aircraft.icao.val === '4250F7'; }

//-----------------------------------------------------------------------------------------------------------------
})
)};
});
}
</script>
If I want an aircraft with the Hex '4250F8' to also display the custom marker how do I achieve this ?

I have tried also creating a separate custom script, but this doesn't seem to work, despite everything except the Hex in the script being identical .

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

Re: Custom Marker Based on Multiple Hex Codes

Post by Squadgy » Sun Jun 02, 2019 8:44 pm

I have managed to get this resolved.

For anyone that has the same issue in the future, it was a simple coaching issue! As the second hex had used the default aircraft symbol at some stage all I had to do was clear the cache and it showed as a quadcopter symbol!

Two custom scripts were needed, one for each Hex.

Post Reply