There is not too much documentation about it but it is possible. Just include the class "esri/config" and add your custom maps similar like:
require([
"esri/map",
"esri/dijit/BasemapToggle",
"esri/config",
"dojo/domReady!"
], function(
Map, BasemapToggle, esriConfig
) {
esriConfig.defaults.map.basemaps.delorme = {
baseMapLayers: [
{ url: "http://services.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer" }
],
title: "Delorme"
};
Next you can include it into your BasemapToogle class as follow:
toggle = new BasemapToggle({
map: map,
basemap: "delorme",
basemaps: {
delorme: {
label: "delorme",
url: "http://www.delorme.com/images/homepage/dbm_icon.jpg"
}, topo: {
label: "topo",
url: "http://js.arcgis.com/3.7/js/esri/dijit/images/basemaps/topo.jpg"
}
}
}, "BasemapToggle");
toggle.startup();
That's it, if you want to see a working demo go to jsbin: http://jsbin.com/iFakeLa/1I saw this solution of couple of days written by Derek Swingley at http://gis.stackexchange.com/questions/74154/how-to-use-custom-basemaps-with-basemaptoggle-widgetI hope it helps!!!Best,Ernesto GironGIS/RS Analyst/Developer/Consultanthttp://ernestogiron.blogspot.com