map._clusterLayer.getSource()。forEachFeature(function(feature){
//如何获取索引功能?
的console.log(featureIndex);
}
答案 0 :(得分:0)
功能有getId()
功能:
map._clusterLayer.getSource().forEachFeature(function(feature) {
// you may want to set the index depending on other attributes first:
// feature.setId(feature.get('yourPreferedKeyForIndex'));
// get feature index
var featureIndex = feature.getId();
console.log(featureIndex);
});