Hi,
I have been looking at how the icons are drawn in PiAware3 with the view to see if I can customize them (I am a bit OCD and all the “Heavies” having four engines bugs me a wee bit ).
This is what I have found. The files used are found in /usr/share/dump1090-fa/html. There seem to me two main files involved, the first is the markers.js file which is responsible for the design and classification of the actual icons, and the second is planeObject.js
In the planeObject.js file there are a number of categories assigned to aircraft type:
[size=85]PlaneObject.prototype.getMarkerIconType = function() {
var lookup = {
‘A1’ : ‘light’,
‘A2’ : ‘medium’,
‘A3’ : ‘medium’,
‘A5’ : ‘heavy’,
‘A7’ : ‘rotorcraft’
These terms light, medium etc are used in the markers.js file to define which icon is used:
var MarkerIcons = {
generic : {
scale : 0.4,
size : [64, 64],
anchor : [32, 32],
path : _generic_plane_svg
},
light : {
scale : 0.4,
size : [64, 64],
anchor : [32, 25],
path : _beechcraft_svg
},
medium : {
scale : 0.4,
size : [64, 64],
anchor : [32, 32],
path : _generic_plane_svg
},
etc
Each of the paths seems to refer to the actual SVG data in the markers.js file, for example:
// 64x49
var _beechcraft_svg =
"m 31.9375,0.21875 c -0.06777,0.0107988 -0.115451,0.0391469 -0.15625,0.0625 C 31.672725,0.37187346 31.571656,0.508205 31.5,0.625 c -0.03614,0.0602071 -0.06208,0.095702 -0.09375,0.15625 -0.07403,0.15902301 -0.135583,0.3268225 -0.1875,0.5 -0.04551,0.1172902 -0.09299,0.229501 -0.125,0.34375 C 31.061962,1.7428305 31.051772,1.8837099 31.03125,2 31.013723,2.1172825 31.001884,2.2232944 31,2.34375 etc…
Two things I can’t figure out.
What is the correct SVG format to used? I have copied the data out of a SVG file and used that but it doesn’t draw the icon (tried all sorts of variations, sizes etc).
Second what defines if a given aircraft is a A1 or A2 etc which defines which icon it will use.
Hope this makes sense![/size]