VBCrazyCoder

map.removeAllLayers Error

Discussion created by VBCrazyCoder on Sep 13, 2013
Latest reply on Sep 18, 2013 by VBCrazyCoder
In V3.5 I have a basemap, the default graphics layer, and I am adding another graphics layer that I allow users to draw polygons on.  Whenever I add this other graphics layer, and later try to remove it (ie. map.removeAllLayers() or map.removelayer(...)) I am getting an error back from the ArcGIS javascript:

"Unable to get property 'declaredClass' of undefined or null reference"


If I don't add this graphics layer, then the calls to remove work.  I add the layer by doing:
var newGraphicsLayer = new esri.layers.GraphicsLayer({ id: 'someIDhere' });
map.addLayer(newGraphicsLayer);

Any ideas?  Is this an official bug and is there a patch for this?

Outcomes