AnsweredAssumed Answered

Issues trying to remove a feature layer from the map

Question asked by marcus.bush on Apr 7, 2014
Latest reply on Apr 8, 2014 by pepatosp

I searched this forum and did find a vaguely similar post and tried the solution, unfortunately it did not help me though.  I made sure to make the variable for the feature layer global.

I have a JavaScript application in MVC and am trying to remove a feature layer using "map.removeLayer(nameOfFeatureLayerObject)" and it isn't working for me, the graphics from the layer remain on my map.

I had read that there may be an issue if they are associated with an existing editor or any other widget, and they are.  So, just before the .removeLayer() I have tried .destroy() on the editor and template picker dijits that the layer is being used in, and it still remains.

An important note, these feature layers are brought in using a token, as they are secure.  Could this have something to do with my issue?  Also, this particular app is on 3.5 of the jsapi.

Thanks in advance for any advice.