Layer Events
LayerAdded
The LayerAdded event is triggered when a user applies a filter to a layer on a Dashboard or Record Level Map. This event provides information about the filter parameters.
Parameters:
layerId(string): The ID of the layer added.
Usage:
control.on("LayerAdded", (layerId) => {
console.log(layerId);
});
Response
{
"layerId": "5d47702b-1bef-45d1-a58b-fa5f1b3e90e2"
}
Removing Event Listeners:
control.off("LayerAdded");
LayerFilterApplied
The LayerFilterApplied event is triggered when a user applies a filter to a layer on a Dashboard or Record Level Map. This event provides information about the filter parameters.
Parameters:
layerId(string): The ID of the layer.subLayerId(string): The ID of the sublayer.filterGroup(object): The filter group applied.instanceId()
Usage:
control.on("LayerFilterApplied", (layerId, subLayerId, filterGroup, instanceId) => {
console.log(layerId, subLayerId, filterGroup, instanceId);
});
Response
{
"layerId": "690f104b-cef8-4142-834c-a5235b9f766f",
"subLayerId": "5d47702b-1bef-45d1-a58b-fa5f1b3e90e2",
"filterGroup": {
"filters": [
{
"type": "ui",
"matchType": "all",
"expressions": [
{
"field": "new_assetname",
"operator": "equals",
"value": "name"
}
]
},
{
"type": "layer",
"matchType": "all",
"expressions": []
},
{
"type": "config",
"expressions": [
{
"field": "_new_siteid_value",
"operator": "equals",
"value": "{{id}}"
}
],
"matchType": "all"
},
{
"type": "search",
"matchType": "any",
"expressions": []
}
]
},
"instanceId": "5381a989-ddff-4837-a2c3-b92ce260999f"
}
Removing Event Listeners:
control.off("LayerFilterApplied");