sowmya@zoomin

Labeling query results in Javascript API

Discussion created by sowmya@zoomin on Feb 21, 2011
Latest reply on Feb 25, 2011 by hzhu
Hi,

     I am creating graphics layer using esri.layers.GraphicsLayer. I need to display some key field value of that layer on graphics as label.Can i achieve using esri.symbol.TextSymbol?
My code is like this :

function ZoomshowResults(featureSet)
       {     
          var zoomresultFeatures = featureSet.features;
          var ZoomGraphicsLayer= new esri.layers.GraphicsLayer({id:"1"});
          var il;
          for (var i=0, il=zoomresultFeatures.length; i<il; i++) {
          var zoomgraphic = zoomresultFeatures[i];
          var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([72,61,139,0.35]), 1),new dojo.Color([72,61,139,0.35]));
          zoomgraphic.setSymbol(symbol);
          ZoomGraphicsLayer.add(zoomgraphic);
         }
          map.addLayer(ZoomGraphicsLayer);
          map.graphics.enableMouseEvents();
       }


Thanks in advance..
Sowmya

Outcomes