Hi All,
Just upgraded from 4.22 to 4.23 and this setting the BaseMap Gallery widget active basemap using basemapGallery.activeBasemap = 'hybrid' (for example) fails with an error:
Uncaught TypeError: Cannot read properties of undefined (reading 'spatialReference')
I assume this has to to with the addition of allowing basemaps to have different spatial references in 4.23 but I can't seem to find and documentation on this particular issue.
Any help would be great.
Thanks.
Solved! Go to Solution.
Hi @MichaelSnook - thanks for reporting this! We're working on a fix for this bug.
In the meantime, you can set the basemap directly on the map, and the activeBasemap in the BasemapGallery will update:
view.map.basemap = "hybrid";
Hi @MichaelSnook - thanks for reporting this! We're working on a fix for this bug.
In the meantime, you can set the basemap directly on the map, and the activeBasemap in the BasemapGallery will update:
view.map.basemap = "hybrid";
Easy fix...thanks! Although, not a huge deal but, the widget doesn't seem to show the new base map as the 'active' one (there's no blue indicator or highlight for the basemap)...it does switch fine though.
That seems to be a bug as well - we've fixed both of these issues for version 4.24. You can try these fixes out ahead of the release with the https://js.arcgis.com/next version of the API. Let us know if you are still running into any issues. Thanks!