This tutorial describes how to subscribe to search results. Press the button below to subscribe
to the search event. After you send a search request from the map, you will get the search result
as an event.
result:
To use the function as seen above, use the following code.
// Get the feature attributes:
window.addEventListener(
"message",
(evt) => {
const functionName = evt.data.functionName
if(functionName === "searchUpdate"){
// your custom action
}
},
false
);
// activate search result watch
const integrationElement = document.getElementById('mapIntegrationElement').contentWindow
if(integrationElement){
integrationElement.postMessage({functionName: functionName, detail: detail}, "*")
}
postEvent("searchUpdate", {})