Hi Jenna,
After looking at the code, I found a way for you to do what you need to do with very little change.
Disclaimers:
!!! Be advised though, it is a total hack and I have not tested all the functionality to see if it breaks anything else.
!!! I suggest, you create an issue on Github for your problem, and hopefully someone will look into it, and fix it.
!!! Best scenario for you would be to create and cache a hybrid service (image with road names), which is recommended in the application documentation.
!!! If you have no control over that, then you can try my hack, but make very good notes, so when you are upgrading the application, and it breaks, you know where to look.
Here it is:
1. Order your layers this way (I am using the fact that the first layer is added on the map and always stays there, so we need this to be the imagery. Then the second layer should be the one you need displayed on the map initially, and that usually is just a street map):
// Set baseMap layers
BaseMapLayers: [
{
Key: "imagery",
ThumbnailSource: "js/library/themes/images/imagery.png",
Name: "Imagery",
MapURL: "http://yourserver/arcgis/rest/services/Imagery/MapServer"
},
{
Key: "streetMap",
ThumbnailSource: "js/library/themes/images/parcelmap.png",
Name: "Streets",
MapURL: "http://yourserver/arcgis/rest/services/GeneralPurpose/MapServer"
},
{
Key: "imageryStreetNames",
ThumbnailSource: "js/library/themes/images/imagery.png", //change image to some hybrid image
Name: "Imagery",
MapURL: "http://yourserver/arcgis/rest/services/StreetNames/MapServer"
},
{
Key: "topoMap",
ThumbnailSource: "js/library/themes/images/imagery.png",
Name: "Topographic",
MapURL: "http://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer"
}],
2. Change "0" to "1" in on the commented line in baseMapsGallery.js. In this way, the imagery which was added first will be there but hidden behind the street map, which has and index of 1 instead of 0. So change the "0" to "1" to have your street map popup first:
postCreate: function () {
var i, basemapContainer, layer,
baseMapURL = 0,
baseMapURLCount = 0,
baseMapLayers = dojo.configData.BaseMapLayers;
for (i = 0; i < baseMapLayers.length; i++) {
if (baseMapLayers.MapURL) {
this.map.addLayer(this._createBaseMapLayer(baseMapLayers.MapURL, baseMapLayers.Key));
}
if (baseMapURLCount === 1) { //on this line change "0" to "1" as shown here
baseMapURL = i;
}
baseMapURLCount++;
}
basemapContainer = domConstruct.create("div", {}, dom.byId("esriCTParentDivContainer"));
basemapContainer.appendChild(this.esriCTDivLayerContainer);
this.layerList.appendChild(this._createBaseMapElement(baseMapURL, baseMapURLCount));
if (baseMapURLCount >= 1) {
layer = this.map.getLayer(baseMapLayers[baseMapURL].Key);
layer.show();
}
},
Test it. Hope it works for you, if nothing else is possible.
Darina