I am building a extension of the PrintWidget which will print a specific basemap+featureLayer+other settings. For example, it will have a button which when clicked will print the current map, including whatever the user uploaded with the AddData widget, but using the basemap "streets" and a specific FeatureLayer or two.
In this thread I learned how to programmatically change the basemap. Now I want to add layers to this new basemap (before printing). But, I cannot find a way to do it.
I looked at other threads for possible examples, but they did not work. Namely, this code: