I’m trying to make a clustering of points with label , but my points always stay clustered and I can’t figure out why.
The points before clustering :
With clustering :
But with only labels it works fine :
here is my entity creation code :
const dataSource = new CustomDataSource('elementData');
const pixelRange = 15;
const minimumClusterSize = 2;
const enabled = true;
dataSource.clustering.enabled = enabled;
dataSource.clustering.pixelRange = pixelRange;
dataSource.clustering.minimumClusterSize = minimumClusterSize;
dataSource.entities.add({
id: id,
position: Cartesian3.fromDegrees(lon, lat, 0),
point: {
pixelSize: 8 ,
color: Color.RED,
outlineColor: Color.BLACK,
outlineWidth: 1,
},
label: {
text: name,
font: '14px sans-serif',
style: LabelStyle.FILL,
fillColor: Color.BLACK,
pixelOffset: new Cartesian2(0, -9),
},
});
}