We handle this in the basic viewer template by doing the following:1. When a new basemap is selected from the basemap gallery destroy the overview map:dojo.connect(basemapGallery, "onSelectionChange", function () {
//close the basemap window when an item is selected
//destroy and recreate the overview map - so the basemap layer is modified.
destroyOverview();
dijit.byId('basemapBtn').closeDropDown();
});
2. The destroy overview map function destroys the existing overview map and recreates so its using the new basemap layer: function destroyOverview(){
var ov = dijit.byId('overviewMap');
if(ov){
var vis = ov.visible;
ov.destroy();
addOverview(vis);
}
}
Here's the code that creates the overview map function addOverview(isVisible) {
var overviewMapDijit = new esri.dijit.OverviewMap({
map: map,
attachTo: "top-right",
opacity: 0.5,
color: "#000000",
expandfactor: 2,
maximizeButton: false,
visible: isVisible,
id:'overviewMap'
});
overviewMapDijit.startup();
}
Basic Viewer Template Testhttp://apps.arcgis.com/hosted/OnePane/basicviewer/index.html?appid=51cd7d314e3d4e57a1e28b1b5698abd0&...