I have a layer of features, and I want to cluster them. I have the cluster set up and originally had a renderer using CIMSymbol to display the name of the feature, along with an icon.
However when I cluster, it shows the number and also the name below the cluster. I would like to only show the feature value when the cluster size is 1.
I tried some where clauses in the labelingInfo array, but that didn't render anything:
const workerClusterConfig = {
type: "cluster",
clusterRadius: "100px",
// {cluster_count} is an aggregate field containing
// the number of features comprised by the cluster
popupTemplate: {
title: "Cluster summary",
content: "This cluster represents {cluster_count} workers.",
fieldInfos: [{
fieldName: "cluster_count",
format: {
places: 0,
digitSeparator: true
}
}]
},
clusterMinSize: "50px",
clusterMaxSize: "50px",
labelingInfo: [{
labelExpressionInfo: {
expression: "$feature.cluster_count"
},
labelPlacement: "center-center",
deconflictionStrategy: "none",
where: `$feature.cluster_count > 1`
},{
labelExpressionInfo: {
expression: "$feature.name"
},
labelPlacement: "below-center",
deconflictionStrategy: "none",
where: `$feature.cluster_count < 2`
},]
};
I am assuming that cluster_count is a number, and that the layer renderer cannot access it. Do I need to move my entire layer renderer down into the cluster render? Do I need a completely different renderer?