Right.I create my basemap, then call a method (sorry devs) called "hideDumbLayers", which hides (but does not remove because it breaks the gallery) the layers I do not want to show. The problem with this is "new exciting layers" show up automagically, and i do not want that. So everytime a new layer is added I have to hardcode and remove itI no londer do this its in an old version of our app, we moved away from the gallery completely due to inability to control its contents hideDumbLayers: function(){
//if created
if(dojo.byId("galleryNode_basemap_0")){
//find current layer
for(var j = 0; j < this.map.layerIds.length; j++) {
var layer = this.map.getLayer(this.map.layerIds);
if(layer.visible==true&&dojo.indexOf(this.mcgisBasemaps,layer.id)>-1){
if(layer.id=="Base Map"){
this.initBasemap="MCGIS Base Map";
}else{
this.initBasemap=layer.id;
}
}
}
var dumbBasemapIds=[];
var ids={};
var galleryContainer=dojo.byId("galleryNode_basemap_0").parentNode;
dojo.forEach(galleryContainer.childNodes, dojo.hitch(this, function(galleryItem){
if(galleryItem.childNodes[1]){
var title = galleryItem.childNodes[1].childNodes[0].title;
if(title==="Oceans"||title==="Light Gray Canvas"||title==="Relief with Labels"||title==="Terrain"||title==="Terrain with Labels"||title==="Shaded Relief"){
dumbBasemapIds.push(galleryItem.id);
}else{
ids[title]=galleryItem.id;
if(title==this.initBasemap){
this.baseMapGallery.select(ids[title].replace("galleryNode_",""));
dojo.addClass(dojo.byId(ids[title]), "esriBasemapGallerySelectedNode");
}
}
}}));
this.layerIds=ids;
dojo.forEach(dumbBasemapIds, dojo.hitch(function(id){
dojo.style(dojo.byId(id), "display", "none");
}));
}else{
setTimeout(dojo.hitch(this, function() { this.hideDumbLayers(); } ), 50);
}
}
}