AnsweredAssumed Answered

unique value renderer for null values and all other values

Question asked by ellatrue on May 18, 2017
Latest reply on May 18, 2017 by ellatrue

I need to create a unique value renderer that shows null values as one symbol, and all other values as another (I don't want to list out each possible value when all that matters is that it isn't null). Here's what I've tried:

 

//set up unique value render for feature layer
//two kinds of symbols: segment comments and regular location comments
//--symbols
var commentSymbol = new SimpleMarkerSymbol({
   style: "round",
   color: "blue",
   size: "12px"
});
var segmentCommentSymbol = new SimpleMarkerSymbol({
   style: "round",
   color: "cyan",
   size: "12px"
});

//--renderer
var renderer = new UniqueValueRenderer({
   field: "SegmentId",
   defaultsymbol: segmentCommentSymbol
});
renderer.addUniqueValueInfo({
   value: null,
   symbol: commentSymbol
});

 

In the debugger it appears that the non-null segment graphics are being added properly to my graphics array for the feature layer. However, only the blue null values (for commentSymbol) are being displayed - the non-null value points are all missing from the map. What am I doing wrong?

Outcomes