Hi nsager, thank you for you reply.I tried out with that method before, however the problem that is returning different title that the title that I need in map.setBasemap("topo"). The problem is that title is "Topograpich" instead "Topo" that is the method that I need in setBasemap or when you need create a new map like here:
map1 = new Map("map1", {
basemap: "topo",
center: [-105.255, 40.022],
zoom: 3
});
Do you know what I am trying to say?Thank youHi 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