DroneDeploy
Search…
Flightlog.getLogsFromPlan
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="UTF-8">
5
<title>Document</title>
6
</head>
7
<body>
8
<h1 class="title">FlightLogs.getLogsFromPlan example</h1>
9
<ul id="logOutput"></ul>
10
<script>
11
var logOutput = document.getElementById('logOutput')
12
13
function formatOutput(log) {
14
//es6 template string
15
return `
16
<li class="flightlog">
17
<span>Start time: ${log.startTime}</span>
18
<span>Duration: ${log.duration}</span>
19
<a href="${log.downloadUrl}" target="_blank">Download log</a>
20
</li>
21
`
22
}
23
24
new DroneDeploy({ version: 1})
25
.then(function(dronedeployApi) {
26
return dronedeployApi.Plans.getCurrentlyViewed()
27
.then(function(plan) {
28
return dronedeployApi.FlightLogs.getLogsFromPlan(plan.id)
29
})
30
.then(function(logs){
31
logOutput.innerHTML = logs.map(formatOutput).join('')
32
});
33
})
34
</script>
35
</body>
36
</html>
Copied!
Copy link