Change maps

Want to post something that doesn't quite fit into the other forums? This is the place for that.
Post Reply
ognjen
Posts: 2
Joined: Thu Mar 30, 2017 11:14 am

Change maps

Post by ognjen » Thu Mar 30, 2017 1:09 pm

Hello all,
I would like to make some changes on VirtualRadar and I downloaded source code. After few days I conclude that is pretty hard to me to conclude from where to start.

I would like to avoid google maps, actually instead of google maps I just need some background (dark for example). In this case I need to keep whole logic related to airplanes. It means that I would like to see plane as I have right now with google maps but in background I want to see plane background not map. First of all is this possible and if yes from where to start. On desktop.html page I found all scripts but it is pretty complicated to conclude how to switch google maps with some background.

Regards,
Ognjen

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

Re: Change maps

Post by nitro999 » Thu Mar 30, 2017 7:36 pm

Have a look at the custom content plugin. Using that and some javascript it's possible to change the default Google maps contrast style maps to whatever style you want. That might do what you're looking for.

ognjen
Posts: 2
Joined: Thu Mar 30, 2017 11:14 am

Re: Change maps

Post by ognjen » Fri Mar 31, 2017 2:28 pm

I would like to use virtual radar without internet connection so it means that I will have problem with google maps even through plugin. Virtual radar always trying to connect to google maps

CharlieAlpha
Posts: 63
Joined: Sat Mar 15, 2014 6:41 pm

Re: Change maps

Post by CharlieAlpha » Fri Mar 31, 2017 7:28 pm

Have you tried running in offline mode? There is a tick box on the VRS server screen. If I remember correctly that allows you run without a internet connection and without displaying the google maps (you won't get photos or route updates etc either). Adding "?notOnline=1" to your VRS URL should have the same effect eg.

http://127.0.0.1/VirtualRadar?notOnline=1

HTH

Charlie

skua345
Posts: 2
Joined: Fri Nov 11, 2016 12:37 pm

Re: Change maps

Post by skua345 » Thu Apr 13, 2017 1:15 pm

Hi
i have added some custom content plugins but cant find any maps or overlays javascript for the uk, the map and overlays you posted the link to look fantastic, where did you get them please

thanks
carolyn

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

Re: Change maps

Post by agw » Sun Apr 23, 2017 2:36 pm

You can replace the maps by writing a JQueryUI plugin that implements the same public methods as the existing map plugin (the methods are listed in the typescript interface IMap in $\VirtualRadar.WebSite\Site\typings\typedefs.d.ts, but you don't need to write it in typescript if you don't want to) and then make sure that your map plugin is registered after the standard map plugin.

However, bear in mind that Google Maps is responsible for drawing on the map which means that it is responsible for drawing the aircraft markers, range circles and aircraft trails. You will need to put in a lot of work if you want to end up with the functionality of Google Maps minus the map itself.

You can run VRS while you're offline, all that happens is the map load will timeout and it'll show a message in the maps panel saying that it can't show the map. The rest of the site will continue to work, although you might have to wait for the timeout to expire before the other bits spring into life. You can force offline mode with a query string parameter, as mentioned by CharlieAlpha.

Post Reply