I am trying to get the current basemap after user selection, in the sandbox provided by ArcGIS, sandbox link.
I added a piece of code:
basemapGallery.on("selection-change", function() {
alert("Here!");
});
It doesn't seem to work anymore. "Here" wasn't triggered when I switched basemaps. And no error messages show up.
Perhaps something changed from ArcGIS for Javasript 3.X to 4, since all answers I found online are working well on 3.20 or before. But no answer on version 4.4 was given.
Also it would be better to teach me how to make it work combined with the expand widget. sandbox link.