I use Map.setBasemap function to change the basemap. The basemap is changed, but it changes back to the default if I pan and zoom out the map. Is there a way to solve it, instead of use basemap gallery?
Thanks in advance,
li
Thanks for your quick response.
There is not much code at all.
I declare a function and use a menu item to pass basemap name. That's it.
It seems to me that the default map object doesn't get swopped.
var selectBasemap = function(basemapId) {
if (cwiMap.map.getBasemap() != basemapId) {
cwiMap.map.setBasemap(basemapId);
}
};
Regards,
My bad. I reset the default according to the current extent and forgot it.
Can you show us your code? It is hard to trouble shoot without seeing any code.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.