Override cluster symbol with UniqueValueRenderer

181
1
03-16-2021 10:43 AM
mute55
by
New Contributor

Hi,

 

My application displays multiple types of features with differing symbols using a feature layer with a unique value renderer, like so

  {
    type: 'unique-value',
    valueExpression: `When($feature.type == 'someType', '1', 
      $feature.type == 'someType', '2', 
      $feature.type == 'someType', '3', 
      '0')`,
    uniqueValueInfos: [{
        value: '1',
        symbol: someSymbol,
      },
      {
        value: '2',
        symbol: someSymbol,
      },
      {
        value: '3',
        symbol: someSymbol,    
      }
    ],
  }

 

This works very well, however upon adding a featureReductionCluster to the feature layer, the generated cluster symbols seem to be a random selection of of the features it represents, albeit a different size.

Removing the valueExpression and specifying defaultSymbol in the renderer gets around this, as the cluster symbol inherits the symbol/size from the default.

However due to the nature of my use case I am required to perform some advanced differentiation, requiring the use of valueExpression with an Arcade expression.

 

Is there a way to retain the use of valueExpression on a renderer and still have control over the cluster symbol?

0 Kudos
1 Reply
bmanghi
New Contributor III

Apparently there's an undocumented symbol property in FeatureReductionCluster - https://community.esri.com/t5/arcgis-api-for-javascript-ideas/arcgis-javascript-4-cluster-renderer/i...

 

0 Kudos