Tutorial

Tutorial - Get search results

Mapapps
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.

Read more detailed information in the referenced API documentation:

searchUpdate API reference
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", {})