Page 3 of 3

Re: Icons in preview version

Posted: Tue Jan 24, 2017 8:52 pm
by WeKnowMC
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?

Re: Icons in preview version

Posted: Tue Jan 31, 2017 6:20 pm
by UA4WIY
The .png file should be in the folder ..\images\markers

Re: Icons in preview version

Posted: Thu Feb 02, 2017 1:49 am
by agw
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.

Re: Icons in preview version

Posted: Fri Feb 17, 2017 11:55 am
by WeKnowMC
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 :)

Re: Icons in preview version

Posted: Mon Aug 24, 2020 10:20 am
by leemoore1966
I am seeing a similar issue to the report of not finding the custom png files
I have placed my custom .png in the same directory as all of the other referenced png files - is this correct ?

when attempting to load I see the following error in the browser
GET http://<IP>:9000/VirtualRadar/images/web-markers/top/Wdth-32/Hght-32/Rotate-0/custom.png
404 not found

I suspect there is a process issue here, because if I copy an existing png to a new name (ignoring my new png), and attempt to reference this, I get the same issue.