Search Events
SearchExecuted
The SearchExecuted event is triggered when a user initiates a search for a specific address on a Dashboard or Record Level Maptaskr Map. This event provides information about the searched text.
Usage:
control.on("SearchExecuted", (term) => {
  console.log(term);
});
Response
{
	"term":"Perth"
}
Removing Event Listeners:
To remove the event listener for the SearchExecuted event, you can use the off method of the globalThis object. This is useful when you no longer want to listen for this specific event.
control.off("SearchExecuted");
SearchResultsFound
The SearchResultsFound event is triggered when a user initiates a search for a specific address, region, layer or feature on a Dashboard or Record Level Maptaskr Map. This event provides information about the searched text.
Parameters:
groupName(string): The group name for the search results.results(array): The array of search results.
Usage:
control.on("SearchResultsFound", (groupName, results) => {
  console.log(groupName, results);
});
Response
	Regions [
		{
			"Title": "Perth, Scotland",
			"Address": {
				"CompositeAddress": "Perth, Scotland",
				"Unit": "",
				"Street": "",
				"Suburb": "",
				"City": "Perth",
				"State": "Scotland",
				"Zip": "",
				"Country": "United Kingdom"
			},
			"Extent": {
				"xmin": -3.476900169,
				"xmax": -3.400900169,
				"ymin": 56.357462405,
				"ymax": 56.433462405,
				"zmax": 0,
				"zmin": 0,
				"spatialReference": {
					"wkid": 4326
				}
			},
			"Geometry": {
				"type": "Polygon",
				"coordinates": [
					[
						[
							-3.476900169,
							56.357462405
						],
						[
							-3.400900169,
							56.357462405
						],
						[
							-3.400900169,
							56.433462405
						],
						[
							-3.476900169,
							56.433462405
						],
						[
							-3.476900169,
							56.357462405
						]
					]
				]
			}
		},
	]
	Addresses [
		{
			"Title": "Perth, Perth and Kinross, Scotland, GBR",
			"Address": {
				"CompositeAddress": "Perth, Perth and Kinross, Scotland, GBR",
				"Unit": "",
				"Street": "Perth",
				"Suburb": "Perth and Kinross",
				"City": "Perth",
				"State": "Scotland",
				"Zip": "",
				"Country": "United Kingdom"
			},
			"Extent": {
				"xmin": -3.438900169,
				"xmax": -3.438900169,
				"ymin": 56.395462405,
				"ymax": 56.395462405,
				"zmin": 0,
				"zmax": 0,
				"spatialReference": {
					"wkid": 4326
				}
			},
			"Geometry": {
				"type": "Point",
				"coordinates": [
					-3.438900169,
					56.395462405
				]
			}
		}
	]
Removing Event Listeners:
control.off("SearchResultsFound");
RecordAddressSet
The RecordAddressSet event is triggered when a user initiates a search for a specific address, region, layer or feature on a Record Level Maptaskr Map. This event provides information about the searched text.
Parameters:
searchResult(object): The search result used to set the address.
Usage:
control.on("RecordAddressSet", (searchResult) => {
  console.log(searchResult);
});
Response
{
    "Title": "Perth, Western Australia, AUS",
    "Address": {
        "CompositeAddress": "Perth, Western Australia, AUS",
        "Unit": "",
        "Street": "Perth",
        "Suburb": "",
        "City": "Perth",
        "State": "Western Australia",
        "Zip": "",
        "Country": "Australia"
    },
    "Extent": {
        "xmin": 115.859485122,
        "xmax": 115.859485122,
        "ymin": -31.954242831,
        "ymax": -31.954242831,
        "zmin": 0,
        "zmax": 0,
        "spatialReference": {
            "wkid": 4326
        }
    },
    "Geometry": {
        "type": "Point",
        "coordinates": [
            115.859485122,
            -31.954242831
        ]
    }
}
Removing Event Listeners:
control.off("RecordAddressSet");