Icons in preview version

Discussions about the preview versions of Virtual Radar Server.
Forum rules
Please bear in mind if you do install a preview version that it is unfinished code, there may be bugs, bits missing, things that don't work etc.

Posts in this forum will not show up in forum search results. Old threads will be pruned occasionally.
WeKnowMC
Posts: 32
Joined: Fri Feb 19, 2016 11:58 pm

Re: Icons in preview version

Postby WeKnowMC » Tue Jan 24, 2017 8:52 pm

I've been trying to get custom aircraft icons to work however, I'm not sure that I'm putting the PNGs in the correct place. I am using the latest preview version of VRS with the custom content plugin enabled. I have set the site root directory to the Web directory with the images directory, then markers directory followed by my icons in PNGs. The server is returning a 404 and my custom icons are not showing on non mlat aircrafts when I use try to load load the images with this test code:

Code: Select all

<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: test.png',
                    selectedFileName: 'test-selected.png',
                    size: { width: 40, height: 40 },
                    matches: function(/** VRS.Aircraft */ aircraft) { return !aircraft.isMlat.val; }
                }));
            }
        });
    }
</script>

For some reason the server is not finding the PNGs. I see that the custom content plugin also has an resource image folder. Should I be putting the PNGs somewhere there?

UA4WIY
Posts: 22
Joined: Mon Aug 29, 2016 7:41 pm

Re: Icons in preview version

Postby UA4WIY » Tue Jan 31, 2017 6:20 pm

The .png file should be in the folder ..\images\markers

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

Re: Icons in preview version

Postby agw » Thu Feb 02, 2017 1:49 am

You're missing an open quote on this line:

Code: Select all

normalFileName: test.png',


It should be:

Code: Select all

normalFileName: 'test.png',


The browser console window would have been showing an error on that line when the site loaded, if you press F12 you should see it there.

WeKnowMC
Posts: 32
Joined: Fri Feb 19, 2016 11:58 pm

Re: Icons in preview version

Postby WeKnowMC » Fri Feb 17, 2017 11:55 am

agw wrote:You're missing an open quote on this line:

Code: Select all

normalFileName: test.png',


It should be:

Code: Select all

normalFileName: 'test.png',


The browser console window would have been showing an error on that line when the site loaded, if you press F12 you should see it there.


I've got this fixed now. It wasn't actually a problem with the quotes as I must have made an error whilst pasting the code into my post because I changed the file name to 'test' for demonstration purposes. The problem must have been either a weird caching issue or I had put the image files in the wrong place. Most likely the latter :)


Return to “Preview Versions”

Who is online

Users browsing this forum: No registered users and 1 guest