Tried to register widget with id==map_infowindow but that id is already registered

4253
1
04-02-2015 10:44 PM
jimmiraza
New Contributor

I am geting error [Tried to register widget with id==mapQatarDiv_infowindow but that id is already registered ] when i have clicked map button multiple time

i have destroy map before create new map like below

try {

           if (mapLoaded) {

               appLayers.map.destroy();

           }

       } catch (e) {

           alert("destroy"+ e.message)

       }

       appLayers.map = new esri.Map("mapQatarDiv", {

           extent: startExtent,

           sliderStyle: "large",

           logo: false

       });

       currentMapLayer = new esri.layers.ArcGISTiledMapServiceLayer(url_Saltelitte_Layer, {

           id: "satellite"

       });

0 Kudos
1 Reply
YousefQuran
Occasional Contributor

بسم الله الرحمن الرحيم

Dear Mr. raza,

Maybe I had face the same problem, I found the solution in this
# link :  https://community.esri.com/message/198990#198983

The Idea is to Append the target widget each time you destroy and re-create it ...
# Get feet wet : 

var eDiv = dojo.create("div", { id: "anyID"}); 
dojo.byId('mapQatarDiv').appendChild(eDiv);


Regards.
Yusuf
Amman, Jordan.

0 Kudos