How do you write code in a widget to replace an app's web map?
I attempted to use esri/arcgis/utils like this:
arcgisUtils.createMap(myWebMapId, this.map.id).then(lang.hitch(function(response) {
this.map = response.map;
}));
This code did not visibly change the map control. Then I had an idea to clear the contents of the map div before loading the map:
var mapDiv = dom.byId(this.map.id);
mapDiv.innerHTML = "";
arcgisUtils.createMap(myWebMapId, this.map.id).then(lang.hitch(function(response) {
this.map = response.map;
}));
In this case, the map control did load and display my web map! However, all of the app's widgets disappeared.