Daar users,
in my application I have a map-div and a "layer-selection-span":
<div id="viewDiv">
</div>
<span id="layerToggle">
<input type="checkbox" id="kanalLyr" checked> Kanal
</span>
Furthermore I use an Expand to show the BaseMapGallery:
var basemapGallery = new BasemapGallery({
view: view,
source: initBasemap,
container: document.createElement("div")
});
var bgExpand = new Expand({
view: view,
expandTooltip: "Basiskarten",
content: basemapGallery
});
view.ui.add(bgExpand,{
position: 'bottom-left',
});
I try to find a solution that the
span id="layerToggle" is not visible anymore, if I open the BasemapGallery (and that it is visible, if I close the BaseMapGallery).
I tried things like:
bgExpand.addEventListener("click",event=>{
....
});
or:
bgExpand.on("click", function(event){
....
});
...but without success. Can anybody help please? How can I start a function after clicking on the Expand-Button?