1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of FlightAirmap. |
4
|
|
|
* |
5
|
|
|
* Copyright (c) Ycarus (Yannick Chabanois) <[email protected]> |
6
|
|
|
* Licensed under AGPL license. |
7
|
|
|
* For more information see: https://www.flightairmap.com/ |
8
|
|
|
*/ |
9
|
|
|
require_once('require/class.Connection.php'); |
10
|
|
|
require_once('require/class.Common.php'); |
11
|
|
|
if (isset($globalProtect) && $globalProtect) { |
12
|
|
|
@session_start(); |
|
|
|
|
13
|
|
|
if (!isset($_SESSION['protect']) || !isset($_SERVER['HTTP_REFERER'])) { |
14
|
|
|
echo 'You must access this page using the right way.'; |
15
|
|
|
die(); |
16
|
|
|
} |
17
|
|
|
} |
18
|
|
|
|
19
|
|
|
$no3dmodels = false; // Only for testing |
20
|
|
|
$one3dmodel = false; // Only for testing |
21
|
|
|
if ((isset($globalMap3DForceModel) && $globalMap3DForceModel != '') || (isset($globalMap3DOneModel) && $globalMap3DOneModel)) { |
22
|
|
|
$one3dmodel = true; |
23
|
|
|
} |
24
|
|
|
if (isset($_COOKIE['one3dmodel']) && $_COOKIE['one3dmodel'] == 'true') { |
25
|
|
|
$one3dmodel = true; |
26
|
|
|
} |
27
|
|
|
$tracker = false; |
28
|
|
|
$marine = false; |
29
|
|
|
if (isset($_GET['tracker'])) $tracker = true; |
30
|
|
|
if (isset($_GET['marine'])) $marine = true; |
31
|
|
|
if ($tracker) { |
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(); |
38
|
|
|
} elseif ($marine) { |
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(); |
45
|
|
|
} else { |
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(); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
date_default_timezone_set('UTC'); |
55
|
|
|
$begintime = microtime(true); |
56
|
|
|
$Common = new Common(); |
57
|
|
|
|
58
|
|
|
|
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); |
65
|
|
|
$c3 = cos($bank/2); |
66
|
|
|
$s3 = sin($bank/2); |
67
|
|
|
$c1c2 = $c1*$c2; |
68
|
|
|
$s1s2 = $s1*$s2; |
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'); |
75
|
|
|
|
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
|
79
|
|
|
if (isset($_GET['download'])) { |
80
|
|
|
if ($_GET['download'] == "true") |
81
|
|
|
{ |
82
|
|
|
header('Content-disposition: attachment; filename="flightairmap.json"'); |
83
|
|
|
} |
84
|
|
|
} |
85
|
|
|
header('Content-Type: text/javascript'); |
86
|
|
|
|
87
|
|
|
if (!isset($globalJsonCompress)) $compress = true; |
88
|
|
|
else $compress = $globalJsonCompress; |
89
|
|
|
|
90
|
|
|
$from_archive = false; |
91
|
|
|
$min = false; |
92
|
|
|
$allhistory = false; |
93
|
|
|
$filter['source'] = array(); |
94
|
|
|
$limit = 0; |
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; |
108
|
|
|
|
109
|
|
|
if (isset($_COOKIE['map_3d_limit'])) { |
110
|
|
|
$limit = filter_var($_COOKIE['map_3d_limit'],FILTER_SANITIZE_NUMBER_INT); |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/* |
114
|
|
|
if (isset($globalMapPopup) && !$globalMapPopup && !(isset($_COOKIE['flightpopup']) && $_COOKIE['flightpopup'] == 'true')) { |
115
|
|
|
$min = true; |
116
|
|
|
} |
117
|
|
|
|
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); |
124
|
|
|
} |
125
|
|
|
$allhistory = true; |
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); |
132
|
|
|
} |
133
|
|
|
$allhistory = true; |
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); |
147
|
|
|
} elseif ($min) { |
148
|
|
|
//$spotter_array = $SpotterLive->getMinLiveSpotterData($filter); |
149
|
|
|
$spotter_array = $SpotterLive->getMinLastLiveSpotterData($filter); |
150
|
|
|
# $min = true; |
151
|
|
|
} else { |
152
|
|
|
$spotter_array = $SpotterLive->getLiveSpotterData('','',$filter); |
153
|
|
|
} |
154
|
|
|
*/ |
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); |
164
|
|
|
if ($tracker) { |
165
|
|
|
$spotter_array = $TrackerArchive->getMinLiveTrackerDataPlayback($begindate,$enddate,$filter); |
166
|
|
|
} elseif ($marine) { |
167
|
|
|
$spotter_array = $MarineArchive->getMinLiveMarineDataPlayback($begindate,$enddate,$filter); |
168
|
|
|
} else { |
169
|
|
|
$spotter_array = $SpotterArchive->getMinLiveSpotterDataPlayback($begindate,$enddate,$filter); |
170
|
|
|
} |
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; |
181
|
|
|
} else { |
182
|
|
|
$begindate = $begindate - 3000; |
183
|
|
|
} |
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"; |
190
|
|
|
if ($tracker) { |
191
|
|
|
$spotter_array = $TrackerArchive->getMinLiveTrackerData($begindate,$enddate,$filter); |
192
|
|
|
} elseif ($marine) { |
193
|
|
|
$spotter_array = $MarineArchive->getMinLiveMarineData($begindate,$enddate,$filter); |
194
|
|
|
} else { |
195
|
|
|
$spotter_array = $SpotterArchive->getMinLiveSpotterData($begindate,$enddate,$filter); |
196
|
|
|
} |
197
|
|
|
} elseif ($tracker) { |
198
|
|
|
$coord = array(); |
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)) { |
203
|
|
|
$coord = array(); |
204
|
|
|
} |
205
|
|
|
} |
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); |
210
|
|
|
/* |
211
|
|
|
} elseif (isset($_COOKIE['MapTrack']) && $_COOKIE['MapTrack'] != '' && !empty($coord)) { |
212
|
|
|
$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,true,$_COOKIE['MapTrack']); |
213
|
|
|
*/ |
214
|
|
|
} elseif (!isset($_COOKIE['singlemodel']) || $_COOKIE['singlemodel'] == 'false') { |
215
|
|
|
$spotter_array = $TrackerLive->getMinLastLiveTrackerData($coord,$filter,false); |
216
|
|
|
} else { |
217
|
|
|
$spotter_array = array(); |
218
|
|
|
} |
219
|
|
|
$filter = $previous_filter; |
220
|
|
|
} elseif ($marine) { |
221
|
|
|
$coord = array(); |
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)) { |
227
|
|
|
$coord = array(); |
228
|
|
|
} |
229
|
|
|
} |
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); |
239
|
|
|
} else { |
240
|
|
|
$spotter_array = array(); |
241
|
|
|
} |
242
|
|
|
$filter = $previous_filter; |
243
|
|
|
} else { |
244
|
|
|
$coord = array(); |
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)) { |
249
|
|
|
$coord = array(); |
250
|
|
|
} |
251
|
|
|
} |
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); |
263
|
|
|
} else { |
264
|
|
|
$spotter_array = array(); |
265
|
|
|
} |
266
|
|
|
$filter = $previous_filter; |
267
|
|
|
} |
268
|
|
|
//print_r($spotter_array); |
269
|
|
|
if (!empty($spotter_array) && isset($coord)) { |
270
|
|
|
if ($tracker) { |
271
|
|
|
if (isset($_GET['archive'])) { |
272
|
|
|
$flightcnt = $TrackerArchive->getLiveTrackerCount($begindate,$enddate,$filter); |
273
|
|
|
} else { |
274
|
|
|
$flightcnt = $TrackerLive->getLiveTrackerCount($filter); |
275
|
|
|
} |
276
|
|
|
} elseif ($marine) { |
277
|
|
|
if (isset($_GET['archive'])) { |
278
|
|
|
$flightcnt = $MarineArchive->getLiveMarineCount($begindate,$enddate,$filter); |
279
|
|
|
} else { |
280
|
|
|
$flightcnt = $MarineLive->getLiveMarineCount($filter); |
281
|
|
|
} |
282
|
|
|
} else { |
283
|
|
|
if (isset($_GET['archive'])) { |
284
|
|
|
$flightcnt = $SpotterArchive->getLiveSpotterCount($begindate,$enddate,$filter); |
285
|
|
|
} else { |
286
|
|
|
$flightcnt = $SpotterLive->getLiveSpotterCount($filter); |
287
|
|
|
} |
288
|
|
|
} |
289
|
|
|
if ($flightcnt == '') $flightcnt = 0; |
290
|
|
|
} else $flightcnt = 0; |
291
|
|
|
|
292
|
|
|
$sqltime = round(microtime(true)-$begintime,2); |
293
|
|
|
$minitime = time(); |
294
|
|
|
$minitracktime_begin = time(); |
295
|
|
|
$minitracktime = $minitracktime_begin; |
296
|
|
|
$maxitime = 0; |
297
|
|
|
$lastupdate = filter_input(INPUT_GET,'update',FILTER_SANITIZE_NUMBER_INT); |
298
|
|
|
$modelsdb = array(); |
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]) ){ |
303
|
|
|
$model = $row[0]; |
304
|
|
|
$modelsdb[$model] = $row[1]; |
305
|
|
|
} |
306
|
|
|
} |
307
|
|
|
fclose($handle); |
308
|
|
|
} |
309
|
|
|
} |
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]) ){ |
315
|
|
|
$model = $row[0]; |
316
|
|
|
$glb = $row[1]; |
317
|
|
|
if (isset($row[2])) { |
318
|
|
|
$minisize = $row[2]; |
319
|
|
|
$modelsdb2[$model] = array('glb' => $row[1], 'size' => $minisize); |
320
|
|
|
} else { |
321
|
|
|
$modelsdb2[$model] = array('glb' => $row[1], 'size' => 20); |
322
|
|
|
} |
323
|
|
|
} |
324
|
|
|
} |
325
|
|
|
fclose($handle); |
326
|
|
|
} |
327
|
|
|
} |
328
|
|
|
$heightrelative = 'NONE'; |
329
|
|
|
//$heightrelative = 'RELATIVE_TO_GROUND'; |
330
|
|
|
$j = 0; |
331
|
|
|
$prev_flightaware_id = ''; |
332
|
|
|
$speed = 1; |
333
|
|
|
$gltf2 = false; |
334
|
|
|
$scale = 1.0; |
335
|
|
|
$minimumpixelsize = 20; |
336
|
|
|
if (isset($archivespeed)) $speed = $archivespeed; |
337
|
|
|
$output = '['; |
338
|
|
|
if ($tracker) { |
339
|
|
|
$output .= '{"id" : "document", "name" : "tracker","version" : "1.0"'; |
340
|
|
|
} elseif ($marine) { |
341
|
|
|
$output .= '{"id" : "document", "name" : "marine","version" : "1.0"'; |
342
|
|
|
} else { |
343
|
|
|
$output .= '{"id" : "document", "name" : "fam","version" : "1.0"'; |
344
|
|
|
} |
345
|
|
|
// $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"range" : "LOOP_STOP","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
346
|
|
|
|
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%"}'; |
351
|
|
|
} else { |
352
|
|
|
$output .= ',"clock": {"currentTime" : "%minitime%","multiplier" : '.$speed.',"range" : "UNBOUNDED","step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
// $output .= ',"clock": {"interval" : "'.date("c",time()-$globalLiveInterval).'/'.date("c").'","currentTime" : "'.date("c",time() - $globalLiveInterval).'","multiplier" : 1,"step": "SYSTEM_CLOCK_MULTIPLIER"}'; |
356
|
|
|
$output .= '},'; |
357
|
|
|
if (!empty($spotter_array) && is_array($spotter_array)) |
358
|
|
|
{ |
359
|
|
|
$nblatlong = 0; |
360
|
|
|
foreach($spotter_array as $spotter_item) |
361
|
|
|
{ |
362
|
|
|
$j++; |
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'] != "") |
366
|
|
|
{ |
367
|
|
|
$image = $spotter_item['image_thumbnail']; |
368
|
|
|
} else { |
369
|
|
|
$image = "images/placeholder_thumb.png"; |
370
|
|
|
} |
371
|
|
|
|
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 != '') { |
377
|
|
|
/* |
378
|
|
|
if ($nblatlong == 1) { |
379
|
|
|
$output .= ',"'.date("c").'", '; |
380
|
|
|
$output .= $prevlong.', '; |
381
|
|
|
$output .= $prevlat; |
382
|
|
|
if (!$marine) $output .= ', '.$prevalt; |
383
|
|
|
else $output .= ', 0'; |
384
|
|
|
} |
385
|
|
|
*/ |
386
|
|
|
$output .= ']'; |
387
|
|
|
$output .= '}'; |
388
|
|
|
//$output .= ', '.$orientation.']}'; |
389
|
|
|
$output .= '},'; |
390
|
|
|
} |
391
|
|
|
$orientation = ''; |
392
|
|
|
$prev_flightaware_id = $id; |
393
|
|
|
$nblatlong = 0; |
394
|
|
|
$output .= '{'; |
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'].'",'; |
402
|
|
|
} |
403
|
|
|
if (isset($spotter_item['departure_airport'])) { |
404
|
|
|
$output .= '"departure_airport_code": "'.$spotter_item['departure_airport'].'",'; |
405
|
|
|
} |
406
|
|
|
if (isset($spotter_item['arrival_airport'])) { |
407
|
|
|
$output .= '"arrival_airport_code": "'.$spotter_item['arrival_airport'].'",'; |
408
|
|
|
} |
409
|
|
|
if (isset($spotter_item['squawk'])) { |
410
|
|
|
$output .= '"squawk": "'.$spotter_item['squawk'].'",'; |
411
|
|
|
} |
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']).','; |
415
|
|
|
if ($tracker) { |
416
|
|
|
if (isset($spotter_item['type'])) $output .= '"tracker_type": '.json_encode($spotter_item['type']).','; |
417
|
|
|
$output.= '"type": "tracker"'; |
418
|
|
|
} elseif ($marine) { |
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"'; |
425
|
|
|
} else { |
426
|
|
|
if ($one3dmodel === false && isset($globalMap3DLiveries) && $globalMap3DLiveries) { |
427
|
|
|
$aircraft_icao = $spotter_item['aircraft_icao']; |
428
|
|
|
$ident = $spotter_item['ident']; |
429
|
|
|
if ($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); |
434
|
|
|
} |
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.'",'; |
439
|
|
|
} |
440
|
|
|
} |
441
|
|
|
} |
442
|
|
|
//if ($ident != '') $output.= '"ident": "'.$ident.'",'; |
443
|
|
|
} |
444
|
|
|
$output.= '"gltf2": %gltf2%,'; |
445
|
|
|
$output.= '"type": "flight"'; |
446
|
|
|
} |
447
|
|
|
$output .= '},'; |
448
|
|
|
|
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 } '; |
458
|
|
|
$output .= '}'; |
459
|
|
|
$output .= '}, '; |
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+Jl7AQBblCEVAaCR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R2M3Bviv59wDTgQGTPH84Qd8+HXfHcoUws2zM0HMjuUPep+xP2PWpnwtw0GJsldbBpewQwE/gbeDyt7H1gcW53O7AC+A3Yn6+/W+Ld9SnWA15DAVhc8xK2TuA9YHrCuhV4EngFuBx4YagG6qv8cF+T52kB2Zy+e1I8taUacNV+uBdXO7ABmJwJpwx8XQvF9TUCWM64tiQhbq/oMv+7BwFWpQzNT8vbVQul/wwAGzzdmXU1xuUAAAAASUVORK5CYII=","scale" : 1.5},'; |
464
|
|
|
if ($no3dmodels) { |
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]}'; |
479
|
|
|
} |
480
|
|
|
$output .= '},'; |
481
|
|
|
} |
482
|
|
|
} else $output .= ' "billboard" : {"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT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KwAzg2+/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},'; |
483
|
|
|
} elseif ($one3dmodel) { |
484
|
|
|
if (isset($globalMap3DForceModel) && $globalMap3DForceModel != '') { |
485
|
|
|
$output .= '"model": {"gltf" : "'.$globalURL.'/models/'.$globalMap3DForceModel.'","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.''; |
486
|
|
|
} else { |
487
|
|
|
$output .= '"model": {"gltf" : "'.$globalURL.'/models/737.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.''; |
488
|
|
|
} |
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]}'; |
493
|
|
|
} |
494
|
|
|
$output .= '},'; |
495
|
|
|
} else { |
496
|
|
|
if (isset($spotter_item['aircraft_icao'])) { |
497
|
|
|
$aircraft_icao = $spotter_item['aircraft_icao']; |
498
|
|
|
if (isset($modelsdb2[$aircraft_icao]) && $aircraft_icao != '') { |
499
|
|
|
$gltf2 = true; |
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]}'; |
505
|
|
|
} |
506
|
|
|
$output .= '},'; |
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]}'; |
513
|
|
|
} |
514
|
|
|
$output .= '},'; |
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]}'; |
530
|
|
|
} |
531
|
|
|
$output .= '},'; |
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]}'; |
539
|
|
|
} |
540
|
|
|
$output .= '},'; |
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') { |
545
|
|
|
$model = 'J1M'; |
546
|
|
|
} elseif ($spotter_item['wake_category'] == 'L') { |
547
|
|
|
$model = ''; |
548
|
|
|
} |
549
|
|
|
} elseif ($spotter_item['engine_count'] == '2') { |
550
|
|
|
if ($spotter_item['wake_category'] == 'M') { |
551
|
|
|
$model = 'J2M'; |
552
|
|
|
} elseif ($spotter_item['wake_category'] == 'H') { |
553
|
|
|
$model = 'J2H'; |
554
|
|
|
} elseif ($spotter_item['wake_category'] == 'L') { |
555
|
|
|
$model = 'J2L'; |
556
|
|
|
} |
557
|
|
|
} elseif ($spotter_item['engine_count'] == '3') { |
558
|
|
|
if ($spotter_item['wake_category'] == 'M') { |
559
|
|
|
$model = 'J3M'; |
560
|
|
|
} elseif ($spotter_item['wake_category'] == 'H') { |
561
|
|
|
$model = 'J3H'; |
562
|
|
|
} |
563
|
|
|
} elseif ($spotter_item['engine_count'] == '4') { |
564
|
|
|
if ($spotter_item['wake_category'] == 'M') { |
565
|
|
|
$model = 'J4M'; |
566
|
|
|
} elseif ($spotter_item['wake_category'] == 'H') { |
567
|
|
|
$model = 'J4H'; |
568
|
|
|
} |
569
|
|
|
} |
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]}'; |
576
|
|
|
} |
577
|
|
|
$output .= '},'; |
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]}'; |
585
|
|
|
} |
586
|
|
|
$output .= '},'; |
587
|
|
|
$modelsdb[$aircraft_icao] = $modelsdb[$model]; |
588
|
|
|
} else { |
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]}'; |
594
|
|
|
} |
595
|
|
|
$output .= '},'; |
596
|
|
|
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
597
|
|
|
} |
598
|
|
|
} elseif ($spotter_item['engine_type'] == 'Turboprop') { |
599
|
|
|
if ($spotter_item['engine_count'] == '1') { |
600
|
|
|
if ($spotter_item['wake_category'] == 'L') { |
601
|
|
|
$model = 'T1L'; |
602
|
|
|
} |
603
|
|
|
} elseif ($spotter_item['engine_count'] == '2') { |
604
|
|
|
if ($spotter_item['wake_category'] == 'M') { |
605
|
|
|
$model = 'T2M'; |
606
|
|
|
} elseif ($spotter_item['wake_category'] == 'L') { |
607
|
|
|
$model = 'T2L'; |
608
|
|
|
} |
609
|
|
|
} elseif ($spotter_item['engine_count'] == '4') { |
610
|
|
|
if ($spotter_item['wake_category'] == 'M') { |
611
|
|
|
} elseif ($spotter_item['wake_category'] == 'H') { |
612
|
|
|
$model = 'T4H'; |
613
|
|
|
} |
614
|
|
|
} |
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]}'; |
621
|
|
|
} |
622
|
|
|
$output .= '},'; |
623
|
|
|
$modelsdb[$aircraft_icao] = $modelsdb[$model]; |
624
|
|
|
} else { |
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]}'; |
630
|
|
|
} |
631
|
|
|
$output .= '},'; |
632
|
|
|
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
633
|
|
|
} |
634
|
|
|
} elseif ($spotter_item['engine_type'] == 'Piston') { |
635
|
|
|
if ($spotter_item['engine_count'] == '1') { |
636
|
|
|
if ($spotter_item['wake_category'] == 'L') { |
637
|
|
|
$model = 'P1L'; |
638
|
|
|
} elseif ($spotter_item['wake_category'] == 'M') { |
639
|
|
|
$model = 'P1M'; |
640
|
|
|
} |
641
|
|
|
} elseif ($spotter_item['engine_count'] == '2') { |
642
|
|
|
if ($spotter_item['wake_category'] == 'M') { |
643
|
|
|
$model = 'P2M'; |
644
|
|
|
} elseif ($spotter_item['wake_category'] == 'L') { |
645
|
|
|
$model = 'P2L'; |
646
|
|
|
} |
647
|
|
|
// ju52 = P3M |
648
|
|
|
} |
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]}'; |
655
|
|
|
} |
656
|
|
|
$output .= '},'; |
657
|
|
|
$modelsdb[$aircraft_icao] = $modelsdb[$model]; |
658
|
|
|
} else { |
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]}'; |
664
|
|
|
} |
665
|
|
|
$output .= '},'; |
666
|
|
|
$modelsdb[$aircraft_icao] = 'Cesium_Air.glb'; |
667
|
|
|
} |
668
|
|
|
} else { |
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]}'; |
674
|
|
|
} |
675
|
|
|
$output .= '},'; |
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'; |
679
|
|
|
} |
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]}'; |
687
|
|
|
} |
688
|
|
|
$output .= '},'; |
689
|
|
|
$modelsdb[$aircraft_icao] = $modelsdb[$aircraft_shadow]; |
690
|
|
|
} else { |
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]}'; |
696
|
|
|
} |
697
|
|
|
$output .= '},'; |
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'; |
701
|
|
|
} |
702
|
|
|
} else { |
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]}'; |
709
|
|
|
} |
710
|
|
|
$output .= '},'; |
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'; |
714
|
|
|
} |
715
|
|
|
} elseif ($tracker && isset($spotter_item['type'])) { |
716
|
|
|
if ($spotter_item['type'] == 'Car' || $spotter_item['type'] == 'Van') { |
717
|
|
|
$onground = true; |
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"'; |
726
|
|
|
} |
727
|
|
|
$output .= '},'; |
728
|
|
|
} elseif ($spotter_item['type'] == 'Truck' || $spotter_item['type'] == 'Truck (18 Wheeler)') { |
729
|
|
|
$onground = true; |
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"'; |
737
|
|
|
} |
738
|
|
|
$output .= '},'; |
739
|
|
|
} elseif ($spotter_item['type'] == 'Firetruck') { |
740
|
|
|
$onground = true; |
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"'; |
748
|
|
|
} |
749
|
|
|
$output .= '},'; |
750
|
|
|
} elseif ($spotter_item['type'] == 'Bike') { |
751
|
|
|
$onground = true; |
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"'; |
759
|
|
|
} |
760
|
|
|
$output .= '},'; |
761
|
|
|
} elseif ($spotter_item['type'] == 'Police') { |
762
|
|
|
$onground = true; |
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"'; |
770
|
|
|
} |
771
|
|
|
$output .= '},'; |
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"'; |
779
|
|
|
} |
780
|
|
|
$output .= '},'; |
781
|
|
|
} elseif ($spotter_item['type'] == 'Ship (Power Boat)' || $spotter_item['type'] == 'Yatch (Sail)') { |
782
|
|
|
$onground = true; |
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"'; |
790
|
|
|
} |
791
|
|
|
$output .= '},'; |
792
|
|
|
} else { |
793
|
|
|
$onground = true; |
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"'; |
801
|
|
|
} |
802
|
|
|
$output .= '},'; |
803
|
|
|
} |
804
|
|
|
} elseif ($marine) { |
805
|
|
|
if ($spotter_item['type_id'] == 36) { |
806
|
|
|
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/sail.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.''; |
807
|
|
|
} else { |
808
|
|
|
$output .= '"model": {"gltf" : "'.$globalURL.'/models/vehicules/boat.glb","scale" : '.$scale.',"minimumPixelSize": '.$minimumpixelsize.''; |
809
|
|
|
} |
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"'; |
816
|
|
|
} |
817
|
|
|
$output .= '},'; |
818
|
|
|
} |
819
|
|
|
} |
820
|
|
|
if (isset($onground) && $onground) $output = str_replace('%onground%','true',$output); |
821
|
|
|
else $output = str_replace('%onground%','false',$output); |
822
|
|
|
|
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)) { |
844
|
|
|
if (!$marine) { |
845
|
|
|
if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') { |
846
|
|
|
$output .= ', '.round($spotter_item['real_altitude']*0.3048); |
847
|
|
|
if ($tracker) { |
848
|
|
|
$prevalt = round($spotter_item['real_altitude']*0.3048); |
849
|
|
|
} else { |
850
|
|
|
$prevalt = round($spotter_item['real_altitude']*30.48); |
851
|
|
|
} |
852
|
|
|
} elseif ($tracker) { |
853
|
|
|
$output .= ', '.round($spotter_item['altitude']*0.3048); |
854
|
|
|
$prevalt = round($spotter_item['altitude']*0.3048); |
855
|
|
|
} else { |
856
|
|
|
$output .= ', '.round($spotter_item['altitude']*30.48); |
857
|
|
|
$prevalt = round($spotter_item['altitude']*30.48); |
858
|
|
|
} |
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']; |
864
|
|
|
} else { |
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.', '; |
870
|
|
|
$output .= $prevlat; |
871
|
|
|
//if (!$marine && (!isset($onground) || !$onground)) $output .= ', '.$prevalt; |
872
|
|
|
if (!$marine) $output .= ', '.$prevalt; |
873
|
|
|
else $output .= ', 0'; |
874
|
|
|
} else { |
875
|
|
|
$output .= $spotter_item['longitude'].', '; |
876
|
|
|
$output .= $spotter_item['latitude']; |
877
|
|
|
//if (!$marine && (!isset($onground) || !$onground)) { |
878
|
|
|
if (!$marine) { |
879
|
|
|
if ($spotter_item['altitude'] == '') { |
880
|
|
|
if ($prevalt != '') { |
881
|
|
|
$output .= ', '.$prevalt; |
882
|
|
|
} else { |
883
|
|
|
$output .= ', 0'; |
884
|
|
|
} |
885
|
|
|
} else { |
886
|
|
|
if (isset($spotter_item['real_altitude']) && $spotter_item['real_altitude'] != '') $output .= ', '.round($spotter_item['real_altitude']*0.3048); |
887
|
|
|
elseif ($tracker) { |
888
|
|
|
$output .= ', '.round($spotter_item['altitude']*0.3048); |
889
|
|
|
} else { |
890
|
|
|
$output .= ', '.round($spotter_item['altitude']*30.48); |
891
|
|
|
} |
892
|
|
|
} |
893
|
|
|
} else $output .= ', 0'; |
894
|
|
|
} |
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']; |
897
|
|
|
} |
898
|
|
|
} |
899
|
|
|
//$output = substr($output, 0, -1); |
900
|
|
|
$output .= ']}}'; |
901
|
|
|
} else { |
902
|
|
|
$output = substr($output, 0, -1); |
903
|
|
|
} |
904
|
|
|
$output .= ']'; |
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); |
911
|
|
|
} else { |
912
|
|
|
$output = str_replace('%minitime%',date("c",time()-$globalLiveInterval),$output); |
913
|
|
|
} |
914
|
|
|
} |
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); |
918
|
|
|
} else { |
919
|
|
|
$output = str_replace('%minitime%',date("c",$minitime),$output); |
920
|
|
|
} |
921
|
|
|
if (isset($enddateinitial)) { |
922
|
|
|
$output = str_replace('%maxitime%',date("c",$enddateinitial),$output); |
923
|
|
|
} else { |
924
|
|
|
$output = str_replace('%maxitime%',date("c",$maxitime),$output); |
925
|
|
|
} |
926
|
|
|
if ($gltf2) $output = str_replace('%gltf2%','true',$output); |
927
|
|
|
else $output = str_replace('%gltf2%','false',$output); |
928
|
|
|
print $output; |
929
|
|
|
?> |
930
|
|
|
|
If you suppress an error, we recommend checking for the error condition explicitly: