我升级了我的解码器,现在JSON格式已经改变了。我曾经有过:
{ "now" : 1503356002.2,
"messages" : 15498434,
"aircraft" : [
{"hex":"c814bb","squawk":"5734","altitude":800,"messages":7,"seen":3.1,"rssi":-31.7},
{"hex":"7c7ab6","squawk":"1031","flight":"VOZ150 ","lat":-36.489761,"lon":173.816013,"nucp":7,"seen_pos":0.7,"altitude":24900,"vert_rate":-2112,"track":134,"speed":409,"messages":138,"seen":0.7,"rssi":-30.4},
{"hex":"7c6b0b","squawk":"5717","flight":"JST232 ","altitude":1700,"vert_rate":-960,"track":13,"speed":169,"messages":17,"seen":264.2,"rssi":-29.8},
{"hex":"885157","squawk":"6130","flight":"THA491 ","lat":-36.876480,"lon":175.008175,"nucp":6,"seen_pos":6.3,"altitude":2900,"vert_rate":-64,"track":145,"speed":242,"messages":3095,"seen":6.3,"rssi":-28.4},
{"hex":"c820ea","squawk":"5041","flight":"ZKDAE ","altitude":5175,"messages":154,"seen":3.5,"rssi":-31.1},
{"hex":"c81c31","squawk":"7227","flight":"ZKSDF ","altitude":6900,"messages":2125,"seen":215.1,"rssi":-30.7}
]
}
并且能够使用以下方式在地图上显示JSON中的所有飞机:
$.when($.getJSON(url)).done(function (data) {
$.each(data.aircraft, function (i, value) {
我现在怎么用这个:
{"src":1,"feeds":[{"id":1,"name":"Receiver","polarPlot":false},{"id":2,"name":"Receiver 2","polarPlot":false},{"id":3,"name":"Merged Feed","polarPlot":false}],"srcFeed":3,"showSil":false,"showFlg":false,"showPic":false,"flgH":20,"flgW":85,"acList":[{"Id":11296426,"Rcvr":2,"HasSig":false,"Icao":"AC5EAA","Bad":false,"Reg":"N8965E","FSeen":"\/Date(1503357257608)\/","CMsgs":1,"InHg":29.97933,"AltT":0,"Lat":39.5892,"Long":-94.2512,"PosTime":1503357257608,"Mlat":false,"Tisb":false,"Trak":79.5,"TrkH":false,"Type":"CRJ2","Mdl":"Bombardier CRJ 200LR","Man":"Bombardier","CNum":"7965","Op":"Delta Connection","OpIcao":"SKW","Sqk":"","VsiT":0,"WTC":2,"Species":1,"Engines":"2","EngType":3,"EngMount":1,"Mil":false,"Cou":"United States","HasPic":false,"Interested":false,"FlightsCount":0,"SpdTyp":0,"CallSus":false,"Trt":2,"Year":"2004"},{"Id":11308394,"Rcvr":2,"HasSig":false,"Icao":"AC8D6A","Bad":false,"Reg":"N908FJ","FSeen":"\/Date(1503357257577)\/","CMsgs":1,"Alt":37000,"GAlt":37169,"InHg":30.088583,"AltT":0,"Lat":32.1863,"Long":-100.7623,"PosTime":1503357257577,"Mlat":false,"Tisb":false,"TrkH":false,"Type":"CRJ9","Mdl":"Bombardier CRJ 900","Man":"Bombardier","CNum":"15008","Op":"American Eagle","OpIcao":"ASH","Sqk":"","VsiT":0,"WTC":2,"Species":1,"Engines":"2","EngType":3,"EngMount":1,"Mil":false,"Cou":"United States","HasPic":false,"Interested":false,"FlightsCount":0,"SpdTyp":0,"CallSus":false,"Trt":2,"Year":"2003"},{"Id":10570452,"Rcvr":2,"HasSig":true,"Sig":48,"Icao":"A14AD4","Bad":false,"FSeen":"\/Date(1503357257559)\/","CMsgs":1,"Alt":31975,"GAlt":31946,"InHg":29.8907471,"AltT":0,"Lat":45.069199,"Long":-94.317902,"PosTime":1503357257559,"Mlat":false,"Tisb":false,"Spd":357.0,"Trak":280.0,"TrkH":false,"Sqk":"2434","Help":false,"Vsi":1441,"VsiT":0,"WTC":0,"Species":0,"EngType":0,"EngMount":0,"Mil":false,"Cou":"United States","HasPic":false,"Interested":false,"FlightsCount":0,"Gnd":false,"SpdTyp":0,"CallSus":false,"Trt":2},{"Id":7868311,"Rcvr":2,"HasSig":false,"Icao":"780F97","Bad":false,"FSeen":"\/Date(1503357255915)\/","TSecs":2,"CMsgs":3,"Alt":1850,"GAlt":1664,"InHg":29.7342529,"AltT":0,"Lat":31.165283,"Long":121.33398,"PosTime":1503357255915,"Mlat":false,"Tisb":false,"Spd":160.0,"Trak":170.0,"TrkH":false,"Sqk":"","Vsi":3130,"VsiT":0,"WTC":0,"Species":0,"EngType":0,"EngMount":0,"Mil":false,"Cou":"China","HasPic":false,"Interested":false,"FlightsCount":0,"SpdTyp":0,"CallSus":false,"Trt":2},{"Id":11322873,"Rcvr":2,"HasSig":false,"Icao":"ACC5F9","Bad":false,"Reg":"N922DX","FSeen":"\/Date(1503357255788)\/","TSecs":2,"CMsgs":2,"Alt":3000,"GAlt":3089,"InHg":30.0088577,"AltT":0,"Lat":29.562999,"Long":-98.429314,"PosTime":1503357255788,"Mlat":true,"Tisb":false,"Spd":174.0,"Trak":43.6,"TrkH":false,"Type":"MD90","Mdl":"McDonnell Douglas MD-90 30","Man":"McDonnell Douglas","CNum":"53584","Op":"Delta Air Lines","OpIcao":"DAL","Sqk":"","Vsi":2112,"VsiT":1,"WTC":2,"Species":1,"Engines":"2","EngType":3,"EngMount":1,"Mil":false,"Cou":"United States","HasPic":false,"Interested":false,"FlightsCount":0,"SpdTyp":0,"CallSus":false,"Trt":2},{"Id":10903739,"Rcvr":2,"HasSig":true,"Sig":42,"Icao":"A660BB","Bad":false,"FSeen":"\/Date(1503357255786)\/","TSecs":2,"CMsgs":2,"Alt":5300,"GAlt":5560,"InHg":30.1801186,"AltT":0,"Lat":36.594807,"Long":-79.859853,"PosTime":1503357255786,"Mlat":false,"Tisb":false,"TrkH":false,"Sqk":"","VsiT":0,"WTC":0,"Species":0,"EngType":0,"EngMount":0,"Mil":false,"Cou":"United States","HasPic":false,"Interested":false,"FlightsCount":0,"SpdTyp":0,"CallSus":false,"Trt":2},{"Id":8149995,"Rcvr":2,"HasSig":true,"Sig":35,"Icao":"7C5BEB","Bad":false,"FSeen":"\/Date(1503357255698)\/","TSecs":2,"CMsgs":3,"Alt":9325,"GAlt":9494,"InHg":30.088583,"AltT":0,"Call":"SFX","Lat":-28.675527,"Long":153.665448,"PosTime":1503357257560,"Mlat":false,"Tisb":false,"Spd":186.5,"Trak":67.3,"TrkH":false,"Sqk":"1630","Help":false,"Vsi":-3648,"VsiT":0,"WTC":0,"Species":0,"EngType":0,"EngMount":0,"Mil":false,"Cou":"Australia","HasPic":false,"Interested":false,"FlightsCount":0,"Gnd":false,"SpdTyp":0,"CallSus":false,"Trt":5},]
我已将代码修改为
$.when($.getJSON(url)).done(function (data) {
$.each(data.acList, function (i, value) {
它一次只显示一架飞机而不是其余的飞机。有关如何修改代码以使其正确显示的任何想法请。