mschmoll

use UniqueValueRenderer for trackRenderer with TemporalRenderer?

Discussion created by mschmoll on Mar 8, 2012
I'm experimenting with the 'Temporal Renderer with ager' sample, and am having trouble substituting in a unique values renderer as the trackRenderer (instead of the simple renderer). 

The idea is to have the track lines symbolized in the same colour as the points (instead of having colourized points with gray track lines). 

Here is the code snippet where I've commented out the original simple renderer (used as the track renderer) and replaced with a unique value renderer.  If it isn't possible to do this, then I'm thinking of creating separate feature layers for each value in 'EVENTID' in order to have the track line colour match the point colour.


        
          //var sls = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([86, 47, 50, .80]), .5);
          //var trackRenderer = new esri.renderer.SimpleRenderer(sls);  

   var slsDefault = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([86, 47, 50, .80]), .5);
   var trackRenderer = new esri.UniqueValueRenderer(slsDefault,"EVENTID");
   trackRenderer.addValue("Alberto", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 153, 0]), .5));
   trackRenderer.addValue("Beryl", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([9, 112, 84]), .5));
   trackRenderer.addValue("Chris", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([153, 204, 153]), .5));
   trackRenderer.addValue("Debby", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([153, 51, 0]), .5));
   trackRenderer.addValue("Ernesto", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([102, 204, 0]), .5));
   trackRenderer.addValue("Florence", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([131, 76, 36]), .5));
   trackRenderer.addValue("Gordon", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([102, 0, 102]), .5));
   trackRenderer.addValue("Helene", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([153, 153, 103]), .5));
   trackRenderer.addValue("Isaac", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([153, 51, 102]), .5));
   trackRenderer.addValue("Joyce", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([102, 102, 51]), .5));
   trackRenderer.addValue("Keith", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([224, 204, 51]), .5));
   trackRenderer.addValue("Leslie", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([132, 89, 107]), .5));
   trackRenderer.addValue("Michael", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([100, 14, 39]), .5));
   trackRenderer.addValue("Nadine", new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([125, 156, 159]), .5));

Outcomes