This basic example shows/hides elements identified by a css-identifier.
Read more detailed information in the referenced API documentation:
setElementVisibility API reference
To use the function as seen in the example, use following code:
function postEvent(functionName, detail) {
const integrationElement = document.getElementById('mapIntegrationElement').contentWindow
if(integrationElement){
integrationElement.postMessage({functionName: functionName, detail: detail}, "*")
}
}
[...]
// Hide the searchbar
postEvent("setElementVisibility", {mode: "hide", cssClass: "ct-omnisearch" } )
// Show the searchbar
postEvent("setElementVisibility", {mode: "show", cssClass: "ct-omnisearch" } )