CadOverlay

What is a Cad Overlay?

A Cad Overlay is a mechanism that allows to put an image on a map or plan. For more general information about Overlays, click here.

Contents

CadOverlay.prepare

Overview

Prepares a new overlay (creates new id and returns it).

Example Call

dronedeployApi.CadOverlay.prepare();

Example response

{
  "id": "12ab34cd56ef78gh90ij12kl"
}

Full Example

CadOverlay.import

Overview

Import an overlay image directly from a third party source using a download url.

Example Call

const url = 'https://www.mysite.com/my-overlay-image.png';
// Configure any headers required by the download site
// NOTE: headers may not be needed if using a signed download url
const headers = {
  "Authorization": "Bearer mysecretbearertoken",
  "X-Custom": "custom-header-value-for-mysite",
};
const name = 'My Overlay Image Name'
const id = 'ID Of New Overlay (generated by prepare method)'

// Call the import function
// NOTE: headers, name and id are optional parameters (use `undefined` as defaults)
dronedeployApi.CadOverlay.import(url, headers, name, id);

// Example if not adding headers or id
dronedeployApi.CadOverlay.import(url, undefined, name);

How to Use

This API will be most effective when used with the App Zone in the Add Layer dialog, but can also be used from the App Zone in the Explore Page sidebar as well.

  1. Drag your plugin code into the desired App Zone

  2. Interact with your plugin UI to trigger your import call

  3. Following overlay download, the image will appear and can be named and positioned on the map

NOTE: This API currently supports the following file types for Overlays:

  • PDF

  • PNG

  • SVG

Full Example

CadOverlay.update

Overview

Updates an existing overlay with a new file

Example Call

const newUrl = 'https://www.mysite.com/my-overlay-image.png';
// Configure any headers required by the download site
// NOTE: headers may not be needed if using a signed download url
const headers = {
  "Authorization": "Bearer mysecretbearertoken",
  "X-Custom": "custom-header-value-for-mysite",
};
const overlayId = 'Id of Existing Overlay'

// Call the update function
// NOTE: headers is optional (use `undefined` if not adding headers)
dronedeployApi.CadOverlay.update(newUrl, headers, overlayId);

// Example if not adding headers
dronedeployApi.CadOverlay.update(newUrl, undefined, overlayId);

Last updated