Advertisement
Guest User

acarsmap.tpl

a guest
Jul 1st, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. <?php
  2. /**
  3. * These are some options for the ACARS map, you can change here
  4. *
  5. * By default, the zoom level and center are ignored, and the map
  6. * will try to fit the all the flights in. If you want to manually set
  7. * the zoom level and center, set "autozoom" to false.
  8. *
  9. * You can use these MapTypeId's:
  10. * http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId
  11. *
  12. * Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive
  13. *
  14. * Also, how to style the acars pilot list table. You can use these style selectors:
  15. *
  16. * table.acarsmap { }
  17. * table.acarsmap thead { }
  18. * table.acarsmap tbody { }
  19. * table.acarsmap tbody tr.even { }
  20. * table.acarsmap tbody tr.odd { }
  21. */
  22. ?>
  23. <script type="text/javascript">
  24. <?php
  25. /* These are the settings for the Google map. You can see the
  26. Google API reference if you want to add more options.
  27.  
  28. There's two options I've added:
  29.  
  30. autozoom: This will automatically center in on/zoom
  31. so all your current flights are visible. If false,
  32. then the zoom and center you specify will be used instead
  33.  
  34. refreshTime: Time, in seconds * 1000 to refresh the map.
  35. The default is 10000 (10 seconds)
  36. */
  37. ?>
  38. var acars_map_defaults = {
  39. autozoom: true,
  40. zoom: 4,
  41. center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"),
  42. mapTypeId: google.maps.MapTypeId.TERRAIN,
  43. refreshTime: 10000
  44. };
  45. </script>
  46. <div class="mapcenter" align="center">
  47. <div id="acarsmap" style="width:<?php echo Config::Get('MAP_WIDTH');?>; height: <?php echo Config::Get('MAP_HEIGHT')?>"></div>
  48. </div>
  49. <?php
  50. /* See below for details and columns you can use in this table */
  51. ?>
  52. <table border = "0" width="100%" class="acarsmap">
  53. <thead>
  54. <tr>
  55. <td><b>Pilot</b></td>
  56. <td><b>Flight Number</b></td>
  57. <td><b>Departure</b></td>
  58. <td><b>Arrival</b></td>
  59. <td><b>Status</b></td>
  60. <td><b>Altitude</b></td>
  61. <td><b>Speed</b></td>
  62. <td><b>Distance/Time Remain</b></td>
  63. </tr>
  64. </thead>
  65. <tbody id="pilotlist"></tbody>
  66. </table>
  67. <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script>
  68. <?php
  69. /* This is the template which is used in the table above, for each row.
  70. Be careful modifying it. You can simply add/remove columns, combine
  71. columns too. Keep each "section" (<%=...%>) intact
  72.  
  73. Variables you can use (what they are is pretty obvious)
  74.  
  75. Variable: Notes:
  76. <%=flight.pilotid%>
  77. <%=flight.firstname%>
  78. <%=flight.lastname%>
  79. <%=flight.pilotname%> First and last combined
  80. <%=flight.flightnum%>
  81. <%=flight.depapt%> Gives the airport name
  82. <%=flight.depicao%>
  83. <%=flight.arrapt%> Gives the airport name
  84. <%=flight.arricao%>
  85. <%=flight.phasedetail%>
  86. <%=flight.heading%>
  87. <%=flight.alt%>
  88. <%=flight.gs%>
  89. <%=flight.disremaining%>
  90. <%=flight.timeremaning%>
  91. <%=flight.aircraft%> Gives the registration
  92. <%=flight.aircraftname%> Gives the full name
  93. <%=flight.client%> FSACARS/Xacars/FSFK, etc
  94. <%=flight.trclass%> "even" or "odd"
  95.  
  96. You can also use logic in the templating, if you so choose:
  97. http://ejohn.org/blog/javascript-micro-templating/
  98. */
  99. ?>
  100. <script type="text/html" id="acars_map_row">
  101. <tr class="<%=flight.trclass%>">
  102. <td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a></td>
  103. <td><%=flight.flightnum%></td>
  104. <td><%=flight.depicao%></td>
  105. <td><%=flight.arricao%></td>
  106. <td><%=flight.phasedetail%></td>
  107. <td><%=flight.alt%></td>
  108. <td><%=flight.gs%></td>
  109. <td><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%></td>
  110. </tr>
  111. </script>
  112.  
  113. <?php
  114. /* This is the template for the little map bubble which pops up when you click on a flight
  115. Same principle as above, keep the <%=...%> tags intact. The same variables are available
  116. to use here as are available above.
  117. */
  118. ?>
  119. <script type="text/html" id="acars_map_bubble">
  120. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  121. <a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a><br />
  122. <strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br />
  123. <strong>Status: </strong><%=flight.phasedetail%><br />
  124. <strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br />
  125. </span>
  126. </script>
  127.  
  128. <?php
  129. /* This is a small template for information about a navpoint popup
  130.  
  131. Variables available:
  132.  
  133. <%=nav.title%>
  134. <%=nav.name%>
  135. <%=nav.freq%>
  136. <%=nav.lat%>
  137. <%=nav.lng%>
  138. <%=nav.type%> 2=NDB 3=VOR 4=DME 5=FIX 6=TRACK
  139. */
  140. ?>
  141. <script type="text/html" id="navpoint_bubble">
  142. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  143. <strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br />
  144. <strong>Type: </strong>
  145. <?php /* Show the type of point */ ?>
  146. <% if(nav.type == 2) { %> NDB <% } %>
  147. <% if(nav.type == 3) { %> VOR <% } %>
  148. <% if(nav.type == 4) { %> DME <% } %>
  149. <% if(nav.type == 5) { %> FIX <% } %>
  150. <% if(nav.type == 6) { %> TRACK <% } %>
  151. <br />
  152. <?php /* Only show frequency if it's not a 0*/ ?>
  153. <% if(nav.freq != 0) { %>
  154. <strong>Frequency: </strong><%=nav.freq%>
  155. <% } %>
  156. </span>
  157. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement