Hi,
I have added a custom basemap to the basemap gallery. I am using Arcgis JavaScript 4
this.basemapGallery = new BasemapGallery({
view: this.map.mapView,
container: this.basemapGalleryDiv,
source: {
query: {
title: "Custom Basemap",
},
updateBasemapsCallback: (items) => {
if (this.customBasemap) {
items.push(this.customBasemap);
}
console.log(items);
return items;
// return items;
}
}
});
I can see the basemap gallery with custom basemap.but it works only on first click. When I go to any other basemap and comes back to the custom basemap, the basemap does not load. Any idea why its not working as expected?
Thanks
Aditya Kumar
Solved! Go to Solution.
HI there,
I just tested your code snippet with JS API version 4.25 and was not able to reproduce the behavior you described. Here is the codepen: https://codepen.io/U_B_U/pen/OJOVKyP?editors=1000
HI there,
I just tested your code snippet with JS API version 4.25 and was not able to reproduce the behavior you described. Here is the codepen: https://codepen.io/U_B_U/pen/OJOVKyP?editors=1000