Trouble switching from blank basemap

Discussion created by andyj513 on Jun 11, 2014
In addition to the standard basemaps, I want to give the users a choice of a "Blank" basemap. I've added a "Blank" option to the gallery like this:

basemapGallery.add(new esri.dijit.Basemap({layers: [], title: "Blank"}));

Also, I've added my data to the map with map.addLayer(). The above works, and my data shows up on the map, and the user can switch between all the basemaps, etc.

The problem is that if they choose the "Blank" basemap, it correctly still shows the data with no map images. BUT if they then choose another basemap from the menu, the new basemap correctly appears, but my data no longer shows up (until I call addLayer() again - which is not needed for any of the other layers).

Is there a better way to add a Blank basemap?