Skip to main content

Exposed Events

This section includes information about events related to the DAS Embed Map Component. It emits custom save and error events to notify your app of key actions and errors within the component. You can set up listeners for these events to respond appropriately.

Example Usage

document.querySelector("#das-map").addEventListener("save", (event) => {
// event.detail.cadastres - {title: string}[]
// event.detail.totalArea - number (in Ha)
// event.detail.dasFarmId - string
});

Save Event

The Save Event is triggered upon the successful completion of a saving operation. Use this event to process farm information within your application.

Event Data

{
"totalArea": "number",
"cadastres": {
"title": "string"
},
"dasFarmId": "string",
"embedFarmId": "string",
"farmName": "string",
"clientId": "string"
}
  • totalArea — total area of selected cadastres (in Ha).
  • cadastres — array containing the titles of selected cadastres.
  • dasFarmId — unique DAS identifier for the farm. embedFarmId carries the same value and is deprecated; use dasFarmId instead.
  • farmName — name of the saved farm.
  • clientId — client identifier in your system (optional).

Error Event

The Error Event is triggered when the embedFarmId doesn't match an existing DAS ID or any other error occurs within the DAS Embed Map Component. This allows you to log or handle errors as needed.

Event Data

{
"code": "string",
"error": "string"
}
  • code — error code identifying the type of issue (e.g., "404", "500", "INVALID_INPUT").
  • error — detailed error message.