Search documentation
karat

+

K

User Documentation ↗
Version 1.0

Add Annotations To Map

POST/api/gotham/v1/maps/{mapRid}/layers/annotations
Warning

This endpoint is in preview and may be modified or removed at any time. To use this endpoint, add preview=true to the request query parameters.

Add annotations to a map. Currently only Line, Polygon, Rectangle, Point, and tactical graphic annotations may be added. If any provided parameters are unknown, invalid, or do not satisfy the security requirements, the entire request will fail. For each request, a new element is created for each annotation, as well as a new layer if no parent layer is specified; thus not idempotent. Returns the ID of the layer created.

Path parameters

mapRid
string

The RID of the Gaia map that you wish to add annotations to.

Query parameters

preview
boolean
optional

Represents a boolean value that restricts an endpoint to preview mode when set to true.

Request body

AddAnnotationsToMapRequest
object

The request body to add annotations to a map

Hide child attributes

Hide child attributes

parentLayerId
string
optional

The ID of a layer in a Gaia map.

layerLabel
string
optional

If provided AND no existing parentLayerId is provided, the new layer created will be set with the provided label.

annotations
list<GaiaAnnotation>
optional

The annotations to be added to the map.

Show child attributes

Show child attributes

Response body

AddAnnotationsToMapResponse
object

Success response.

Hide child attributes

Hide child attributes

parentLayerId
string

The ID of a layer in a Gaia map.

annotationIds
list<string>
optional

The IDs of the created annotations

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ \t-H "Content-type: application/json" \ \t-H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/gotham/v1/maps/ri.gaia..map.a1A2bcD3e45fg6h7ij/layers/annotations?preview=true" \ -d '{"layerLabel":"Example layer name.","annotations":[{"title":"Example line annotation name.","annotationDescription":"Example description.","annotationType":{"type":"LineAnnotation","coordinates":[{"lon":0,"lat":0},{"lon":1,"lat":1},{"lon":2,"lat":2}]},"style":{"fill":{"opacity":0.5,"color":"#000000"}}}]}'

Response

Copied!
1 2 3 4 5 6 7 { "parentLayerId": "exampleLayerId", "annotationIds": [ "exampleAnnotationId1", "exampleAnnotationId2" ] }