Getting Custom Elements?

Want to post something that doesn't quite fit into the other forums? This is the place for that.
Post Reply
GregoryGHarding
Posts: 96
Joined: Mon Jan 26, 2015 9:01 am
Location: CYYT

Getting Custom Elements?

Post by GregoryGHarding » Sat Jan 31, 2015 3:43 am

Looking in vrs.aircraftdetail.js for the header there are several elements to specify text to enter when aircraft is selected ex(icaoElement, regElement, opflagElement)

how can i add an element thats not currently listed there?

i know VRS.RenderProperty.OperatorIcao exists, just cant figure out how to add it to vrs.aircraftdetail.js via an element listed above.

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

Re: Getting Custom Elements?

Post by agw » Sat Feb 14, 2015 5:54 pm

I'm not quite sure what you mean - are you asking how to add elements to the header on the aircraft detail panel? If so then I'm afraid there isn't a way to easily add elements to the aircraft detail panel header, that part isn't customisable. You would have to write your own jQuery plugin to replace the aircraft detail plugin and then after the page has loaded you would need to destroy the standard plugin that's attached to the #aircraftDetail element and create an instance of your plugin in #aircraftDetail instead.

On the other hand, if you're asking how to add elements to the body of the details plugin (i.e. the bit where the altitude, speed etc. are shown, the bit that you can configure in options) then that should be fairly straight-forward. What is your custom element showing, is it text or HTML?

jnewell
Posts: 4
Joined: Mon Mar 30, 2015 6:54 pm
Location: United States

Re: Getting Custom Elements?

Post by jnewell » Mon Apr 20, 2015 7:11 pm

Hello, I'm just wondering if you know of any method to put a checkbox or some sort of html input element as a map overlay.
For example, trying to set it up so that when checked, only get the aircraft that are flagged as interested. and when not checked show all aircraft.

Thanks in advance,
Josh

jnewell
Posts: 4
Joined: Mon Mar 30, 2015 6:54 pm
Location: United States

Re: Getting Custom Elements?

Post by jnewell » Mon Apr 20, 2015 7:39 pm

I already know how to inject custom content, so I guess I'm mainly just wondering how to hook into the javascript that sets the filtering/interested settings.

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

Re: Getting Custom Elements?

Post by agw » Sun Apr 26, 2015 5:38 pm

This post lays out the basics of getting the Google Maps map handle and adding an element to it. In your case you'll want to add a div to contain your checkbox so that you can style it, and then add your checkboxes to it - but the principle will be the same:

http://forum.virtualradarserver.co.uk/v ... =571#p3026

Regarding modifying filters - I replied to your PM about that before I saw this message :) Basically at the moment it's a bit of a pain, especially if you want to remove filters, but the next version will have better support for programattically setting filters. The latest bleeding edge version of VRS has support added for it, but at the moment it's only been tested for filters that accept a single value.

ProHill
Posts: 29
Joined: Fri Jul 03, 2015 3:11 am
Location: KORD
Contact:

Re: Getting Custom Elements?

Post by ProHill » Sat Jul 25, 2015 10:43 pm

Andrew,

2 follow-ups on this topic, if you don't mind. I have become reasonably well-versed in the custom content plugin, including putting custom buttons on the map, but am struggling with the following:

1. Is it possible to add a Google Maps custom overlay onto the VRS map? I have another web page outside of VRS leveraging the maps API, where I have some weather overlays. I have not been successful getting this to work with the VRS map so far.

2. Related to that, I'm trying to figure out how to add a custom background to the VRS map. Again, I have an aviation sectional background on the standalone google map I created, but I haven't figured out how to hook that into VRS, if it is even possible.

I am running the latest preview release.

Thanks!

Andy

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

Re: Getting Custom Elements?

Post by agw » Tue Jul 28, 2015 1:19 am

As it happens I had an email over the weekend from someone pointing out that Weather Underground do a free API that might be suitable for getting weather radar onto the map. That API generates an image within a bounding set of coordinates, which I think you might be able to show as an overlay in Google Maps using the ground overlay API (https://developers.google.com/maps/docu ... ndoverlays). However I've not had a chance to experiment with it yet so I can't give you any tips on how it might be integrated into VRS - I've not tried it :)

If you have a working example where you have added overlays to Google Maps then yes, you should be able to get that working with VRS. You will want to hook the event that is raised by the page when it has finished initialising itself, at which point the map should be loaded and ready to go.

Your other web page might be telling Google Maps to load some libraries when it loads Google Maps. What's the tag that you're using to load Google Maps in this other page? IIRC Google Map libraries are specified in the query strings of the Google Maps URL. If you are loading a library then it is possible to tell VRS to load extra libraries when it loads Google Maps, I think I provide a variable or an object that you can override, but I'll need to look up how to do it.

Custom background to Google Maps - no idea, not tried it :) My best guess would be the ground overlay API that I linked previously. You'd need to figure out the latitude and longitude of the edges of the image so that you can pin it to the right place on the map, hopefully after that Google will take care of the rest. Again, I would try setting that up in VRS' page initialised event handler.

loww
Posts: 111
Joined: Sun Jun 28, 2015 10:55 am
Location: LOWW
Contact:

Re: Getting Custom Elements?

Post by loww » Wed Aug 12, 2015 4:06 pm

i have a ton of Position and Chart Data can someone help me gett in the VRS?!
:!: :!: :!: I search for People who want exchange VRS Data. I life near LOWW and i have a huge Coverage and multiple Receiver. :!: :!: :!:

Post Reply