AnsweredAssumed Answered

Failed to add a graphicsLayer

Question asked by shaningesri on Jan 31, 2014
Latest reply on Jan 31, 2014 by shaningesri
Got a failure to add a graphicsLayer on the map.  This piece of code worked well several days ago.  I don't know why it breaks.  The related code is below:
          var queryFeatures = featureSet.features;
          for (var i = 0; i < queryFeatures.length; i++) {
              queryFeatures[i].setSymbol(querySymbol);
              gLayer.add(queryFeatures[i]);
          }
          map.addLayers([gLayer]);

When I run debugging, at  map.addLayers([gLayer]);  I can view that the gLayer (GraphicsLayer) does have 27 records.  After I press F10 to continue the debugging, it shows
catch(g)        g - undefined
Hopefully, I can get a hint from you.  Thanks in advance.

Outcomes