Esempio n. 1
0
 											$history_output .=  $spotter_history['altitude'];
 											$history_output .= '],';
 
 										}
 									}
 									if ($history_output != '') $output .= substr($history_output, 0, -1);
 								$output .= ']';
 							$output .= '}';
 				$output .= '},';
                 
 			}
 */
 if ($from_archive) {
     $spotter_history_array = SpotterArchive::getAllArchiveSpotterDataById($spotter_item['flightaware_id']);
 } else {
     $spotter_history_array = SpotterLive::getAllLiveSpotterDataById($spotter_item['flightaware_id']);
 }
 $d = false;
 foreach ($spotter_history_array as $key => $spotter_history) {
     if (abs($spotter_history['longitude'] - $spotter_item['longitude']) > 200 || $d == true) {
         if ($d == false) {
             $d = true;
         }
     } else {
         $alt = round($spotter_history['altitude'] / 10) * 10;
         if (!isset($prev_alt) || $prev_alt != $alt) {
             if (isset($prev_alt)) {
                 //$output_history .= '['.$spotter_history['longitude'].', '.$spotter_history['latitude'].','.$spotter_history['altitude'].']';
                 $output_history .= '[' . $spotter_history['longitude'] . ', ' . $spotter_history['latitude'] . ']';
                 $output_history .= ']}},';
                 $output .= $output_history;