map1 = new Map("map1", { basemap: "topo", center: [-105.255, 40.022], zoom: 3 });
Hi Ekaitz,Welcome to Esri Forum! Thank you for posting your question here.I looked at our Basemap gallery sample, and you are correct, the map.getBasemap() returns the same basemap that the map was initialized with (e.g. "topo").I think what you need to do to return the basemap from the basemap gallery widget is to use the getSelected() method.Here is a code snippet that should work for that. dojo.connect(basemapGallery,"onSelectionChange",function(){ var basemap = basemapGallery.getSelected(); alert(basemap.title); }); Hope this helps!-Noah
dojo.connect(basemapGallery,"onSelectionChange",function(){ var basemap = basemapGallery.getSelected(); alert(basemap.title); });
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.