Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.76 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.  
  39. var acars_map_defaults = {
  40. autozoom: true,
  41. zoom: 4,
  42. center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"),
  43. mapTypeId: google.maps.MapTypeId.TERRAIN,
  44. refreshTime: 10000,
  45. styles: [
  46. {
  47. "featureType": "all",
  48. "elementType": "all",
  49. "stylers": [
  50. {
  51. "invert_lightness": true
  52. },
  53. {
  54. "saturation": 10
  55. },
  56. {
  57. "lightness": 30
  58. },
  59. {
  60. "gamma": 0.5
  61. },
  62. {
  63. "hue": "#435158"
  64. }
  65. ]
  66. }
  67. ]
  68. };
  69. </script>
  70.  
  71. <div id="acarsmap" style="width: 100%; height: 300px;"></div>
  72.  
  73. <?php
  74. /* See below for details and columns you can use in this table */
  75. ?>
  76. <div class="table-responsive">
  77. <table border = "0" width="100%" class="acarsmap table table-bordered">
  78. <thead>
  79. <tr>
  80. <td><b>Pilot</b></td>
  81. <td><b>Flight Number</b></td>
  82. <td><b>Departure</b></td>
  83. <td><b>Arrival</b></td>
  84. <td><b>Status</b></td>
  85. <td><b>Altitude</b></td>
  86. <td><b>Speed</b></td>
  87. <td><b>Distance/Time Remain</b></td>
  88. </tr>
  89. </thead>
  90. <tbody id="pilotlist"></tbody>
  91. </table>
  92. </div>
  93.  
  94. <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script>
  95. <?php
  96. /* This is the template which is used in the table above, for each row.
  97. Be careful modifying it. You can simply add/remove columns, combine
  98. columns too. Keep each "section" (<%=...%>) intact
  99.  
  100. Variables you can use (what they are is pretty obvious)
  101.  
  102. Variable: Notes:
  103. <%=flight.pilotid%>
  104. <%=flight.firstname%>
  105. <%=flight.lastname%>
  106. <%=flight.pilotname%> First and last combined
  107. <%=flight.flightnum%>
  108. <%=flight.depapt%> Gives the airport name
  109. <%=flight.depicao%>
  110. <%=flight.arrapt%> Gives the airport name
  111. <%=flight.arricao%>
  112. <%=flight.phasedetail%>
  113. <%=flight.heading%>
  114. <%=flight.alt%>
  115. <%=flight.gs%>
  116. <%=flight.disremaining%>
  117. <%=flight.timeremaning%>
  118. <%=flight.aircraft%> Gives the registration
  119. <%=flight.aircraftname%> Gives the full name
  120. <%=flight.client%> FSACARS/Xacars/FSFK, etc
  121. <%=flight.trclass%> "even" or "odd"
  122.  
  123. You can also use logic in the templating, if you so choose:
  124. http://ejohn.org/blog/javascript-micro-templating/
  125. */
  126. ?>
  127. <script type="text/html" id="acars_map_row">
  128. <tr class="<%=flight.trclass%>">
  129. <td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a></td>
  130. <td><%=flight.flightnum%></td>
  131. <td><%=flight.depicao%></td>
  132. <td><%=flight.arricao%></td>
  133. <td><%=flight.phasedetail%></td>
  134. <td><%=flight.alt%></td>
  135. <td><%=flight.gs%></td>
  136. <td><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%></td>
  137. </tr>
  138. </script>
  139.  
  140. <?php
  141. /* This is the template for the little map bubble which pops up when you click on a flight
  142. Same principle as above, keep the <%=...%> tags intact. The same variables are available
  143. to use here as are available above.
  144. */
  145. ?>
  146. <script type="text/html" id="acars_map_bubble">
  147. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  148. <a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a><br />
  149. <strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br />
  150. <strong>Status: </strong><%=flight.phasedetail%><br />
  151. <strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br />
  152. </span>
  153. </script>
  154.  
  155. <?php
  156. /* This is a small template for information about a navpoint popup
  157.  
  158. Variables available:
  159.  
  160. <%=nav.title%>
  161. <%=nav.name%>
  162. <%=nav.freq%>
  163. <%=nav.lat%>
  164. <%=nav.lng%>
  165. <%=nav.type%> 2=NDB 3=VOR 4=DME 5=FIX 6=TRACK
  166. */
  167. ?>
  168. <script type="text/html" id="navpoint_bubble">
  169. <span style="font-size: 10px; text-align:left; width: 100%" align="left">
  170. <strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br />
  171. <strong>Type: </strong>
  172. <?php /* Show the type of point */ ?>
  173. <% if(nav.type == 2) { %> NDB <% } %>
  174. <% if(nav.type == 3) { %> VOR <% } %>
  175. <% if(nav.type == 4) { %> DME <% } %>
  176. <% if(nav.type == 5) { %> FIX <% } %>
  177. <% if(nav.type == 6) { %> TRACK <% } %>
  178. <br />
  179. <?php /* Only show frequency if it's not a 0*/ ?>
  180. <% if(nav.freq != 0) { %>
  181. <strong>Frequency: </strong><%=nav.freq%>
  182. <% } %>
  183. </span>
  184. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement