I am adding several layers (both dynamic and tiled) programmatically to my map. In the layer-add-result event, I am setting the visibility to false and the visibleLayers to -1 for all the layers.
map.on("layer-add-result", function (addedLayer) {
addedLayer.layer.setVisibility(false);
addedLayer.layer.setVisibleLayers([-1]);
});However, when I create the map with a basemap, the basemap layer( or layers, since some basemaps have multiple layers) will also fire this event. Since I want to keep the basemap visible, how can I determine if the layer a basemap?