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