AnsweredAssumed Answered

Unable to see the graphics layer in the map

Question asked by lingpri on Feb 22, 2016
Latest reply on Feb 25, 2016 by lingpri

Hi All -  I'm developing a custom application, where in user loads from standard boundraies (city/neighbourhood ) to get geometry, I execute a query to get results and during the query success, I call show results as seen below which populates the dgrid and outlines the geometry on the map. The grid is getting populated, but I don't the see the geometry being drawn on the map. Please advise what could be the problem. I'm totally lost. Could it be possible the Graphicslayer has to be moved to the top??, given that , there are other layers which is hiding them. (We call the Java middle tier to make the rest call, we don't make REST api calls from the client side)


                             _showResults: function(token, map,bndryType,featureSet) {


                                                        var layer = map.getLayer("drawLayer");


                                                            var items =, function(feature) {

                                                                var drawByGraphic = new Graphic(feature );

                                                                var json = { };

                                                                json.bndryName = feature.attributes[token];

                                                                json.col1 = feature.attributes['OBJECTID'];

                                                                json.geometry = feature.geometry;

                                                                json.bndryType = bndryType;

                                                                json.isSelected = false;


                                                                var sfs = new SimpleFillSymbol(SimpleFillSymbol.STYLE_SOLID,

                                                                 new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID,

                                                                     new Color([232,104,80]), 2),new Color([255,255,0,0.25])



                                                                return json;


                                                         if(items) {


                                                                var memStore = new Memory({

                                                                    data: items,

                                                                    idProperty: 'col1'


                                                             this._bndryGrid.set("collection", memStore);








In the postcreate method , I init the GraphicLayers as below:

   this.drawLayer = new GraphicsLayer(layerArgs);

    this.bndryFillLayer = new GraphicsLayer(layerArgs1);


Also, I listen for the map loaded event and add these graphic layers to the map;;