DroneDeploy
Search…
Images.get
note: You must upload your own project in order to use this API. Please refer to the article on uploading an example project.
1
<!DOCTYPE html>
2
<html lang="en">
3
4
<head>
5
<meta charset="UTF-8">
6
<title>Document</title>
7
<style>
8
.title {
9
font-size: 1.3em;
10
font-weight: 500;
11
text-align: center;
12
}
13
14
.sans {
15
font-family: Lato, sans-serif;
16
color: rgba(0, 0, 0, 0.87);
17
}
18
19
ul {
20
max-height: 700px;
21
overflow-y: scroll;
22
}
23
24
li {
25
list-style: none;
26
float: left;
27
margin: 1px 5px;
28
}
29
30
img {
31
max-width: 100px;
32
}
33
</style>
34
</head>
35
36
<body>
37
<h1 class="title sans">Images.get example</h1>
38
<ul id="images"></ul>
39
<script>
40
var imageOutput = document.getElementById('images');
41
42
function formatOutput(image) {
43
//es6 template string
44
return `<li class="image-output">
45
<img src="${image.path}" />
46
</li>`
47
}
48
49
var options = {
50
width: 450,
51
height: 450
52
}
53
54
new DroneDeploy({
55
version: 1
56
})
57
.then(function(dronedeployApi) {
58
return dronedeployApi.Plans.getCurrentlyViewed()
59
.then(function(plan) {
60
return dronedeployApi.Images.get(plan.id, options)
61
})
62
})
63
.then(function(images) {
64
imageOutput.innerHTML = images.map(formatOutput).join('');
65
});
66
</script>
67
</body>
68
69
</html>
Copied!
Last modified 2yr ago
Copy link