3 * This file is part of FlightAirmap.
5 * Copyright (c) Ycarus (Yannick Chabanois) <support@flightairmap.com>
6 * Licensed under AGPL license.
7 * For more information see: https://www.flightairmap.com/
9 require_once('require/class.Connection.php');
10 require_once('require/class.Common.php');
11 if (isset($globalProtect) && $globalProtect) {
13 if (!isset($_SESSION['protect']) ||
!isset($_SERVER['HTTP_REFERER'])) {
14 echo 'You must access this page using the right way.';
19 $no3dmodels = false; // Only for testing
20 $one3dmodel = false; // Only for testing
21 if ((isset($globalMap3DForceModel) && $globalMap3DForceModel != '') ||
(isset($globalMap3DOneModel) && $globalMap3DOneModel)) {
24 if (isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') {
29 if (isset($_GET['tracker'])) $tracker = true;
30 if (isset($_GET['marine'])) $marine = true;
32 require_once('require/class.Tracker.php');
33 require_once('require/class.TrackerLive.php');
34 require_once('require/class.TrackerArchive.php');
35 $TrackerLive = new TrackerLive();
36 $Tracker = new Tracker();
37 $TrackerArchive = new TrackerArchive();
39 require_once('require/class.Marine.php');
40 require_once('require/class.MarineLive.php');
41 require_once('require/class.MarineArchive.php');
42 $MarineLive = new MarineLive();
43 $Marine = new Marine();
44 $MarineArchive = new MarineArchive();
46 require_once('require/class.Spotter.php');
47 require_once('require/class.SpotterLive.php');
48 require_once('require/class.SpotterArchive.php');
49 $SpotterLive = new SpotterLive();
50 $Spotter = new Spotter();
51 $SpotterArchive = new SpotterArchive();
54 date_default_timezone_set('UTC');
55 $begintime = microtime(true);
56 $Common = new Common();
59 function quaternionrotate($heading, $attitude = 0, $bank = 0) {
60 // Assuming the angles are in radians.
61 $c1 = cos($heading/2);
62 $s1 = sin($heading/2);
63 $c2 = cos($attitude/2);
64 $s2 = sin($attitude/2);
69 $w =$c1c2*$c3 - $s1s2*$s3;
70 $x =$c1c2*$s3 +
$s1s2*$c3;
71 $y =$s1*$c2*$c3 +
$c1*$s2*$s3;
72 $z =$c1*$s2*$c3 - $s1*$c2*$s3;
73 return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
74 // return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
79 if (isset($_GET['download'])) {
80 if ($_GET['download'] == "true")
82 header('Content-disposition: attachment; filename="flightairmap.json"');
85 header('Content-Type: text/javascript');
87 if (!isset($globalJsonCompress)) $compress = true;
88 else $compress = $globalJsonCompress;
90 $from_archive = false;
93 $filter['source'] = array();
95 if ((!isset($globalMapVAchoose) ||
$globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
96 if ((!isset($globalMapVAchoose) ||
$globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
97 if ((!isset($globalMapVAchoose) ||
$globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
98 if ((!isset($globalMapchoose) ||
$globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
99 if ((!isset($globalMapchoose) ||
$globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
100 if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING
);
101 if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING
);
102 if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING
);
103 if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING
);
104 if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING
);
105 if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING
);
106 if (isset($_COOKIE['filter_race']) && $_COOKIE['filter_race'] != 'all') $filter['race'] = filter_var($_COOKIE['filter_race'],FILTER_SANITIZE_NUMBER_INT
);
107 if (isset($_COOKIE['filter_blocked']) && $_COOKIE['filter_blocked'] == 'true') $filter['blocked'] = true;
109 if (isset($_COOKIE['map_3d_limit'])) {
110 $limit = filter_var($_COOKIE['map_3d_limit'],FILTER_SANITIZE_NUMBER_INT
);
114 if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
118 if (isset($_GET['ident'])) {
119 $ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
120 $spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident);
121 if (empty($spotter_array)) {
122 $from_archive = true;
123 $spotter_array = $SpotterArchive->getLastArchiveSpotterDataByIdent($ident);
126 } elseif (isset($_GET['flightaware_id'])) {
127 $flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
128 $spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
129 if (empty($spotter_array)) {
130 $from_archive = true;
131 $spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
134 } elseif (isset($_GET['coord'])) {
135 $coord = explode(',',$_GET['coord']);
136 $spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter);
137 } elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) {
138 $from_archive = true;
139 // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
140 // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
141 $begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
142 $enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
143 $archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
144 $begindate = date('Y-m-d H:i:s',$begindate);
145 $enddate = date('Y-m-d H:i:s',$enddate);
146 $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
148 //$spotter_array = $SpotterLive->getMinLiveSpotterData($filter);
149 $spotter_array = $SpotterLive->getMinLastLiveSpotterData($filter);
152 $spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
155 if (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) {
156 $from_archive = true;
157 // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
158 // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
159 $begindate = filter_input(INPUT_GET
,'begindate',FILTER_SANITIZE_NUMBER_INT
);
160 $enddate = filter_input(INPUT_GET
,'enddate',FILTER_SANITIZE_NUMBER_INT
);
161 $archivespeed = filter_input(INPUT_GET
,'speed',FILTER_SANITIZE_NUMBER_INT
);
162 $begindate = date('Y-m-d H:i:s',$begindate);
163 $enddate = date('Y-m-d H:i:s',$enddate);
165 $spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter);
167 $spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter);
169 $spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
171 } elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
172 $from_archive = true;
173 // $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
174 // $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
175 // $begindate = filter_var($_COOKIE['archive_begin'],FILTER_SANITIZE_NUMBER_INT);
176 // $enddate = filter_var($_COOKIE['archive_end'],FILTER_SANITIZE_NUMBER_INT);
177 $begindate = $_COOKIE['archive_begin'];
178 $begindateinitial = $_COOKIE['archive_begin'];
179 if (isset($globalAircraftMaxUpdate)) {
180 $begindate = $begindate - $globalAircraftMaxUpdate;
182 $begindate = $begindate - 3000;
184 $enddate = $_COOKIE['archive_end'];
185 $enddateinitial = $_COOKIE['archive_end'];
186 $archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT
);
187 $begindate = date('Y-m-d H:i:s',$begindate);
188 $enddate = date('Y-m-d H:i:s',$enddate);
189 //echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
191 $spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter);
193 $spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter);
195 $spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
197 } elseif ($tracker) {
199 if (isset($_GET['coord']) && $_GET['coord'] != '') {
200 $coord = explode(',',$_GET['coord']);
201 if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT
) && filter_var($coord[1],FILTER_VALIDATE_FLOAT
) && filter_var($coord[2],FILTER_VALIDATE_FLOAT
) && filter_var($coord[3],FILTER_VALIDATE_FLOAT
)
202 && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
206 $previous_filter = $filter;
207 if ((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackTracker']) && $_COOKIE['MapTrackTracker'] != '')) {
208 $filter = array_merge($filter,array('id' => $_COOKIE['MapTrackTracker']));
209 $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
211 } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) {
212 $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']);
214 } elseif (!isset($_COOKIE['singlemodel']) ||
$_COOKIE['singlemodel'] == 'false') {
215 $spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false);
217 $spotter_array = array();
219 $filter = $previous_filter;
222 //if (isset($_GET['coord']) && $_GET['coord'] != '') {
223 if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
224 $coord = explode(',',$_GET['coord']);
225 if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT
) && filter_var($coord[1],FILTER_VALIDATE_FLOAT
) && filter_var($coord[2],FILTER_VALIDATE_FLOAT
) && filter_var($coord[3],FILTER_VALIDATE_FLOAT
)
226 && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
230 $previous_filter = $filter;
231 if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') ||
(!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '')) {
232 //$filter = array_merge($filter,array('id' => $_COOKIE['MapTrackMarine']));
233 //$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
234 $spotter_array = $MarineLive->getMinLastLiveMarineDataByID($_COOKIE['MapTrackMarine'],$filter,false);
235 } elseif (isset($_COOKIE['MapTrackMarine']) && $_COOKIE['MapTrackMarine'] != '' && !empty($coord)) {
236 $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false,$_COOKIE['MapTrack']);
237 } elseif (!isset($_COOKIE['singlemodel']) ||
$_COOKIE['singlemodel'] == 'false') {
238 $spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,false);
240 $spotter_array = array();
242 $filter = $previous_filter;
245 if (!((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) && isset($_GET['coord']) && $_GET['coord'] != '') {
246 $coord = explode(',',$_GET['coord']);
247 if (!(filter_var($coord[0],FILTER_VALIDATE_FLOAT
) && filter_var($coord[1],FILTER_VALIDATE_FLOAT
) && filter_var($coord[2],FILTER_VALIDATE_FLOAT
) && filter_var($coord[3],FILTER_VALIDATE_FLOAT
)
248 && $coord[0] > -180.0 && $coord[0] < 180.0 && $coord[1] > -90.0 && $coord[1] < 90.0 && $coord[2] > -180.0 && $coord[2] < 180.0 && $coord[3] > -90.0 && $coord[3] < 90.0)) {
252 $previous_filter = $filter;
253 if (((isset($_COOKIE['singlemodel']) && $_COOKIE['singlemodel'] == 'true') ||
(!isset($_COOKIE['singlemodel']) && isset($globalMap3DSelected) && $globalMap3DSelected)) && (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '')) {
254 //$filter = array_merge($filter,array('id' => $_COOKIE['MapTrack']));
255 $spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,$limit);
256 //$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false);
257 } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '') {
258 //$spotter_array = $SpotterLive->getMinLastLiveSpotterDataByID($_COOKIE['MapTrack'],$filter,false);
259 //if (empty($spotter_array)) $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,false,$_COOKIE['MapTrack']);
260 $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,$limit,$_COOKIE['MapTrack']);
261 } elseif (!isset($_COOKIE['singlemodel']) ||
$_COOKIE['singlemodel'] == 'false') {
262 $spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,$limit);
264 $spotter_array = array();
266 $filter = $previous_filter;
268 //print_r($spotter_array);
269 if (!empty($spotter_array) && isset($coord)) {
271 if (isset($_GET['archive'])) {
272 $flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter);
274 $flightcnt = $TrackerLive->getLiveTrackerCount($filter);
277 if (isset($_GET['archive'])) {
278 $flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter);
280 $flightcnt = $MarineLive->getLiveMarineCount($filter);
283 if (isset($_GET['archive'])) {
284 $flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
286 $flightcnt = $SpotterLive->getLiveSpotterCount($filter);
289 if ($flightcnt == '') $flightcnt = 0;
290 } else $flightcnt = 0;
292 $sqltime = round(microtime(true)-$begintime,2);
294 $minitracktime_begin = time();
295 $minitracktime = $minitracktime_begin;
297 $lastupdate = filter_input(INPUT_GET
,'update',FILTER_SANITIZE_NUMBER_INT
);
299 if (file_exists(dirname(__FILE__
).'/models/modelsdb')) {
300 if (($handle = fopen(dirname(__FILE__
).'/models/modelsdb','r')) !== FALSE) {
301 while (($row = fgetcsv($handle,1000)) !== FALSE) {
302 if (isset($row[1]) ){
304 $modelsdb[$model] = $row[1];
310 $modelsdb2 = array();
311 if (file_exists(dirname(__FILE__
).'/models/gltf2/modelsdb')) {
312 if (($handle = fopen(dirname(__FILE__
).'/models/gltf2/modelsdb','r')) !== FALSE) {
313 while (($row = fgetcsv($handle,1000)) !== FALSE) {
314 if (isset($row[1]) ){
317 if (isset($row[2])) {
319 $modelsdb2[$model] = array('glb' => $row[1], 'size' => $minisize);
321 $modelsdb2[$model] = array('glb' => $row[1], 'size' => 20);
328 $heightrelative = 'NONE';
329 //$heightrelative = 'RELATIVE_TO_GROUND';
331 $prev_flightaware_id = '';
335 $minimumpixelsize = 20;
336 if (isset($archivespeed)) $speed = $archivespeed;
339 $output .= '{"id" : "document", "name" : "tracker","version" : "1.0"';
341 $output .= '{"id" : "document", "name" : "marine","version" : "1.0"';
343 $output .= '{"id" : "document", "name" : "fam","version" : "1.0"';
345 // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}';
347 // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
348 //$output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
349 if ($from_archive === true) {
350 $output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : '.$speed.',"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER","interval": "%minitime%/%maxitime%"}';
352 $output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : '.$speed.',"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
355 // $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"step": "SYSTEM_CLOCK_MULTIPLIER"}';
357 if (!empty($spotter_array) && is_array($spotter_array))
360 foreach($spotter_array as $spotter_item)
363 //if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND';
364 date_default_timezone_set('UTC');
365 if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
367 $image = $spotter_item['image_thumbnail'];
369 $image = "images/placeholder_thumb.png";
372 if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
373 elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
374 elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
375 if ($prev_flightaware_id != $id) {
376 if ($prev_flightaware_id != '') {
378 if ($nblatlong == 1) {
379 $output .= ',"'.date("c").'", ';
380 $output .= $prevlong.', ';
382 if (!$marine) $output .= ', '.$prevalt;
383 else $output .= ', 0';
388 //$output .= ', '.$orientation.']}';
392 $prev_flightaware_id = $id;
395 $output .= '"id": "'.$id.'",';
396 $output .= '"properties": {';
397 $output .= '"flightcnt": "'.$flightcnt.'",';
398 $output .= '"onground": %onground%,';
399 $output .= '"lastupdate": "'.$lastupdate.'",';
400 if (isset($spotter_item['aircraft_icao'])) {
401 $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
403 if (isset($spotter_item['departure_airport'])) {
404 $output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",';
406 if (isset($spotter_item['arrival_airport'])) {
407 $output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",';
409 if (isset($spotter_item['squawk'])) {
410 $output .= '"squawk": "'.$spotter_item['squawk'].'",';
412 if (isset($spotter_item['registration'])) $output .= '"registration": "'.$spotter_item['registration'].'",';
413 if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",';
414 if (isset($spotter_item['ident'])) $output.= '"ident": '.json_encode($spotter_item['ident']).',';
416 if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).',';
417 $output.= '"type": "tracker"';
419 if (isset($spotter_item['type'])) $output .= '"marine_type": '.json_encode($spotter_item['type']).',';
420 if (isset($spotter_item['captain_name'])) $output .= '"captain": '.json_encode($spotter_item['captain_name']).',';
421 if (isset($spotter_item['race_id'])) $output .= '"raceid": '.$spotter_item['race_id'].',';
422 if (isset($spotter_item['race_name'])) $output .= '"race": '.json_encode($spotter_item['race_name']).',';
423 if (isset($spotter_item['race_rank'])) $output .= '"rank": "'.$spotter_item['race_rank'].'",';
424 $output.= '"type": "marine"';
426 if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) {
427 $aircraft_icao = $spotter_item['aircraft_icao'];
428 $ident = $spotter_item['ident'];
430 if (is_numeric(substr(substr($ident, 0, 3), -1, 1))) {
431 $airline_icao = substr($ident, 0, 2);
432 } elseif (is_numeric(substr(substr($ident, 0, 4), -1, 1))) {
433 $airline_icao = substr($ident, 0, 3);
435 if (isset($airline_icao)) {
436 $imagefile = $aircraft_icao.'-'.$airline_icao.'.png';
437 if (file_exists(dirname(__FILE__
).'/models/gltf2/liveries/'.$imagefile)) {
438 $output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
442 //if ($ident != '') $output.= '"ident": "'.$ident.'",';
444 $output.= '"gltf2": %gltf2%,';
445 $output.= '"type": "flight"';
449 $output .= '"path" : { ';
450 $output .= '"show" : false, ';
451 //$output .= '"heightReference": "'.$heightrelative.'",';
452 $output .= '"material" : { ';
453 $output .= '"polylineOutline" : { ';
454 $output .= '"color" : { "rgba" : [238, 250, 255, 255] }, ';
455 $output .= '"outlineColor" : { "rgba" : [200, 209, 214, 255] }, ';
456 $output .= '"outlineWidth" : 5, ';
457 $output .= '"polylineGlow" : { "color" : { "rgba" : [214, 208, 214, 255] }, "glowPower" : 3 } ';
460 //$output .= '"heightReference": "'.$heightrelative.'",';
461 $output .= '"width" : 6, "leadTime" : 0, "trailTime" : 100000000, "resolution" : 20 },';
462 //$output .= '"heightReference": "'.$heightrelative.'",';
463 //$output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUK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2mIDNF3Zjz19Ya4G1R/J16dgWvQd2pPlXhMdVZPUTgxfCW1wJgXUJpQlvfg8zs8K8r0Caom9QHetG7NGfa1ElDBThRXRtFd/Qh16puKIS3e7+clBjdy7kL1b3q4fzJQQGck5z6Nb97kxujblWf64HXov7Vl/E4YXWccP9AAd6dAx+ox/WTArNzY1t64B0f8K0DyLXuUvRGZfcpCo1VX4tg6wB76WMB0dALf526foAX8cqUot2pGP8B2Kz+krBeNYjS8636dh/8Beo2deoA9TWp76pd6g0q9cDNwKvAD8A84EfglLRBe2g+JWAfcEF68bPABOCoAl/gIPA5MA64FVgGnNhP292W3r0SeB1YVlJXAjcBP8XwyQUj9AKwAzg2+/fQSsBhoJxBAaALaIzenZGnD911wA7gEDAD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 1.5},';
465 if (isset($spotter_item['aircraft_icao'])) {
466 $aircraft_icao = $spotter_item['aircraft_icao'];
467 if ($aircraft_icao != '') {
468 $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao);
469 if (isset($aircraft_info[0]['engine_type'])) {
470 $aircraft_shadow = $aircraft_info[0]['aircraft_shadow'];
471 $spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
472 $spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
473 $spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
474 } else $aircraft_shadow = '';
475 $output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
476 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
477 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
478 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
482 } else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXg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AAAASUVORK5CYII=","scale" : 0.5},';
483 } elseif ($one3dmodel) {
484 if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') {
485 $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
487 $output .= '"model": {"gltf" : "'.$globalURL.'/models/737.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
489 $output .= ',"heightReference": "'.$heightrelative.'"';
490 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
491 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
492 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
496 if (isset($spotter_item['aircraft_icao'])) {
497 $aircraft_icao = $spotter_item['aircraft_icao'];
498 if (isset($modelsdb2[$aircraft_icao]) && $aircraft_icao != '') {
500 $output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$aircraft_icao]['glb'].'","scale" : '.$scale.',"minimumPixelSize": '.$modelsdb2[$aircraft_icao]['size'];
501 $output .= ',"heightReference": "'.$heightrelative.'"';
502 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
503 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
504 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
507 } elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') {
508 $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
509 $output .= ',"heightReference": "'.$heightrelative.'"';
510 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
511 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
512 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
515 } elseif ($aircraft_icao != '') {
516 $aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao);
517 if (isset($aircraft_info[0]['engine_type'])) {
518 $aircraft_shadow = $aircraft_info[0]['aircraft_shadow'];
519 $spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
520 $spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
521 $spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
522 } else $aircraft_shadow = '';
523 if ($aircraft_shadow != '') {
524 if (isset($modelsdb2[$aircraft_shadow])) {
525 $output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$aircraft_shadow]['glb'].'","scale" : '.$scale.',"minimumPixelSize": '.$modelsdb2[$aircraft_shadow]['size'];
526 $output .= ',"heightReference": "'.$heightrelative.'"';
527 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
528 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
529 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
532 $modelsdb2[$aircraft_icao] = $modelsdb2[$aircraft_shadow];
533 } elseif (isset($modelsdb[$aircraft_shadow])) {
534 $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
535 $output .= ',"heightReference": "'.$heightrelative.'"';
536 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
537 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
538 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
541 $modelsdb[$aircraft_icao] = $modelsdb[$aircraft_shadow];
542 } elseif ($spotter_item['engine_type'] == 'Jet') {
543 if ($spotter_item['engine_count'] == '1') {
544 if ($spotter_item['wake_category'] == 'M') {
546 } elseif ($spotter_item['wake_category'] == 'L') {
549 } elseif ($spotter_item['engine_count'] == '2') {
550 if ($spotter_item['wake_category'] == 'M') {
552 } elseif ($spotter_item['wake_category'] == 'H') {
554 } elseif ($spotter_item['wake_category'] == 'L') {
557 } elseif ($spotter_item['engine_count'] == '3') {
558 if ($spotter_item['wake_category'] == 'M') {
560 } elseif ($spotter_item['wake_category'] == 'H') {
563 } elseif ($spotter_item['engine_count'] == '4') {
564 if ($spotter_item['wake_category'] == 'M') {
566 } elseif ($spotter_item['wake_category'] == 'H') {
570 if (isset($modelsdb2[$model])) {
571 $output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$model]['glb'].'","scale" : '.$scale.',"minimumPixelSize": '.$modelsdb2[$model]['size'];
572 $output .= ',"heightReference": "'.$heightrelative.'"';
573 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
574 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
575 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
578 $modelsdb2[$aircraft_icao] = $modelsdb2[$model];
579 } elseif (isset($modelsdb[$model])) {
580 $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$model].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
581 $output .= ',"heightReference": "'.$heightrelative.'"';
582 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
583 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
584 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
587 $modelsdb[$aircraft_icao] = $modelsdb[$model];
589 $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
590 $output .= ',"heightReference": "'.$heightrelative.'"';
591 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
592 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
593 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
596 $modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
598 } elseif ($spotter_item['engine_type'] == 'Turboprop') {
599 if ($spotter_item['engine_count'] == '1') {
600 if ($spotter_item['wake_category'] == 'L') {
603 } elseif ($spotter_item['engine_count'] == '2') {
604 if ($spotter_item['wake_category'] == 'M') {
606 } elseif ($spotter_item['wake_category'] == 'L') {
609 } elseif ($spotter_item['engine_count'] == '4') {
610 if ($spotter_item['wake_category'] == 'M') {
611 } elseif ($spotter_item['wake_category'] == 'H') {
615 if (isset($modelsdb[$model])) {
616 $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$model].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
617 $output .= ',"heightReference": "'.$heightrelative.'"';
618 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
619 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
620 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
623 $modelsdb[$aircraft_icao] = $modelsdb[$model];
625 $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
626 $output .= ',"heightReference": "'.$heightrelative.'"';
627 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
628 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
629 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
632 $modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
634 } elseif ($spotter_item['engine_type'] == 'Piston') {
635 if ($spotter_item['engine_count'] == '1') {
636 if ($spotter_item['wake_category'] == 'L') {
638 } elseif ($spotter_item['wake_category'] == 'M') {
641 } elseif ($spotter_item['engine_count'] == '2') {
642 if ($spotter_item['wake_category'] == 'M') {
644 } elseif ($spotter_item['wake_category'] == 'L') {
649 if (isset($modelsdb[$model])) {
650 $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$model].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
651 $output .= ',"heightReference": "'.$heightrelative.'"';
652 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
653 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
654 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
657 $modelsdb[$aircraft_icao] = $modelsdb[$model];
659 $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
660 $output .= ',"heightReference": "'.$heightrelative.'"';
661 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
662 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
663 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
666 $modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
669 $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
670 $output .= ',"heightReference": "'.$heightrelative.'"';
671 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
672 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
673 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
676 //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
677 if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
678 $modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
680 } elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
681 $aircraft_shadow = 'PA18';
682 $output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
683 $output .= ',"heightReference": "'.$heightrelative.'"';
684 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
685 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
686 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
689 $modelsdb[$aircraft_icao] = $modelsdb[$aircraft_shadow];
691 $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
692 $output .= ',"heightReference": "'.$heightrelative.'"';
693 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
694 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
695 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
698 //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
699 if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
700 $modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
703 $output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
704 $output .= ',"heightReference": "'.$heightrelative.'"';
705 //$output .= ',"color": {"rgba" : [255,0,0,255]}';
706 if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
707 $rgb = $Common->hex2rgb($_COOKIE['IconColor']);
708 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
711 //if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
712 if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
713 $modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
715 } elseif ($tracker && isset($spotter_item['type'])) {
716 if ($spotter_item['type'] == 'Car' ||
$spotter_item['type'] == 'Van') {
718 //$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/car.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.',';
719 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/car.gltf","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
720 //$output .= ',"heightReference": "'.$heightrelative.'"';
721 $output .= ',"heightReference": "CLAMP_TO_GROUND"';
722 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
723 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
724 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
725 $output .= ',"colorBlendMode" : "MIX"';
728 } elseif ($spotter_item['type'] == 'Truck' ||
$spotter_item['type'] == 'Truck (18 Wheeler)') {
730 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/truck.gltf","scale" : '.$scale.',"minimumPixelSize": 10';
731 //$output .= ',"heightReference": "'.$heightrelative.'"';
732 $output .= ',"heightReference": "CLAMP_TO_GROUND"';
733 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
734 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
735 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
736 $output .= ',"colorBlendMode" : "MIX"';
739 } elseif ($spotter_item['type'] == 'Firetruck') {
741 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/firetruck.glb","scale" : '.$scale.',"minimumPixelSize": 0';
742 //$output .= ',"heightReference": "'.$heightrelative.'"';
743 $output .= ',"heightReference": "CLAMP_TO_GROUND"';
744 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
745 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
746 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
747 $output .= ',"colorBlendMode" : "MIX"';
750 } elseif ($spotter_item['type'] == 'Bike') {
752 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/cycle.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
753 //$output .= ',"heightReference": "'.$heightrelative.'"';
754 $output .= ',"heightReference": "CLAMP_TO_GROUND"';
755 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
756 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
757 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
758 $output .= ',"colorBlendMode" : "MIX"';
761 } elseif ($spotter_item['type'] == 'Police') {
763 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/police.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
764 //$output .= ',"heightReference": "'.$heightrelative.'"';
765 $output .= ',"heightReference": "CLAMP_TO_GROUND"';
766 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
767 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
768 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
769 $output .= ',"colorBlendMode" : "MIX"';
772 } elseif ($spotter_item['type'] == 'Balloon') {
773 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/ball.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
774 $output .= ',"heightReference": "'.$heightrelative.'"';
775 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
776 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
777 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
778 $output .= ',"colorBlendMode" : "MIX"';
781 } elseif ($spotter_item['type'] == 'Ship (Power Boat)' ||
$spotter_item['type'] == 'Yatch (Sail)') {
783 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/boat.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
784 //$output .= ',"heightReference": "'.$heightrelative.'"';
785 $output .= ',"heightReference": "CLAMP_TO_GROUND"';
786 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
787 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
788 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
789 $output .= ',"colorBlendMode" : "MIX"';
794 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/car.gltf","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
795 //$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/Cesium_Ground.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
796 $output .= ',"heightReference": "'.$heightrelative.'"';
797 if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
798 $rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
799 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
800 $output .= ',"colorBlendMode" : "MIX"';
805 if ($spotter_item['type_id'] == 36) {
806 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/sail.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
808 $output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/boat.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.'';
810 //$output .= ',"heightReference": "'.$heightrelative.'"';
811 $output .= ',"heightReference": "CLAMP_TO_GROUND"';
812 if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true' && isset($_COOKIE['MarineIconColor'])) {
813 $rgb = $Common->hex2rgb($_COOKIE['MarineIconColor']);
814 $output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
815 $output .= ',"colorBlendMode" : "MIX"';
820 if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
821 else $output = str_replace('%onground%','false',$output);
823 // $output .= '"heightReference": "CLAMP_TO_GROUND",';
824 //$output .= '"heightReference": "'.$heightrelative.'",';
825 // $output .= '"heightReference": "NONE",';
826 $output .= '"position": {';
827 $output .= '"interpolationAlgorithm":"HERMITE","interpolationDegree":3,';
828 //$output .= '"heightReference": "'.$heightrelative.'",';
829 $output .= '"type": "Point",';
830 // $output .= '"interpolationAlgorithm" : "LAGRANGE",';
831 // $output .= '"interpolationDegree" : 5,';
832 // $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", ';
833 $output .= '"cartographicDegrees": [';
834 if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
835 if (isset($_COOKIE['MapTrack']) && $id == $_COOKIE['MapTrack'] && $minitracktime > strtotime($spotter_item['date'])) $minitracktime = strtotime($spotter_item['date']);
836 if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
837 $output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
838 $output .= $spotter_item['longitude'].', ';
839 $output .= $spotter_item['latitude'];
840 $prevlong = $spotter_item['longitude'];
841 $prevlat = $spotter_item['latitude'];
842 //if (!$tracker && !$marine) {
843 //if (!$marine && (!isset($onground) || !$onground)) {
845 if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
846 $output .= ', '.round($spotter_item['real_altitude']*0.3048);
848 $prevalt = round($spotter_item['real_altitude']*0.3048);
850 $prevalt = round($spotter_item['real_altitude']*30.48);
852 } elseif ($tracker) {
853 $output .= ', '.round($spotter_item['altitude']*0.3048);
854 $prevalt = round($spotter_item['altitude']*0.3048);
856 $output .= ', '.round($spotter_item['altitude']*30.48);
857 $prevalt = round($spotter_item['altitude']*30.48);
859 } else $output .= ', 0';
860 //$orientation = '"orientation" : { ';
861 //$orientation .= '"unitQuaternion": [';
862 //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
863 //$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
865 $nblatlong = $nblatlong+
1;
866 $output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
867 if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
868 if ($spotter_item['ground_speed'] == 0) {
869 $output .= $prevlong.', ';
871 //if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt;
872 if (!$marine) $output .= ', '.$prevalt;
873 else $output .= ', 0';
875 $output .= $spotter_item['longitude'].', ';
876 $output .= $spotter_item['latitude'];
877 //if (!$marine && (!isset($onground) || !$onground)) {
879 if ($spotter_item['altitude'] == '') {
880 if ($prevalt != '') {
881 $output .= ', '.$prevalt;
886 if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048);
888 $output .= ', '.round($spotter_item['altitude']*0.3048);
890 $output .= ', '.round($spotter_item['altitude']*30.48);
893 } else $output .= ', 0';
895 //$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
896 //$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
899 //$output = substr($output, 0, -1);
902 $output = substr($output, 0, -1);
905 if (isset($globalArchive) && $globalArchive === TRUE) {
906 if (isset($begindateinitial)) {
907 $output = str_replace('%minitime%',date("c",$begindateinitial),$output);
908 } elseif ((time()-$globalLiveInterval) > $minitime) {
909 if (time()-$globalLiveInterval > $maxitime) {
910 $output = str_replace('%minitime%',date("c",$maxitime),$output);
912 $output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
915 else $output = str_replace('%minitime%',date("c",$minitime),$output);
916 } elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && $minitracktime != $minitracktime_begin) {
917 $output = str_replace('%minitime%',date("c",$minitracktime),$output);
919 $output = str_replace('%minitime%',date("c",$minitime),$output);
921 if (isset($enddateinitial)) {
922 $output = str_replace('%maxitime%',date("c",$enddateinitial),$output);
924 $output = str_replace('%maxitime%',date("c",$maxitime),$output);
926 if ($gltf2) $output = str_replace('%gltf2%','true',$output);
927 else $output = str_replace('%gltf2%','false',$output);