Skip to main content

General Events

ErrorOccured

Description

The ErrorOccured event is triggered when an error occurs within the map application using the Maptaskr for Power Pages App. This event provides information about the error message and error details.

Usage

To listen for the ErrorOccured event, you can use the on method of the window['maptaskrPCF'] object. This allows you to register an event listener that executes a call-back function when the event is triggered.

Example

window['maptaskrPCF'].on("ErrorOccured", function(errMessage, errDetails) { 

console.log("errMessage: " + errMessage);

console.log(" errDetails: " + errDetails);

});

In the example above, we've registered an event listener for the ErrorOccured event. When the event occurs, the provided call-back function is executed, logging the error message and error details to the console.

Parameters

  • errMessage (string): The error message.
  • errDetails (object): Additional details about the error (may be undefined).

Removing Event Listeners

To remove the event listener for the ErrorOccured event, you can use the off method of the window['maptaskrPCF'] object. This is useful when you no longer want to listen to this specific event.

Example

window['maptaskrPCF'].off(" ErrorOccured"); 

In the example above, the event listener for ErrorOccured is removed, ensuring that the associated call-back function no longer executes when the event is triggered.

WarningOccured

Description

The WarningOccured event is triggered when a warning message is generated within the map application using the Maptaskr for Power Pages App. This event provides information about the warning message and warning details.

Usage

To listen for the WarningOccured event, you can use the on method of the window['maptaskrPCF'] object. This allows you to register an event listener that executes a call-back function when the event is triggered.

Example

window['maptaskrPCF'].on("WarningOccured",
function(warningMessage, warningDetails) {

console.log("warningMessage: " + warningMessage);

console.log(" warningDetails: " + warningDetails);

});

In the example above, we've registered an event listener for the WarningOccured event. The provided call-back function is executed when the event occurs, logging the warning message and warning details to the console.

Parameters

  • warningMessage (string): The warning message.
  • warningDetails (object): Additional details about the warning (may be undefined).

Removing Event Listeners

To remove the event listener for the WarningOccured event, you can use the off method of the window['maptaskrPCF'] object. This is useful when you no longer want to listen to this specific event.

Example

window['maptaskrPCF'].off(" WarningOccured"); 

In the example above, the event listener for WarningOccured ismremoved, ensuring that the associated call-back function no longer executes when the event is triggered.

HelpTextOccurred

Description

The HelpTextOccurred event is triggered when a help text message is displayed within the map application using the Maptaskr for Power Pages App. This event provides information about the help text message.

Usage

To listen for the HelpTextOccurred event, you can use the on method of the window['maptaskrPCF'] object. This allows you to register an event listener that executes a call-back function when the event is triggered.

Example

window['maptaskrPCF'].on("HelpTextOccurred",
function(helpTextMessage) {

console.log("helpTextMessage: " + helpTextMessage);

});

In the example above, we've registered an event listener for the HelpTextOccurred event. When the event occurs, the provided call-back function is executed, logging the help text message to the console.

Parameters

  • helpTextMessage (string): The help text message.

Removing Event Listeners

To remove the event listener for the HelpTextOccurred event, you can use the off method of the window['maptaskrPCF'] object. This is useful when you no longer want to listen to this specific event.

Example

window['maptaskrPCF'].off(" HelpTextOccurred");  

In the example above, the event listener for HelpTextOccurred is removed, ensuring that the associated call-back function no longer executes when the event is triggered.