Skip to main content

Layer Attribute Events

FeatureRowClicked​

Description​

The FeatureRowClicked event is triggered when a user clicks on a feature row within a layer attribute table on a Dashboard or Record Level Maptaskr Map. This event provides information about the clicked feature's ID and geometry.

Usage​

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

Example​

window.top['maptaskrCORE'][controlId].on("FeatureRowClicked", function(id, geometry) {
console.log("id: " + id);
console.log("geometry: " + geometry);
});

In the example above, we've registered an event listener for the FeatureRowClicked event. The provided call-back function is executed when the event occurs, logging the clicked feature's ID and geometry to the console.

Parameters​

  • id (string): The ID of the clicked feature.
  • geometry (string): The geometry information of the clicked feature.

Response Example​

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

{
"paths": [
[
[
152.951965843402,
-27.559003020827
],
[
152.952433438347,
-27.5590516415601
]
]
]
}

Removing Event Listeners​

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

Example​

window.top['maptaskrCORE'][controlId].off("FeatureRowClicked");

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

FeatureRowsSelected​

Description​

The FeatureRowsSelected event is triggered when a user selects one or more feature rows within a layer attribute table on a Dashboard or Record Level Maptaskr Map. This event provides information about the selected feature's ID.

Usage​

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

Example​

window.top['maptaskrCORE'][controlId].on("FeatureRowsSelected", function(id, checked) {
console.log("id: " + id);
console.log("checked: " + checked);

});

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

Parameters​

  • id (string): The ID of the selected feature.
  • checked (boolean): If the feature is checked or unchecked.

Removing Event Listeners​

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

Example​

window.top['maptaskrCORE'][controlId].off("FeatureRowsSelected");

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

SelectedFeaturesHighlightedOnMap​

Description​

The SelectedFeaturesHighlightedOnMap event is triggered when selected features are highlighted on a Dashboard or Record Level Maptaskr Map. This event provides information about the highlighted feature's ID and geometry.

Usage​

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

Example​

window.top['maptaskrCORE'][controlId].on("SelectedFeaturesHighlightedOnMap", function(id, geometry) {
console.log("id: " + id);
console.log("geometry: " + geometry);
});

In the example above, we've registered an event listener for the SelectedFeaturesHighlightedOnMap event. The provided call-back function is executed when the event occurs, logging the highlighted feature's ID and geometry to the console.

Parameters​

  • id (string): The ID of the highlighted feature.
  • geometry (string): The geometry information of the highlighted feature.

Response Example​

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

[
{
"extent": "15248357.277396044,-3988917.2955298205,15352708.613343623,-3864670.5161639843",
"geometry": {
"geometry": "15248891.276102826,-3988614.090329052,15248892.277087683,-3988666.2742443234,15248887.379030092,-3988735.7194938106,15248882.594963657,-3988765.825602797,15248840.18312822,-3988859.223859193,15248773.836711707,-3988912.3446107856,15248747.89659868,-3988916.4934807913,15248728.863637427,-3988917.2955298205,15248693.572687175,-3988913.282809781,15248679.548212448,-3988909.80231469,15248676.32083777,-3988908.7329166974,15248592.3841606,-3988866.8507156074,15248515.016223941,-3988760.7410759795,15248490.639927128,-3988737.9944058843,15248432.753791915,-3988692.501200734,15248360.83961975,-3988658.914864661,15248357.277396044,-3988645.535311624,15248359.724643728,-3988638.175945241,15248375.64422147,-3988605.9289554274,15248387.556297543,-3988595.089214614,15248480.063684946,-3988539.0267035705,15248510.342586443,-3988510.3915596786,15248546.744950488,-3988436.7989730537,15248552.198714979,-3988345.948794903,15248555.650509752,-3988325.3416327126,15248557.096772576,-3988319.18795757,15248565.332633784,-3988309.4203045922,15248596.947369168,-3988307.279145076,15248626.114856865,-3988330.292298937,15248645.151380349,-3988438.672818123,15248648.713604053,-3988457.0028512,15248660.622117903,-3988490.1875876985,15248752.684227342,-3988649.013251296,15248778.175500179,-3988676.3095445973,15248808.789250702,-3988682.5995584377,15248818.585365893,-3988677.3789209705,15248820.811755707,-3988673.6336286957,15248826.710798163,-3988556.0177147784,15248831.277568955,-3988543.841315925,15248852.316062156,-3988522.033242089,15248875.805365272,-3988525.5111443945,15248885.487489304,-3988533.672460912,15248889.829839997,-3988551.871450244,15248891.276102826,-3988614.090329052",
"type": "Polygon"
},
"attributes": {}
}]

Removing Event Listeners​

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

Example​

window.top['maptaskrCORE'][controlId].off("SelectedFeaturesHighlightedOnMap");

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

FeaturesFilteredByPolygon​

Description​

The FeaturesFilteredByPolygon event is triggered when features are filtered by a polygon on a Dashboard or Record Level Maptaskr Map. This event provides information about the filter polygon and the resulting feature.

Usage​

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

Example​

window.top['maptaskrCORE'][controlId].on("FeaturesFilteredByPolygon", function(filterPolygon, resultFeature) {
console.log("filterPolygon: " + filterPolygon);
console.log("resultFeature: " + resultFeature);
});

In the example above, we've registered an event listener for the FeaturesFilteredByPolygon event. The provided call-back function is executed when the event occurs, logging the filter polygon and the resulting feature to the console.

Parameters​

  • filterPolygon (string): The polygon used for filtering features.
  • resultFeature (string): The resulting feature that matches the filter.

Response Example​

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

{
"extent": "16285967.281465383,-4638658.698342794,17017218.747868977,-3812439.5090296417",
"geometry": {
"geometry": "16304960.826047294,-3964387.865684934,16285967.281465383,-4638658.698342794,16903257.48037751,-4610168.381469927,17017218.747868977,-3812439.5090296417,16304960.826047294,-3964387.865684934",
"type": "Polygon"
},
"attributes": {}
}

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

[
{
"extent": "16353033.976041937,-4258126.432256523,16584924.064146778,-4081936.6934020626",
"geometry": {
"geometry": "16584924.064146778,-4194215.8205637066,16353033.976041937,-4258126.432256523,16419414.757793356,-4081936.6934020626,16584924.064146778,-4194215.8205637066",
"type": "Polygon"
},
"attributes": {}
},
{
"extent": "16527052.31547921,-4545464.00191358,16672411.656706253,-4198235.886020177",
"geometry": {
"geometry": "16584867.943882221,-4198235.886020177,16672411.656706253,-4545464.00191358,16527052.31547921,-4478925.5687913485,16584867.943882221,-4198235.886020177",
"type": "Polygon"
},
"attributes": {}
},
{
"extent": "16604577.824962063,-4208878.32517417,16877565.654802185,-4017740.3699756954",
"geometry": {
"geometry": "16604577.824962063,-4193191.11802936,16798639.64578343,-4017740.3699756954,16877565.654802185,-4208878.32517417,16604577.824962063,-4193191.11802936",
"type": "Polygon"
},
"attributes": {}
}
]

Removing Event Listeners​

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

Example​

window.top['maptaskrCORE'][controlId].off("FeaturesFilteredByPolygon");

FilterReset​

Description​

The FilterReset event is triggered when a filter is reset on a Dashboard or Record Level Maptaskr Map.

Usage​

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

Example​

window.top['maptaskrCORE'][controlId].on("FilterReset", function() {
// Your call-back logic here
});

In the example above, we've registered an event listener for the FilterReset event. When the event occurs, the provided call-back function is executed.

Parameters​

This event does not have any parameters.

Removing Event Listeners​

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

Example​

window.top['maptaskrCORE'][controlId].off("FilterReset");

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

TableFilter​

Description​

The TableFilter event is triggered when the layer attribute table is filtered using a keyword or search term on a Dashboard or Record Level Maptaskr Map. This event provides information about the applied filter keyword.

Usage​

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

Example​

window.top['maptaskrCORE'][controlId].on("TableFilter", function(filterParams, filteredResults) {
console.log("filterParams: " + filterParams);
console.log("filteredResults: " + filteredResults);
});

In the example above, we've registered an event listener for the TableFilter event. The provided call-back function is executed when the event occurs, logging the applied filter keyword to the console.

Parameters​

  • filterParams (string): The information about the filter parameters used.
  • filteredResults (string): The results after applying the filter.

Removing Event Listeners​

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

Example​

window.top['maptaskrCORE'][controlId].off("TableFilter");

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

SelectedFeaturesExportedToCSV​

Description​

The SelectedFeaturesExportedToCSV event is triggered selected attributes from the attribute table are exported to CSV on a Dashboard or Record Level Maptaskr Map. This event provides the JSON Objects that are output to the CSV file.

Usage​

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

Example​

window.top['maptaskrCORE'][controlId].on("SelectedFeaturesExportedToCSV", function(csvData) {
console.log("csvObjects: " + csvData);
});

In the example above, we've registered an event listener for the TableFilter event. The provided call-back function is executed when the event occurs, logging the applied filter keyword to the console.

Parameters​

  • csvData (string): A stringified JSON object containing the data to be exported.

Removing Event Listeners​

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

Example​

window.top['maptaskrCORE'][controlId].off("SelectedFeaturesExportedToCSV");

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