This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
29 additions
and
1,855 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +0,0 @@ | ||
|
||
if(localStorage){ | ||
console.log('localStrage is available!'); | ||
} | ||
|
||
var logText; | ||
var now; | ||
//Firebase Legacy | ||
|
||
var dataStore; | ||
dataStore = new Firebase('https://amakusa.firebaseio.com/'); | ||
var airplanes=dataStore.child('airplanes'); | ||
|
||
|
||
//firebaseの情報が変更されたら発火 | ||
airplanes.on('value',function(dataSnapShot){ | ||
var data = dataSnapShot.val(); | ||
console.log('data from firebase!'); | ||
console.log(data); | ||
markerData = []; | ||
for(var bodyname in data){//firebaseからのデータをMarkerDataに格納 | ||
console.log(bodyname+" data "+data[bodyname]); | ||
markerData.push({ | ||
name: bodyname, | ||
lat: data[bodyname]["lat"], | ||
lng: data[bodyname]["lng"], | ||
bodyType: data[bodyname]["bodyType"], | ||
updateTime: data[bodyname]["updateTime"], | ||
flightState: data[bodyname]["flightState"], | ||
velocity: data[bodyname]["velocity"], | ||
heading: data[bodyname]["heading"], | ||
}); | ||
} | ||
var date=new Date(); | ||
now=date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); | ||
logText=localStorage.getItem('Log')+"\r\n\r\n"+now+"\r\n"+JSON.stringify(markerData); | ||
localStorage.setItem('Log', logText); | ||
|
||
document.getElementById('answer').innerHTML ="<textarea cols='100' rows='10'>"+logText+"</textarea>"; | ||
|
||
}); | ||
|
||
|
||
function handleDownload() { | ||
var blob = new Blob([ logText ], { "type" : "text/plain" }); | ||
var fileName=now; | ||
|
||
if (window.navigator.msSaveBlob) { | ||
window.navigator.msSaveBlob(blob, fileName); | ||
|
||
// msSaveOrOpenBlobの場合はファイルを保存せずに開ける | ||
window.navigator.msSaveOrOpenBlob(blob, fileName); | ||
} else { | ||
document.getElementById("download").href = window.URL.createObjectURL(blob); | ||
} | ||
} | ||
Oops, something went wrong.