I am using openlayers 5.3. I want to continue zooming in when smaller clusters are tapped or clicked. I have used some code to achieve such requirement but it doesn't work.
getStyleForCluster = (size: number): ol.style.Style => {
let clusterStyle = (<any>window).styleCache[size];
if (!clusterStyle) {
clusterStyle = new ol.style.Style({
image: new ol.style.Circle({
radius: (Math.log(size) / Math.log(10)) * 3 + 10,
fill: new ol.style.Fill({
color: this.getFillColorForPlace(size)
})
}),
text: new ol.style.Text({
text: size.toString(),
fill: new ol.style.Fill({
color: "#fff"
})
})
});
(<any>window).styleCache[size] = clusterStyle;
}
return clusterStyle;
}
this.ClusterSource = new ol.source.Cluster({
distance: distance,
source: vectorSource
});
var vectorLayer = new ol.layer.Vector({
renderMode: 'image',
source: this.ClusterSource,
style: this.styleFunction,
zIndex: 9999
});
could you please suggest me how to resolve such issue.