Skip to main content

Form Submission Events

LambpetCreated

Description

The LambpetCreated event is triggered when a Lambpet is created or submitted within the map application using the Maptaskr for Power Pages App. This event provides information about the Lambpet's ID and its JSON representation.

Usage

To listen for the LambpetCreated 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("LambpetCreated", function(id, lambpetJson) { 
console.log("id: " + id);

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

});

In the example above, we've registered an event listener for the LambpetCreated event. The provided call-back function is executed when the event occurs, logging the Lambpet's ID and its JSON representation to the console.

Parameters

  • id (string): The ID of the created Lambpet.
  • lambpetJson (string): The JSON representation of the created Lambpet.

Response Example

The lambpetJson returned will be a JavaScript Object in the format provided below (with some properties excluded for brevity)

{
"maptaskr*name": "Shape 1",
"maptaskr_parententityid" : "f1c9873a-5037-ee11-a81c-6045bd3f74bf",
"maptaskr_json" : {
"geometry*":null,
"fill*":{
"color*": "rgba(16, 12, 8, 0.5019607843137255)"
},
"image*":null,
"renderer*":null,
"hitDetectionRenderer*":null,
"stroke*":{
"color*": "rgba(16,12,8,1)",
"lineDash*":[],
"lineDashOffset*":null,
"width*":3
},
"text_":null
},
"maptaskr_ischild": true,
"maptaskr_longitude" : 152.6065402650001,
"maptaskr_latitude" : -25.366959556374926,
"<maptaskr_Account@odata.bind>" : "/accounts(f1c9873a-5037-ee11-a81c-6045bd3f74bf)"
}

Removing Event Listeners

To remove the event listener for the LambpetCreated 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("LambpetCreated"); 

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

AnnotationCreated

Description

The AnnotationCreated event is triggered when an annotation is created or submitted within the map application using the Maptaskr for Power Pages App. This event provides information about the annotation's ID and its JSON representation.

Usage

To listen for the AnnotationCreated 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("AnnotationCreated", function(id, annotationJson) { 

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

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

});

In the example above, we've registered an event listener for the AnnotationCreated event. When the event occurs, the provided call-back function is executed, logging the annotation's ID and its JSON representation to the console.

Parameters

  • id (string): The ID of the created annotation.
  • annotationJson (string): The JSON representation of the created annotation.

Response Example

The annotationJson returned will be a JavaScript Object in the format provided below (with some properties excluded for brevity)

{
"filename": "Shape 1",
"mimetype" : "geojson",
"documentbody": "eyJ0eXBlIjoiRmVhdHVyZUNvbGxlY3Rpb24iLCJmZWF0dXJlcyI6W3sidHlwZSI6IkZlYXR1cmUiLCJnZW9tZXRyeSI6eyJ0eXBlIjoiUG9seWdvbiIsImNvb3JkaW5hdGVzIjpbW1sxNjk4ODMyNi40NDAzNzQyOSwtMjkxOTkzMC4zMDcwMDAyMTMzXSxbMTY5ODgzNjcuODgzMjg0ODc4LC0yOTE5ODg3LjM0ODYwNTExOV0sWzE2OTg4Mzc3LjM3MzkzOTM5LC0yOTE5OTAzLjg2MTU3Mzk3MV0sWzE2OTg4NDAxLjQwNzAzODIwNCwtMjkxOTkyNC4zMDQ0NDQxMTE0XSxbMTY5ODg5MzYuMTU2OTI4OTE2LC0yOTIwNzMwLjQ5NTY1MzUyOF0sWzE2OTg3ODcwLjc5NjM0MDEzOCwtMjkyMTg4Mi44MjUxMTQ3MTcyXSxbMTY5ODcyMzcuMjMyMzY3NTk0LC0yOTIxMjg5Ljc5MzE5NTEzN10sWzE2OTg3MjMwLjA4NDQzMTc3LC0yOTIxMTg2LjU2NDkyNzk0NV0sWzE2OTg3MjI4LjU1MTExNzEwNywtMjkyMTExOC4xOTM0MDg4MzQ3XSxbMTY5ODgyODkuMzcyNDMxMDE0LC0yOTE5OTcwLjQxMTU2Nzg4NDVdLFsxNjk4ODMyNi40NDAzNzQyOSwtMjkxOTkzMC4zMDcwMDAyMTMzXV1dfSwicHJvcGVydGllcyI6eyJ1cGxvYWREb2NUeXBlIjoiU2hhcGUgMSIsIm1hcmtlclR5cGUiOiJGSUxFU19MQVlFUiIsIm1lYXN1cmVtZW50VGV4dCI6IkFyZWE6IDEzNS41NSBIYSJ9fV0sIkRvY3VtZW50VHlwZSI6IlNoYXBlIDEiLCJsb25nbGF0IjpbMTUyLjYwNjU0MDI2NTAwMDEsLTI1LjM2Njk1OTU1NjM3NDkyNl0sInN0eWxlUHJvcGVydHkiOnsiZ2VvbWV0cnlfIjpudWxsLCJmaWxsXyI6eyJjb2xvcl8iOiJyZ2JhKDE2LCAxMiwgOCwgMC41MDE5NjA3ODQzMTM3MjU1KSJ9LCJpbWFnZV8iOm51bGwsInJlbmRlcmVyXyI6bnVsbCwiaGl0RGV0ZWN0aW9uUmVuZGVyZXJfIjpudWxsLCJzdHJva2VfIjp7ImNvbG9yXyI6InJnYmEoMTYsMTIsOCwxKSIsImxpbmVEYXNoXyI6W10sImxpbmVEYXNoT2Zmc2V0XyI6bnVsbCwid2lkdGhfIjozfSwidGV4dF8iOm51bGx9fQ==",
"objecttypecode" : "maptaskr_lambpet",
"subject" : "Shape 1",
"<objectid_maptaskr_lambpet@odata.bind>": "/maptaskr_lambpets(fa5791fa-7450-ee11-be6f-002248e1d582)"
}

Removing Event Listeners

To remove the event listener for the AnnotationCreated 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("AnnotationCreated"); 

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

OriginalFileUploaded

Description

The OriginalFileUploaded event is triggered when an original file is uploaded or submitted within the map application using the Maptaskr for Power Pages App. This event provides information about the file's ID and its GeoJSON representation.

Usage

To listen for the OriginalFileUploaded 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("OriginalFileUploaded", function(id, geoJson) { 

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

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

});

In the example above, we've registered an event listener for the OriginalFileUploaded event. The provided call-back function is executed when the event occurs, logging the file's ID and its GeoJSON representation to the console.

Parameters

  • id (string): The ID of the uploaded file.
  • geoJson (string): The GeoJSON representation of the uploaded file.

Response Example

The geoJson returned will be a JavaScript Object in the format provided below (with some properties excluded for brevity)

{
"filename": "Shape 1.zip",
"mimetype" : "application/x-zip-compressed",
"documentbody": "UEsDBBQAAAAAAANhO1VQPMKBDgUAAAAFAAAADwAAAFByb2plY3RBcmVhLmNwZ1VURi04UEsDBBQAAAAIAANhO1VXJsO7IcOFAAAAwqQCAAAPAAAAUHJvamVjdEFyZWEuZGJmY8Kuw6LClGZkYGBQZGwCURjDgMOHPwTDhnQGEcKsaMOyAT7Cjn7DiMOyXGjDssKOw47DjsOxw47Dvi7CrjB5DTR5w7/DuGAPw4cAw5d...",
"objecttypecode" : "account",
"<objectid_account@odata.bind>" : "/accounts(f1c9873a-5037-ee11-a81c-6045bd3f74bf)"
}

Removing Event Listeners

To remove the event listener for the OriginalFileUploaded 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("OriginalFileUploaded"); 

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

LambpetDeleted

Description

The LambpetDeleted event is triggered when a Lambpet is deleted within the map application using the Maptaskr for Power Pages App. This event provides information about the deleted Lambpet's ID.

Usage

To listen for the LambpetDeleted 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("LambpetDeleted",
function(id) {

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

});

In the example above, we've registered an event listener for the LambpetDeleted event. When the event occurs, the provided call-back function is executed, logging the ID of the deleted Lambpet to the console.

Parameters

  • id (string): The ID of the deleted Lambpet.

Removing Event Listeners

To remove the event listener for the LambpetDeleted 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(" LambpetDeleted"); 

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