Custom Link to Flightradar24

Are you having problems with using or developing a plugin? Let me know here.
louisd13
Posts: 2
Joined: Wed Nov 22, 2017 4:53 am

Custom Link to Flightradar24

Postby louisd13 » Wed Nov 22, 2017 5:09 am

Hi Sorry to double post (I also asked in an old post, but wanted to start a fresh post of my own), but I was looking for some help in creating a custom link to flightradar24 from my tracked flights in VRS. I was successfully able to do this with flightaware following previously listed instructions by jfm using the custom content plugin. I tried editing the script to get it to work with flightradar24 as well, but am having no luck. The best I can come up with is as follows:

Code: Select all

<script type="text/javascript">
VRS.LinkSite["FlightRadar24DotCom"] = "flightradar24.com";

VRS.linkRenderHandlers.push(
   new VRS.LinkRenderHandler({
      linkSite:           VRS.LinkSite.FlightRadar24DotCom,
      displayOrder:       400,
      canLinkAircraft:    function(/** VRS.Aircraft */ aircraft) { return aircraft && (aircraft.registration.val || aircraft.callsign.val); },
      hasChanged:         function(/** VRS.Aircraft */ aircraft) { return aircraft.registration.chg || aircraft.callsign.chg; },
      title:              'www.flightradar24.com',
      buildUrl:           function(/** VRS.Aircraft */ aircraft) { return 'http://fr24.com/'+selected.flight' + ( aircraft.callsign.val ? (!isNaN(aircraft.callsign.val) && aircraft.operatorIcao.val ? VRS.stringUtility.htmlEscape(aircraft.formatOperatorIcao() + aircraft.formatCallsign()) : VRS.stringUtility.htmlEscape(aircraft.formatCallsign())) : VRS.stringUtility.htmlEscape(aircraft.formatRegistration(true)) ); },
      target:             'flightradar24'
   })
);
</script>



Any assistance will be GREATLY appreciated as I have been trying to figure this out for over a month!!

Thanks,

Louis

nitro999
Posts: 39
Joined: Tue Feb 09, 2016 7:32 pm
Location: UK
Contact:

Re: Custom Link to Flightradar24

Postby nitro999 » Tue Dec 05, 2017 8:23 pm

This is what I'm using, and works ok for me:

Code: Select all

<script type="text/javascript">
VRS.LinkSite["Lector_FlightRadar24DotCom"] = "flightradar24.com";
VRS.linkRenderHandlers.push(
   new VRS.LinkRenderHandler({
      linkSite:           VRS.LinkSite.Lector_FlightRadar24DotCom,
      displayOrder:       500,
       canLinkAircraft:    function(/** VRS.Aircraft */ aircraft) { return aircraft && (aircraft.registration.val || aircraft.callsign.val); },
       hasChanged:         function(/** VRS.Aircraft */ aircraft) { return aircraft.registration.chg || aircraft.callsign.chg; },
            title:              'www.flightradar24.com',
buildUrl:           function(/** VRS.Aircraft */ aircraft) { return 'http://www.flightradar24.com/' +
VRS.stringUtility.htmlEscape(aircraft.formatCallsign()); },
            target:             'flightradar24'
   })
);
</script>
http://www.virtualradaruk.com
Radarcape, Swindon (UK) | FR24: T-EGVA10 | Flightaware 16984


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest