Hi,
I'm currently working on a dark mode feature in ArcGIS Experience Builder (ExB) Developer that automatically changes the basemap. I've also integrated a basemap gallery widget within the map widget to provide more basemap options. Selecting a basemap from the gallery and toggling between dark modes works fine, however, there's an issue when toggling dark mode directly: the basemap gallery widget shows no basemap as selected.
Case 1:
Select a light mode basemap from the basemap gallery.
Select a dark mode basemap from the basemap gallery aswell.
Toggle dark mode.
In this case, everything works well and the correct basemap is shown in the gallery.
Case 2:
Directly toggle dark mode.
In this scenario, no basemap is selected in the basemap gallery widget.
I believe the issue could be due to one of the following reasons:
Here's the code I use to change the basemap. The change is reflected on the webpage, but the basemap gallery widget shows nothing selected:
const basemapSource = darkBasemap
? await getBasemapSource(darkBasemap)
: mapViewOriginalBasemaps.current[currentJimuMapViewId.current];
if (basemapSource && bmViewModel?.current?.activeBasemap) {
bmViewModel.current.set('activeBasemap', basemapSource)
Any help on resolving this issue would be greatly appreciated.
Thank you!
Solved! Go to Solution.
I managed to solve it.
I managed to solve it.