-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathlive-czml.php
780 lines (763 loc) · 49.3 KB
/
live-czml.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
<?php
require_once('require/class.Connection.php');
require_once('require/class.Common.php');
if (isset($globalProtect) && $globalProtect) {
@session_start();
if (!isset($_SESSION['protect']) || !isset($_SERVER['HTTP_REFERER'])) {
echo 'You must access this page using the right way.';
die();
}
}
$no3dmodels = false; // Only for testing
$one3dmodel = false; // Only for testing
if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') {
$one3dmodel = true;
}
$tracker = false;
$marine = false;
if (isset($_GET['tracker'])) $tracker = true;
if (isset($_GET['marine'])) $marine = true;
if ($tracker) {
require_once('require/class.Tracker.php');
require_once('require/class.TrackerLive.php');
//require_once('require/class.TrackerArchive.php');
$TrackerLive = new TrackerLive();
$Tracker = new Tracker();
// $TrackerArchive = new TrackerArchive();
} elseif ($marine) {
require_once('require/class.Marine.php');
require_once('require/class.MarineLive.php');
//require_once('require/class.MarineArchive.php');
$MarineLive = new MarineLive();
$Marine = new Marine();
// $MarineArchive = new MarineArchive();
} else {
require_once('require/class.Spotter.php');
require_once('require/class.SpotterLive.php');
require_once('require/class.SpotterArchive.php');
$SpotterLive = new SpotterLive();
$Spotter = new Spotter();
$SpotterArchive = new SpotterArchive();
}
date_default_timezone_set('UTC');
$begintime = microtime(true);
$Common = new Common();
function quaternionrotate($heading, $attitude = 0, $bank = 0) {
// Assuming the angles are in radians.
$c1 = cos($heading/2);
$s1 = sin($heading/2);
$c2 = cos($attitude/2);
$s2 = sin($attitude/2);
$c3 = cos($bank/2);
$s3 = sin($bank/2);
$c1c2 = $c1*$c2;
$s1s2 = $s1*$s2;
$w =$c1c2*$c3 - $s1s2*$s3;
$x =$c1c2*$s3 + $s1s2*$c3;
$y =$s1*$c2*$c3 + $c1*$s2*$s3;
$z =$c1*$s2*$c3 - $s1*$c2*$s3;
return array('x' => $x,'y' => $y,'z' => $z,'w' => $w);
// return array('x' => '0.0','y' => '-0.931','z' => '0.0','w' => '0.365');
}
if (isset($_GET['download'])) {
if ($_GET['download'] == "true")
{
header('Content-disposition: attachment; filename="flightairmap.json"');
}
}
header('Content-Type: text/javascript');
if (!isset($globalJsonCompress)) $compress = true;
else $compress = $globalJsonCompress;
$from_archive = false;
$min = false;
$allhistory = false;
$filter['source'] = array();
if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalVATSIM) && $globalVATSIM && isset($_COOKIE['filter_ShowVATSIM']) && $_COOKIE['filter_ShowVATSIM'] == 'true') $filter['source'] = array_merge($filter['source'],array('vatsimtxt'));
if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalIVAO) && $globalIVAO && isset($_COOKIE['filter_ShowIVAO']) && $_COOKIE['filter_ShowIVAO'] == 'true') $filter['source'] = array_merge($filter['source'],array('whazzup'));
if ((!isset($globalMapVAchoose) || $globalMapVAchoose) && isset($globalphpVMS) && $globalphpVMS && isset($_COOKIE['filter_ShowVMS']) && $_COOKIE['filter_ShowVMS'] == 'true') $filter['source'] = array_merge($filter['source'],array('phpvmacars'));
if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalSBS1) && $globalSBS1 && isset($_COOKIE['filter_ShowSBS1']) && $_COOKIE['filter_ShowSBS1'] == 'true') $filter['source'] = array_merge($filter['source'],array('sbs','famaprs'));
if ((!isset($globalMapchoose) || $globalMapchoose) && isset($globalAPRS) && $globalAPRS && isset($_COOKIE['filter_ShowAPRS']) && $_COOKIE['filter_ShowAPRS'] == 'true') $filter['source'] = array_merge($filter['source'],array('aprs'));
if (isset($_COOKIE['filter_ident']) && $_COOKIE['filter_ident'] != '') $filter['ident'] = filter_var($_COOKIE['filter_ident'],FILTER_SANITIZE_STRING);
if (isset($_COOKIE['filter_mmsi']) && $_COOKIE['filter_mmsi'] != '') $filter['mmsi'] = filter_var($_COOKIE['filter_mmsi'],FILTER_SANITIZE_STRING);
if (isset($_COOKIE['filter_Airlines']) && $_COOKIE['filter_Airlines'] != '') $filter['airlines'] = filter_var_array(explode(',',$_COOKIE['filter_Airlines']),FILTER_SANITIZE_STRING);
if (isset($_COOKIE['filter_Sources']) && $_COOKIE['filter_Sources'] != '') $filter['source_aprs'] = filter_var_array(explode(',',$_COOKIE['filter_Sources']),FILTER_SANITIZE_STRING);
if (isset($_COOKIE['filter_airlinestype']) && $_COOKIE['filter_airlinestype'] != 'all') $filter['airlinestype'] = filter_var($_COOKIE['filter_airlinestype'],FILTER_SANITIZE_STRING);
if (isset($_COOKIE['filter_alliance']) && $_COOKIE['filter_alliance'] != 'all') $filter['alliance'] = filter_var($_COOKIE['filter_alliance'],FILTER_SANITIZE_STRING);
/*
if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) {
$min = true;
}
if (isset($_GET['ident'])) {
$ident = filter_input(INPUT_GET,'ident',FILTER_SANITIZE_STRING);
$spotter_array = $SpotterLive->getLastLiveSpotterDataByIdent($ident);
if (empty($spotter_array)) {
$from_archive = true;
$spotter_array = $SpotterArchive->getLastArchiveSpotterDataByIdent($ident);
}
$allhistory = true;
} elseif (isset($_GET['flightaware_id'])) {
$flightaware_id = filter_input(INPUT_GET,'flightaware_id',FILTER_SANITIZE_STRING);
$spotter_array = $SpotterLive->getLastLiveSpotterDataById($flightaware_id);
if (empty($spotter_array)) {
$from_archive = true;
$spotter_array = $SpotterArchive->getLastArchiveSpotterDataById($flightaware_id);
}
$allhistory = true;
} elseif (isset($_GET['coord'])) {
$coord = explode(',',$_GET['coord']);
$spotter_array = $SpotterLive->getLiveSpotterDatabyCoord($coord,$filter);
} elseif (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) {
$from_archive = true;
// $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
// $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
$begindate = date('Y-m-d H:i:s',$begindate);
$enddate = date('Y-m-d H:i:s',$enddate);
$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
} elseif ($min) {
//$spotter_array = $SpotterLive->getMinLiveSpotterData($filter);
$spotter_array = $SpotterLive->getMinLastLiveSpotterData($filter);
# $min = true;
} else {
$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter);
}
*/
if (isset($_GET['archive']) && isset($_GET['begindate']) && isset($_GET['enddate']) && isset($_GET['speed'])) {
$from_archive = true;
// $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
// $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
$begindate = filter_input(INPUT_GET,'begindate',FILTER_SANITIZE_NUMBER_INT);
$enddate = filter_input(INPUT_GET,'enddate',FILTER_SANITIZE_NUMBER_INT);
$archivespeed = filter_input(INPUT_GET,'speed',FILTER_SANITIZE_NUMBER_INT);
$begindate = date('Y-m-d H:i:s',$begindate);
$enddate = date('Y-m-d H:i:s',$enddate);
$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter);
} elseif (isset($_COOKIE['archive']) && isset($_COOKIE['archive_begin']) && isset($_COOKIE['archive_end']) && isset($_COOKIE['archive_speed'])) {
$from_archive = true;
// $begindate = filter_input(INPUT_GET,'begindate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
// $enddate = filter_input(INPUT_GET,'enddate',FILTER_VALIDATE_REGEXP,array("options"=>array("regexp"=>'~^\d{4}/\d{2}/\d{2}$~')));
// $begindate = filter_var($_COOKIE['archive_begin'],FILTER_SANITIZE_NUMBER_INT);
// $enddate = filter_var($_COOKIE['archive_end'],FILTER_SANITIZE_NUMBER_INT);
$begindate = $_COOKIE['archive_begin'];
$enddate = $_COOKIE['archive_end'];
$archivespeed = filter_var($_COOKIE['archive_speed'],FILTER_SANITIZE_NUMBER_INT);
$begindate = date('Y-m-d H:i:s',$begindate);
$enddate = date('Y-m-d H:i:s',$enddate);
// echo 'Begin : '.$begindate.' - End : '.$enddate."\n";
$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter);
} elseif ($tracker) {
$coord = array();
if (isset($_GET['coord']) && $_GET['coord'] != '') {
$coord = explode(',',$_GET['coord']);
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)
&& $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)) {
$coord = array();
}
}
$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true);
} elseif ($marine) {
$coord = array();
if (isset($_GET['coord']) && $_GET['coord'] != '') {
$coord = explode(',',$_GET['coord']);
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)
&& $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)) {
$coord = array();
}
}
$spotter_array = $MarineLive->getMinLastLiveMarineData($coord,$filter,true);
} else {
$coord = array();
if (isset($_GET['coord']) && $_GET['coord'] != '') {
$coord = explode(',',$_GET['coord']);
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)
&& $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)) {
$coord = array();
}
}
$spotter_array = $SpotterLive->getMinLastLiveSpotterData($coord,$filter,true);
}
//print_r($spotter_array);
if (!empty($spotter_array) && isset($coord)) {
if (isset($_GET['archive'])) {
$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter);
} elseif ($tracker) {
$flightcnt = $TrackerLive->getLiveTrackerCount($filter);
} elseif ($marine) {
$flightcnt = $MarineLive->getLiveMarineCount($filter);
} else {
$flightcnt = $SpotterLive->getLiveSpotterCount($filter);
}
if ($flightcnt == '') $flightcnt = 0;
} else $flightcnt = 0;
$sqltime = round(microtime(true)-$begintime,2);
$minitime = time();
$maxitime = 0;
$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT);
$modelsdb = array();
if (file_exists(dirname(__FILE__).'/models/modelsdb')) {
if (($handle = fopen(dirname(__FILE__).'/models/modelsdb','r')) !== FALSE) {
while (($row = fgetcsv($handle,1000)) !== FALSE) {
if (isset($row[1]) ){
$model = $row[0];
$modelsdb[$model] = $row[1];
}
}
fclose($handle);
}
}
$modelsdb2 = array();
if (file_exists(dirname(__FILE__).'/models/gltf2/modelsdb')) {
if (($handle = fopen(dirname(__FILE__).'/models/gltf2/modelsdb','r')) !== FALSE) {
while (($row = fgetcsv($handle,1000)) !== FALSE) {
if (isset($row[1]) ){
$model = $row[0];
$modelsdb2[$model] = $row[1];
}
}
fclose($handle);
}
}
$heightrelative = 'NONE';
//$heightrelative = 'RELATIVE_TO_GROUND';
$j = 0;
$prev_flightaware_id = '';
$speed = 1;
$gltf2 = false;
if (isset($archivespeed)) $speed = $archivespeed;
$output = '[';
if ($tracker) {
$output .= '{"id" : "document", "name" : "tracker","version" : "1.0"';
} elseif ($marine) {
$output .= '{"id" : "document", "name" : "marine","version" : "1.0"';
} else {
$output .= '{"id" : "document", "name" : "fam","version" : "1.0"';
}
// $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}';
// $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
//$output .= ',"clock": {"currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
if ($from_archive === true) {
$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : '.$speed.',"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER","interval": "%minitime%/%maxitime%"}';
} else {
$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : '.$speed.',"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}';
}
// $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"step": "SYSTEM_CLOCK_MULTIPLIER"}';
$output .= '},';
if (!empty($spotter_array) && is_array($spotter_array))
{
$nblatlong = 0;
foreach($spotter_array as $spotter_item)
{
$j++;
//if (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'airwhere') $heightrelative = 'RELATIVE_TO_GROUND';
date_default_timezone_set('UTC');
if (isset($spotter_item['image_thumbnail']) && $spotter_item['image_thumbnail'] != "")
{
$image = $spotter_item['image_thumbnail'];
} else {
$image = "images/placeholder_thumb.png";
}
if (isset($spotter_item['flightaware_id'])) $id = $spotter_item['flightaware_id'];
elseif (isset($spotter_item['famtrackid'])) $id = $spotter_item['famtrackid'];
elseif (isset($spotter_item['fammarine_id'])) $id = $spotter_item['fammarine_id'];
if ($prev_flightaware_id != $id) {
if ($prev_flightaware_id != '') {
/*
if ($nblatlong == 1) {
$output .= ',"'.date("c").'", ';
$output .= $prevlong.', ';
$output .= $prevlat;
if (!$marine) $output .= ', '.$prevalt;
else $output .= ', 0';
}
*/
$output .= ']';
$output .= '}';
//$output .= ', '.$orientation.']}';
$output .= '},';
}
$orientation = '';
$prev_flightaware_id = $id;
$nblatlong = 0;
$output .= '{';
$output .= '"id": "'.$id.'",';
$output .= '"properties": {';
$output .= '"flightcnt": "'.$flightcnt.'",';
$output .= '"onground": %onground%,';
$output .= '"lastupdate": "'.$lastupdate.'",';
if (isset($spotter_item['format_source'])) $output .= '"format": "'.$spotter_item['format_source'].'",';
if ($tracker) {
$output.= '"type": "tracker"';
} elseif ($marine) {
$output.= '"type": "marine"';
} else {
if (isset($globalMap3DLiveries) && $globalMap3DLiveries) {
$aircraft_icao = $spotter_item['aircraft_icao'];
$ident = $spotter_item['ident'];
if ($ident != '') {
if (is_numeric(substr(substr($ident, 0, 3), -1, 1))) {
$airline_icao = substr($ident, 0, 2);
} elseif (is_numeric(substr(substr($ident, 0, 4), -1, 1))) {
$airline_icao = substr($ident, 0, 3);
}
if (isset($airline_icao)) {
$imagefile = $aircraft_icao.'-'.$airline_icao.'.png';
if (file_exists(dirname(__FILE__).'/models/gltf2/liveries/'.$imagefile)) {
$output.= '"liveries": "'.$globalURL.'/models/gltf2/liveries/'.$imagefile.'",';
}
}
}
if ($ident != '') $output.= '"ident": "'.$ident.'",';
}
$output.= '"gltf2": %gltf2%,';
$output.= '"type": "flight"';
}
$output .= '},';
$output .= '"path" : { ';
$output .= '"show" : false, ';
//$output .= '"heightReference": "'.$heightrelative.'",';
$output .= '"material" : { ';
$output .= '"polylineOutline" : { ';
$output .= '"color" : { "rgba" : [238, 250, 255, 255] }, ';
$output .= '"outlineColor" : { "rgba" : [200, 209, 214, 255] }, ';
$output .= '"outlineWidth" : 5, ';
$output .= '"polylineGlow" : { "color" : { "rgba" : [214, 208, 214, 255] }, "glowPower" : 3 } ';
$output .= '}';
$output .= '}, ';
//$output .= '"heightReference": "'.$heightrelative.'",';
$output .= '"width" : 6, "leadTime" : 0, "trailTime" : 100000000, "resolution" : 20 },';
//$output .= '"heightReference": "'.$heightrelative.'",';
//$output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAA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AD2FFSpwOzgDHZ5T7+ZSlGd2d6AXgi5+qAn+O5U0PbBVwKtAD3AHuB8f3YGBUdncCGoQ4LE9XtGRqK9LnduVPRIu2BPqwD65IYbS7Qpql7Ql9YoJcy9bwzkgPrfOCj5G33+h54E/g0PAr5thq4ApgyEgNrc27aWwVaPTA1QJ4BjgTGFvhteV40EgPrgvTP7qlmZqFnl9WD+b2posN83E/NrEkOjlI/U1fkfUYa/pe5IE3qZPW8jFOqiyN7p3pAPX04c7AxYSoDDcAjKT2LgLXA6IR2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 1.5},';
if ($no3dmodels) {
if (isset($spotter_item['aircraft_icao'])) {
$aircraft_icao = $spotter_item['aircraft_icao'];
if ($aircraft_icao != '') {
$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao);
if (isset($aircraft_info[0]['engine_type'])) {
$aircraft_shadow = $aircraft_info[0]['aircraft_shadow'];
$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
} else $aircraft_shadow = '';
$output .= ' "billboard" : {"image" : "'.$globalURL.'/images/aircrafts/new/'.$aircraft_shadow.'","scale" : 0.5';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
}
} else $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oA9TWp76pd6g0q9cDNwKvAD8A84EfglLRBe2g+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" : 0.5},';
} elseif ($one3dmodel) {
if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : 1.0,"minimumPixelSize": 20';
} else {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/737.glb","scale" : 1.0,"minimumPixelSize": 20';
}
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
} else {
if (isset($spotter_item['aircraft_icao'])) {
$aircraft_icao = $spotter_item['aircraft_icao'];
if (isset($modelsdb2[$aircraft_icao]) && $aircraft_icao != '') {
$gltf2 = true;
$output .= '"model": {"gltf" : "'.$globalURL.'/models/gltf2/'.$modelsdb2[$aircraft_icao].'","scale" : 1.0,"minimumPixelSize": 15';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
} elseif (isset($modelsdb[$aircraft_icao]) && $aircraft_icao != '') {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_icao].'","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
} elseif ($aircraft_icao != '') {
$aircraft_info = $Spotter->getAllAircraftInfo($aircraft_icao);
if (isset($aircraft_info[0]['engine_type'])) {
$aircraft_shadow = $aircraft_info[0]['aircraft_shadow'];
$spotter_item['engine_type'] = $aircraft_info[0]['engine_type'];
$spotter_item['wake_category'] = $aircraft_info[0]['wake_category'];
$spotter_item['engine_count'] = $aircraft_info[0]['engine_count'];
} else $aircraft_shadow = '';
if ($aircraft_shadow != '') {
if (isset($modelsdb[$aircraft_shadow])) {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = $modelsdb[$aircraft_shadow];
} elseif ($spotter_item['engine_type'] == 'Jet') {
if ($spotter_item['engine_count'] == '1') {
if ($spotter_item['wake_category'] == 'M') {
$model = 'J1M';
} elseif ($spotter_item['wake_category'] == 'L') {
$model = '';
}
} elseif ($spotter_item['engine_count'] == '2') {
if ($spotter_item['wake_category'] == 'M') {
$model = 'J2M';
} elseif ($spotter_item['wake_category'] == 'H') {
$model = 'J2H';
} elseif ($spotter_item['wake_category'] == 'L') {
$model = 'J2L';
}
} elseif ($spotter_item['engine_count'] == '3') {
if ($spotter_item['wake_category'] == 'M') {
$model = 'J3M';
} elseif ($spotter_item['wake_category'] == 'H') {
$model = 'J3H';
}
} elseif ($spotter_item['engine_count'] == '4') {
if ($spotter_item['wake_category'] == 'M') {
$model = 'J4M';
} elseif ($spotter_item['wake_category'] == 'H') {
$model = 'J4H';
}
}
if (isset($modelsdb[$model])) {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$model].'","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = $modelsdb[$model];
} else {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
}
} elseif ($spotter_item['engine_type'] == 'Turboprop') {
if ($spotter_item['engine_count'] == '1') {
if ($spotter_item['wake_category'] == 'L') {
$model = 'T1L';
}
} elseif ($spotter_item['engine_count'] == '2') {
if ($spotter_item['wake_category'] == 'M') {
$model = 'T2M';
} elseif ($spotter_item['wake_category'] == 'L') {
$model = 'T2L';
}
} elseif ($spotter_item['engine_count'] == '4') {
if ($spotter_item['wake_category'] == 'M') {
} elseif ($spotter_item['wake_category'] == 'H') {
$model = 'T4H';
}
}
if (isset($modelsdb[$model])) {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$model].'","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = $modelsdb[$model];
} else {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
}
} elseif ($spotter_item['engine_type'] == 'Piston') {
if ($spotter_item['engine_count'] == '1') {
if ($spotter_item['wake_category'] == 'L') {
$model = 'P1L';
} elseif ($spotter_item['wake_category'] == 'M') {
$model = 'P1M';
}
} elseif ($spotter_item['engine_count'] == '2') {
if ($spotter_item['wake_category'] == 'M') {
$model = 'P2M';
} elseif ($spotter_item['wake_category'] == 'L') {
$model = 'P2L';
}
// ju52 = P3M
}
if (isset($modelsdb[$model])) {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$model].'","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = $modelsdb[$model];
} else {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
}
} else {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
}
} elseif (isset($spotter_item['format_source']) && $spotter_item['format_source'] == 'aprs') {
$aircraft_shadow = 'PA18';
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$modelsdb[$aircraft_shadow].'","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
$modelsdb[$aircraft_icao] = $modelsdb[$aircraft_shadow];
} else {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
}
} else {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/Cesium_Air.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
//$output .= ',"color": {"rgba" : [255,0,0,255]}';
if (isset($_COOKIE['IconColorForce']) && $_COOKIE['IconColorForce'] == 'true' && isset($_COOKIE['IconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['IconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
}
$output .= '},';
//if ($spotter_item['aircraft_shadow'] != '') $output .= '"aircraft_shadow": "'.$spotter_item['aircraft_shadow'].'",';
if ($spotter_item['aircraft_icao'] != '') $output .= '"aircraft_icao": "'.$spotter_item['aircraft_icao'].'",';
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb';
}
} elseif ($tracker && isset($spotter_item['type'])) {
if ($spotter_item['type'] == 'Car' || $spotter_item['type'] == 'Van') {
$onground = true;
//$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/car.glb","scale" : 1.0,"minimumPixelSize": 20,';
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/car.gltf","scale" : 1.0,"minimumPixelSize": 20';
//$output .= ',"heightReference": "'.$heightrelative.'"';
$output .= ',"heightReference": "CLAMP_TO_GROUND"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
} elseif ($spotter_item['type'] == 'Truck' || $spotter_item['type'] == 'Truck (18 Wheeler)') {
$onground = true;
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/truck.gltf","scale" : 1.0,"minimumPixelSize": 10';
//$output .= ',"heightReference": "'.$heightrelative.'"';
$output .= ',"heightReference": "CLAMP_TO_GROUND"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
} elseif ($spotter_item['type'] == 'Firetruck') {
$onground = true;
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/firetruck.glb","scale" : 1.0,"minimumPixelSize": 0';
//$output .= ',"heightReference": "'.$heightrelative.'"';
$output .= ',"heightReference": "CLAMP_TO_GROUND"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
} elseif ($spotter_item['type'] == 'Bike') {
$onground = true;
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/cycle.glb","scale" : 1.0,"minimumPixelSize": 20';
//$output .= ',"heightReference": "'.$heightrelative.'"';
$output .= ',"heightReference": "CLAMP_TO_GROUND"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
} elseif ($spotter_item['type'] == 'Police') {
$onground = true;
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/police.glb","scale" : 1.0,"minimumPixelSize": 20';
//$output .= ',"heightReference": "'.$heightrelative.'"';
$output .= ',"heightReference": "CLAMP_TO_GROUND"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
} elseif ($spotter_item['type'] == 'Balloon') {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/ball.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
} elseif ($spotter_item['type'] == 'Ship (Power Boat)' || $spotter_item['type'] == 'Yatch (Sail)') {
$onground = true;
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/boat.glb","scale" : 1.0,"minimumPixelSize": 20';
//$output .= ',"heightReference": "'.$heightrelative.'"';
$output .= ',"heightReference": "CLAMP_TO_GROUND"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
} else {
$onground = true;
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/car.gltf","scale" : 1.0,"minimumPixelSize": 20';
//$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/Cesium_Ground.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
if (isset($_COOKIE['TrackerIconColorForce']) && $_COOKIE['TrackerIconColorForce'] == 'true' && isset($_COOKIE['TrackerIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['TrackerIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
}
} elseif ($marine) {
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/boat.glb","scale" : 1.0,"minimumPixelSize": 20';
$output .= ',"heightReference": "'.$heightrelative.'"';
//$output .= ',"heightReference": "CLAMP_TO_GROUND"';
if (isset($_COOKIE['MarineIconColorForce']) && $_COOKIE['MarineIconColorForce'] == 'true' && isset($_COOKIE['MarineIconColor'])) {
$rgb = $Common->hex2rgb($_COOKIE['MarineIconColor']);
$output .= ',"color": {"rgba" : ['.$rgb[0].','.$rgb[1].','.$rgb[2].',255]}';
$output .= ',"colorBlendMode" : "MIX"';
}
$output .= '},';
}
}
if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output);
else $output = str_replace('%onground%','false',$output);
// $output .= '"heightReference": "CLAMP_TO_GROUND",';
//$output .= '"heightReference": "'.$heightrelative.'",';
// $output .= '"heightReference": "NONE",';
$output .= '"position": {';
$output .= '"interpolationAlgorithm":"HERMITE","interpolationDegree":3,';
//$output .= '"heightReference": "'.$heightrelative.'",';
$output .= '"type": "Point",';
// $output .= '"interpolationAlgorithm" : "LAGRANGE",';
// $output .= '"interpolationDegree" : 5,';
// $output .= '"epoch" : "'.date("c",strtotime($spotter_item['date'])).'", ';
$output .= '"cartographicDegrees": [';
if ($minitime > strtotime($spotter_item['date'])) $minitime = strtotime($spotter_item['date']);
if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
$output .= '"'.date("c",strtotime($spotter_item['date'])).'", ';
$output .= $spotter_item['longitude'].', ';
$output .= $spotter_item['latitude'];
$prevlong = $spotter_item['longitude'];
$prevlat = $spotter_item['latitude'];
//if (!$tracker && !$marine) {
//if (!$marine && (!isset($onground) || !$onground)) {
if (!$marine) {
if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') {
$output .= ', '.round($spotter_item['real_altitude']*0.3048);
if ($tracker) {
$prevalt = round($spotter_item['real_altitude']*0.3048);
} else {
$prevalt = round($spotter_item['real_altitude']*30.48);
}
} elseif ($tracker) {
$output .= ', '.round($spotter_item['altitude']*0.3048);
$prevalt = round($spotter_item['altitude']*0.3048);
} else {
$output .= ', '.round($spotter_item['altitude']*30.48);
$prevalt = round($spotter_item['altitude']*30.48);
}
} else $output .= ', 0';
//$orientation = '"orientation" : { ';
//$orientation .= '"unitQuaternion": [';
//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
//$orientation .= '"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
} else {
$nblatlong = $nblatlong+1;
$output .= ',"'.date("c",strtotime($spotter_item['date'])).'", ';
if ($maxitime < strtotime($spotter_item['date'])) $maxitime = strtotime($spotter_item['date']);
if ($spotter_item['ground_speed'] == 0) {
$output .= $prevlong.', ';
$output .= $prevlat;
//if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt;
if (!$marine) $output .= ', '.$prevalt;
else $output .= ', 0';
} else {
$output .= $spotter_item['longitude'].', ';
$output .= $spotter_item['latitude'];
//if (!$marine && (!isset($onground) || !$onground)) {
if (!$marine) {
if ($spotter_item['altitude'] == '') {
if ($prevalt != '') {
$output .= ', '.$prevalt;
} else {
$output .= ', 0';
}
} else {
if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048);
elseif ($tracker) {
$output .= ', '.round($spotter_item['altitude']*0.3048);
} else {
$output .= ', '.round($spotter_item['altitude']*30.48);
}
}
} else $output .= ', 0';
}
//$quat = quaternionrotate(deg2rad($spotter_item['heading']),deg2rad(0),deg2rad(0));
//$orientation .= ',"'.date("c",strtotime($spotter_item['date'])).'",'.$quat['x'].','.$quat['y'].','.$quat['z'].','.$quat['w'];
}
}
//$output = substr($output, 0, -1);
$output .= ']}}';
} else {
$output = substr($output, 0, -1);
}
$output .= ']';
if (isset($globalArchive) && $globalArchive === TRUE) {
if ((time()-$globalLiveInterval) > $minitime) {
if (time()-$globalLiveInterval > $maxitime) {
$output = str_replace('%minitime%',date("c",$maxitime),$output);
} else {
$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output);
}
}
else $output = str_replace('%minitime%',date("c",$minitime),$output);
} else $output = str_replace('%minitime%',date("c",$minitime),$output);
$output = str_replace('%maxitime%',date("c",$maxitime),$output);
if ($gltf2) $output = str_replace('%gltf2%','true',$output);
else $output = str_replace('%gltf2%','false',$output);
print $output;
?>