Select to view content in your preferred language

how to retain layer original symbol if single feature else create cluster symbol

1435
11
Jump to solution
03-07-2022 10:08 PM
ShefaliMantri
New Contributor III

Hello Team,

I have a simple picture marker symbol feature layer.

Requirement - When we turn ON cluster for that layer if single feature, then it should display layer original picture marker symbol and if more than 2 features, then it should display cluster symbol (simple marker symbol) with labels. When we turn OFF cluster, then layer will display as its initial state i.e. only picture marker symbols

 

0 Kudos
11 Replies
Lerman
by
Occasional Contributor

Sorry for the late reply. I found that when a cluster is ON , this layer generates a new field cluster_count which can be used in the renderer. I think it works for unique value renderer as well.

0 Kudos
Lerman
by
Occasional Contributor

As an additional note, when a clustered layer contains a UniqueValueRenderer, the clustered graphics are rendered with the symbol of the most common, or predominant, value of the uniqueValueInfos of the features represented by the cluster.
There is no such interface setting if you want to make the clustered graphics use the same symbol. It is difficult to implement this requirement as the cluster_count field cannot be used for arcade expressions and layers with a UniqueValueRenderer may not contain multiple fields when cluster is enabled. I have tested this and can only use two layers, one showing the graphics before cluster and one showing the graphics after cluster. demo: https://codepen.io/xiej/pen/LYexXNY?editors=0010

0 Kudos