AnsweredAssumed Answered

How to change picture marker symbol based on a feature attribute

Question asked by chagan02 on Feb 6, 2015
Latest reply on Feb 6, 2015 by jskinner-esristaff

Seems simple enough.  Using the code below, how would I use a different symbol based on an attribute of the LatestLSRCSV layer?  I assume I would need to create new "symbol" variables for each possible entry of the attribute that will decide the symbol?

 

 

   //Add LSR Event Layers
   var LatestLSRCSVtemplate = new InfoTemplate();
   LatestLSRCSVtemplate.setTitle("Local Storm Report Attributes");
   LatestLSRCSVtemplate.setContent(getLatestLSRCSVTextContent);
   var LatestLSR = new CSVLayer("./NewLSR.csv",{id:"LatestLSR",refreshInterval: 1.0,mode: FeatureLayer.MODE_SELECTION,outFields: ["*"],infoTemplate: LatestLSRCSVtemplate});
   var symbol =  new PictureMarkerSymbol({"angle":0,"xoffset":0,"yoffset":0,"type":"esriPMS","url":"http://static.arcgis.com/images/Symbols/Basic/RedSphere.png","contentType":"image/png","width":22,"height":22});
   var renderer = new SimpleRenderer(symbol);
   LatestLSR.setRenderer(renderer);
   map.addLayer(LatestLSR);
   LatestLSR.hide();

Outcomes