AnsweredAssumed Answered

Replace web map in widget code?

Question asked by GSheppard-esristaff Employee on Oct 30, 2014
Latest reply on Aug 6, 2015 by slcemcphee33

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 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(;

mapDiv.innerHTML = "";

arcgisUtils.createMap(myWebMapId, { =;



In this case, the map control did load and display my web map! However, all of the app's widgets disappeared.


How can I replace the map contents without removing the app's widgets?