Closed BallerG closed 1 year ago
I'm gonna go with "probably" - I did fiddle about with changing the selected colour based on criteria a couple of weeks ago and then side-lined it as "experiment successful, job done". It can be done in this script. I'll try and remember what I did - show you a proof of concept in the code and let you go on from there.
I do not really want this feature in the script as I prefer the selected a/c to be different colour when selected, but happy to show you the way.
Thanks. That would be great if you could send the code.
https://github.com/rikgale/VRSCustomMarkers/blob/main/MyMarkerTest.html
If you look in the MyMarkerTest.html Line 6 - 10 handle a basic scenario and turn all selected markers to be red. If you added other IF
statements in there above line 8 then these would process and the if none of these were met it would default to a red selection.
Thank you so much! That works.
Glad it all works - if you copy all the markers stuff below the colours section in MyMarkers1 into your script you should end up with the marker shapes as well as you colours. Ofc, you may have figured this out already :)
Thanks. Everything is working perfectly, including all the custom markers such as the EUFI marker
From testing if(aircraft.isMilitary && aircraft.isMilitary.val) works fine, but if I try to add say air ambulances they are not really possible as it breaks VRS
I've re-opened to remind me to have a play with this. Don't hold your breath waiting, but I will get there in the end.
I have had a play with the coding and got it stable, but I'll need to test better tomorrow when more are up
"From testing if(aircraft.isMilitary && aircraft.isMilitary.val) works fine, but if I try to add say air ambulances they are not really possible as it breaks VRS" - This might have had something to do with my poor regex usage. I have updated the test script. Anything with a space in the operator name should now work.
Not sure if something within the test code is broken or not, but it just turns VRS blank when it's added to the plugin
My markers 1 file is ok
The test file when edited in to the main code goes blank
Update. I now have the updated code working and will test it to see how VRS runs.
If you dump the code you are using in this thread I will take a look.
Here's my codes
This works OK
But when i add another such as police and or ambulance it breaks VRS after running for a while
Can you put your code between `
So it looks like this
Before the if(aircraft.operator.val.match.....
line
put if(aircraft.operator && aircraft.operator.val) {
and }
after the if(aircraft.operator.val.match.....
line
See what that does. If no joy I will try and have a play about tomorrow.
It checks to see if the operator is valid first. If not valid the whole things throws a wobbly without that line in there.
This is the coding lower down
It needs to be in both sections - I'll do some clearer code tomorrow as about to be AFK for a while
I have updated the coding as suggested and have it working at present
I shall monitor over the coming hours to see how it goes
I've updated the MyMarkersTest script - and actually tested it this time. Replaced police and fire with Ryanair and easyJet for more options - also put mil in there as well, and tested that as well
I have been running with the updated coding since last night and all remains OK so far with no freezing.
As long as it is working for you then all is good. Are you happy for me to close this now?
Everything seems stable at present, so I think it's fine to be closed.
Thanks for your help in solving it
Is it possible to run the Custom Markers whilst also running the Change V3 SVG Marker Fill Per Criteria.html script, which can force markers to stay the same colour when selected? https://github.com/vradarserver/vrs-custom-scripts/blob/master/Change%20V3%20SVG%20Marker%20Fill%20Per%20Criteria/Change%20V3%20SVG%20Marker%20Fill%20Per%20Criteria.html
As an example, I have got it working with the HM Coastguard BE20 (see below), Police EC35's/P68 and the AS65 helicopter, but it's proving more difficult with others such as the A400 and Typhoon's these continue to default back to yellow