Showing 4 changed files with 37 additions and 1 deletions
+1
Nasal/map.nas
... ...
@@ -40,6 +40,7 @@ var mapClass = {
40 40
         if (m.device.role == 'MFD') {
41 41
             m.layers.tcas = MapTcas.new(m.device, m.group);
42 42
             m.layers.topo = MapTopo.new(m.device, m.group);
43
+            m.layers.track = MapTrack.new(m.device, m.group);
43 44
         }
44 45
 
45 46
         m.mapOrientation = m.device.display.display.createGroup('MapOrientation')
+31
Nasal/maps/track.nas
... ...
@@ -0,0 +1,31 @@
1
+var MapTrack = {
2
+    new : func (device, group) {
3
+        var m = { parents: [MapTrack] };
4
+        m.device = device;
5
+        m.visibility = 0;
6
+        m.group = group.createChild('path', 'track')
7
+            .moveTo((m.device.data.mapview[0] + m.device.data.mapclip.left)/2, 400)
8
+            .vertTo(m.device.data.mapsize[1])
9
+            .setCenter((m.device.data.mapview[0] + m.device.data.mapclip.left)/2, 400)
10
+            .setRotation((data.trk + 180) * D2R)
11
+            .setColor(1,0,0)
12
+            .setStrokeLineWidth(3)
13
+            .setVisible(m.visibility);
14
+        return m;
15
+    },
16
+    off: func {
17
+        me.setVisible(0);
18
+        me.group.setVisible(0);
19
+        me.group.removeAllChildren();
20
+    },
21
+    update: func {
22
+        me.visibility != 0 or return;
23
+        me.group.setRotation((data.trk + 180) * D2R);
24
+    },
25
+    setVisible : func (v) {
26
+        if (me.visibility != v) {
27
+            me.visibility = v;
28
+            me.group.setVisible(v);
29
+        }
30
+    },
31
+};
+4 -1
Nasal/softkeys.nas
... ...
@@ -1231,6 +1231,9 @@ var softkeysClass = {
1231 1231
                         call(me.bindings.PFD.INSET.NAVAIDS.declutter, ['APT' ], me);
1232 1232
                     },
1233 1233
                 },
1234
+                TRACK: func {
1235
+                    call(me.bindings.PFD.INSET.declutter, ['MAPTRACK', 'track'], me);
1236
+                },
1234 1237
             },
1235 1238
         },
1236 1239
     },
... ...
@@ -1303,7 +1306,7 @@ var keyMap = {
1303 1306
     MFD : {
1304 1307
         texts : ['ENGINE', '', 'MAP', '', '', '', '', '', '', 'DCLTR', 'SHW CHRT', 'CHKLIST'],
1305 1308
         MAP : {
1306
-            texts : ['TRAFFIC', 'ROUTE', 'TOPO', 'TERRAIN', 'NAVAIDS', '','', '', '', '', 'BACK'],
1309
+            texts : ['TRAFFIC', 'ROUTE', 'TOPO', 'TERRAIN', 'NAVAIDS', '','TRACK', '', '', '', 'BACK'],
1307 1310
             NAVAIDS : {
1308 1311
                 first : 2,
1309 1312
                 texts : ['VOR', 'TACAN', 'NDB', 'DME', 'APT', '', 'ALL', '', '', 'BACK' ],
+1
zkv1000.nas
... ...
@@ -11,6 +11,7 @@ files_to_load = [
11 11
     'maps/tiles.nas',
12 12
     'maps/tcas.nas',
13 13
     'maps/topo.nas',
14
+    'maps/track.nas',
14 15
     'map.nas',     # moves the maps
15 16
     'display.nas',
16 17
     'menu.nas',    # manage windows