答案 0 :(得分:0)
如果两个要素位于完全相同的位置,则无论放大多少,一个要素都不可避免地会隐藏在另一个要素的后面。如果使用群集,则可以显示群集中每个要素的名称(或其他属性)而不是计数,例如:
var clusters = new ol.layer.Vector({
source: clusterSource,
style: function(cluster) {
var text = '';
cluster.get('features').forEach(
function(feature) { text += feature.get('name') + '\n' }
);
return new ol.style.Style({
text: new ol.style.Text({
text: text,
fill: ????
}),
image: ????
});
}
});