Message: Tried to register widget with id==map_infowindow but that id is already regi

874
2
03-20-2013 01:01 PM
SaiDake
New Contributor
Im getting javascript error where i click a button to reload a map.
Message: Tried to register widget with id==map_infowindow but that id is already registered

try
            {
            map.destroy();
            }
            catch(e)
            {}
           
            map = new esri.Map("map", {
             center: [-94.028227,38.190532], // long, lat
                zoom: 4});

Map loads well for the first time. However, second time it throws that error. I tried using map.destroy() to destroy the map instance but it doesnt work. How shud i overcome this? Thx in advance for ur help.
0 Kudos
2 Replies
DianaBenedict
Occasional Contributor III
try using
map.destroyRecursive(false);

I have never used it on a map dijit but have used with other dojo dijits .. so I am not 100% sure if that will work
0 Kudos
SaiDake
New Contributor
Message: 'undefined' is null or not an object when i try it.
0 Kudos