Is there a way to have an event triggered when the Expand widget actually expand or collaspe ?
I would like to show or hide a DistanceMeasurement2D on the map accordingly.
Thanks.
Solved! Go to Solution.
This can be easily achieved using the watch function of the widget and the expanded state.
const bgExpand = new Expand({
view: view,
content: basemapGallery
});
// create a watch to trigger an event whenever expanded value changes.
bgExpand.watch("expanded", (expanded) => {
console.log(expanded);
});
This can be easily achieved using the watch function of the widget and the expanded state.
const bgExpand = new Expand({
view: view,
content: basemapGallery
});
// create a watch to trigger an event whenever expanded value changes.
bgExpand.watch("expanded", (expanded) => {
console.log(expanded);
});