Why my graphics are not added to the map?

Discussion created by cadrin on Dec 4, 2012
Latest reply on Dec 7, 2012 by cadrin
Hi all,

I'm following this example (but programmatically)

and I don't know why my graphic are not showing up...

Thank's for your help.

//display the location results on the map 
function showResultsLocator(results) 
    map = getMap();
    //find results return an array of findResult.
    console.dir(map); // my map object is fully working here;
    var dataForGrid = [];
    //Build an array of attribute information and add each found graphic to the map
    var cpt = 0;
    dojo.forEach(results, function(result) 
     var graphic = result.feature;
     //console.log(graphic.attributes.NAD83+","+ graphic.attributes.CIVIQUE+","+ graphic.attributes.VOIE);
  dataForGrid.push([result.layerName,graphic.attributes.NAD83, graphic.attributes.CIVIQUE, graphic.attributes.VOIE]);
        var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.5]));
        graphic.setSymbol(symbol);;  // the graphics are not added to the map. Why?
 //console.log("cpt search = "+cpt);
 $('#nb_res_search').text('Nb. résultat(s): '+cpt);