The following snippet works on drawing symbols based on a query of the database column "SITE_TYPE" with four different PictureMarkerSymbols.
After doing the first query, however, I did another "onclick" query based on another column with another set of PictureMarkerSymbols.
The features returned correctly but the symbols used were still that of the first.
I had used functions to define different sets of symbols for different columns on queries, but it failed. It still got stuck with the first set of the symbol definition used for subsequent queries.
var symbol = new esri.symbol.PictureMarkerSymbol('markers/RT.png', 15, 25); var CT = new esri.symbol.PictureMarkerSymbol('markers/CT.png', 18, 30); var HP = new esri.symbol.PictureMarkerSymbol('markers/HP.png', 18, 30); var IC = new esri.symbol.PictureMarkerSymbol('markers/IC.png', 18, 30); var IP = new esri.symbol.PictureMarkerSymbol('markers/IP.png', 18, 30); var renderer = new esri.renderer.UniqueValueRenderer(symbol,"SITE_TYPE"); renderer.addValue("CT", CT); renderer.addValue("HP", HP); renderer.addValue("IC", IC); renderer.addValue("IP", IP); featureLayer.setRenderer(renderer); map.addLayers([basemap, featureLayer]);