I want to get a function or a variable into a .html code from a javascript code. I have to toggle layers of a map made on mapbox in a wix site. Have this click event that changes a bool in javascript:
$w('#au').onClick((event) =>{
if(isMatch)
{
$w('#img').hide();
$w('#Basic').hide();
isMatch = false;
}
else{
$w('#img').show();
$w('#Basic').show();
isMatch = true;
}
});
Now I want to get this bool, or any another variable or function, and use it as a condition inside my .html, which is like this:
<script>
mapboxgl.accessToken = 'pk.eyJ1Ijoiam9hb3BlZHJvdmdhIiwiYSI6ImNreGtqMHZxZTJwcTIzMHB6Y2lnMm00czkifQ.auBfiQMlyayVxRlHCPuPkQ'
;
const map = new mapboxgl.Map ({
container: 'map',
style: 'mapbox://styles/joaopedrovga/ckxkj2aon1xh314me52nin8w8'
});
map.on('idle', () => {
"HERE I WANT TO CALL THE FUNTION OR GET THE VARIABLE"
map.setLayoutProperty('water', 'visibility', 'none');
});