DroneDeploy
Search…
Annotations
Overview

Annotations.createMarker

Overview
This function creates an annotation at a specific point.
1
const planId = String;
2
const location = {
3
lat: 35,
4
lng: -96
5
};
6
const displayOptions = { // optional display options
7
description: 'My Marker Annotation'
8
color: '#888888'
9
}
10
dronedeployApi.Annotations.createMarker(planId, location, displayOptions);
Copied!

Annotations.createLine

Overview
This function creates a line-based annotation based on a series of points.
1
const planId = String;
2
const geometry = [
3
{lat: 35, lng: 35},
4
{lat: 35, lng: 36},
5
{lat: 36, lng: 36}
6
];
7
const displayOptions = { // optional display options
8
description: 'My Line Annotation',
9
color: '#888888'
10
}
11
dronedeployApi.Annotations.createLine(planId, location, displayOptions);
Copied!

Annotations.createArea

Overview
This function creates a polygon annotation given a series of points.
1
const planId = String;
2
const geometry = [
3
{lat: 35, lng: 35},
4
{lat: 35, lng: 36},
5
{lat: 36, lng: 36},
6
{lat: 36, lng: 35}
7
];
8
const displayOptions = { //optional display options
9
description: 'My Area Annotation',
10
color: '#888888',
11
fillColor: '#666666' // only relevant for an area annotation
12
}
13
dronedeployApi.Annotations.createArea(planId, location, displayOptions);
Copied!

Annotations.createVolume

Ceates a polygon annotation given a series of points. Very similiar to area annotation but volume information can be retrieved with getVolume.
1
const planId = String;
2
const geometry = [
3
{lat: 35, lng: 35},
4
{lat: 35, lng: 36},
5
{lat: 36, lng: 36},
6
{lat: 36, lng: 35}
7
];
8
const displayOptions = { //optional display options
9
description: 'My Area Annotation',
10
color: '#888888',
11
fillColor: '#666666' // only relevant for an area annotation
12
}
13
dronedeployApi.Annotations.createArea(planId, location, displayOptions)
14
.then(function(annotationId){
15
return dronedeployApi.Annotations.getVolume(annotationId);
16
}).then(function(volumeInformation){
17
console.log(volumeInformation);
18
})
Copied!

Annotations.delete

Overview
This function deletes a specific annotation.
1
const annotationId: String;
2
dronedeployApi.Annotations.delete(annotationId);
Copied!

Annotations.get

Overview
This function returns all the annotations for a given plan.
1
const planId = String;
2
const optionalOptions = {
3
comments: boolean, // embed comments into annotations response
4
};
5
dronedeployApi.Annotations.get(planId, optionalOptions)
6
.then(function(annotations){ console.log(annotations) })
Copied!
Example Call
1
dronedeployApi.Annotations.get('5730dc11929d2465038183ab', {comments: true})
2
.then(function(annotations){ console.log(annotations) })
Copied!
Example Response
1
[
2
{
3
"info": {
4
"geometry": [
5
{
6
"type": "Coords",
7
"value": {
8
"lat": 35.92649941843441,
9
"lng": -96.7485022544861
10
},
11
"isPending": false
12
}
13
]
14
},
15
"userId": "56282ec3098f6b3987e2e937",
16
"fillColor": "#40ccde",
17
"dateModified": 1477425822658,
18
"color": "#00bbd3",
19
"comments": [],
20
"options": 0,
21
"geometry": {
22
"lat": 35.92649941843441,
23
"lng": -96.7485022544861
24
},
25
"annotationType": "LOCATION",
26
"id": "580fba9ecb5fda701d819131",
27
"planId": "5730dc11929d2465038183ab",
28
"type": "marker",
29
"dateCreation": 1477425822658,
30
"description": ""
31
},
32
{
33
"info": {
34
"geometry": [
35
{
36
"type": "Area",
37
"value": 3935.274554447226,
38
"isPending": false
39
}
40
]
41
},
42
"userId": "56282ec3098f6b3987e2e937",
43
"fillColor": "#40ccde",
44
"dateModified": 1477425814283,
45
"color": "#00bbd3",
46
"comments": [],
47
"options": 0,
48
"geometry": [
49
{
50
"lat": 35.92754630265763,
51
"lng": -96.74921572208406
52
},
53
{
54
"lat": 35.927016346401395,
55
"lng": -96.74940884113313
56
},
57
{
58
"lat": 35.92681218197787,
59
"lng": -96.74877047538757
60
},
61
{
62
"lat": 35.92742467366698,
63
"lng": -96.74858808517457
64
}
65
],
66
"annotationType": "VOLUME",
67
"id": "580fba96cb5fda701d819130",
68
"planId": "5730dc11929d2465038183ab",
69
"type": "polygon",
70
"dateCreation": 1477425814283,
71
"description": ""
72
},
73
]
Copied!

Annotations.getVolume

Overview
This function returns the volume information for a volume annotation. DroneDeploy uses this data in the volume annotation detail.
1
const annotationId = String;
2
dronedeployApi.Annotations.getVolume(annotationId)
3
.then(function(volume){ console.log(volume) })
Copied!
Example Call
1
dronedeployApi.Annotations.getVolume('581286dccb5fda14db8d2971')
2
.then(function(volume){ console.log(volume) })
Copied!
Example Response
1
{
2
"tiles": [
3
[
4
121242,
5
206011
6
],
7
[
8
121242,
9
206012
10
]
11
],
12
"fill_raw": -333.997766494751,
13
"linear": true,
14
"edge_points": [
15
[
16
31038034,
17
52739050,
18
-66.44757270812988
19
],
20
[
21
31037990,
22
52739050,
23
-66.44757270812988
24
],
25
[
26
31037988,
27
52739126,
28
-66.44757270812988
29
],
30
[
31
31038052,
32
52739126,
33
-66.44757270812988
34
]
35
],
36
"volume": 529.3595442153552,
37
"cut_raw": 9389.320287704468,
38
"volume_raw": 9055.322521209717,
39
"fill": -19.524970538209864,
40
"baseplanetype": "fit",
41
"cut": 548.8845147535651,
42
"polygon": "POLYGON((-96.74950540065767 35.92691643621745,-96.74962341785431 35.92691643621745,-96.74962878227235 35.92675136694131,-96.74945712089539 35.92675136694131,-96.74950540065767 35.92691643621745))",
43
"meters_per_pixel": 0.24178169191004395,
44
"order": 1
45
}
Copied!
Errors
If the map is a legacy map and does not support volume annotations the following error will be returned.
1
dronedeployApi.Annotations.getVolume('581286dccb5fda14db8d2971')
2
.then(
3
function(){},
4
function(error){ console.log(error) }
5
);
6
// Map does not support volume annotations.
Copied!

Annotations.update

Overview
This function enables updates to existing annotation properties. Valid properties include:
    color
    description
    geometry
1
const existingAnnotationId = String;
2
// NOTE: None of the properties are required, can include one or more
3
const propertiesToUpdate = {
4
color: '#888888' // must be a hex value, annotation fill color automatically derived from color value
5
description: 'My new annotation description',
6
geometry: [
7
{ lat: 35, lng: 36 },
8
{ lat: 33, lng: 34 },
9
{ lat: 30, lng: 31 },
10
],
11
};
12
dronedeployApi.Annotations.update(existingAnnotationId, propertiesToUpdate)
13
.then(function() {
14
// do stuff after update
15
})
16
.catch(function(err) {
17
// something went wrong with the update
18
console.log(err);
19
});
Copied!