fix(source): cluster layer

This commit is contained in:
thinkinggis 2019-04-10 20:51:57 +08:00
parent 66f0e94fa4
commit 642a841f10
1 changed files with 2 additions and 1 deletions

View File

@ -130,7 +130,8 @@ export default class Source extends Base {
const data = this.get('data');
// 如果是GeoJSON 数据返回原数
// 颜色编码从1开始要素索引从0开始所以颜色转变要素需要减1
return data.features
const isCluster = this.get('isCluster') || false;
return (data.features && !isCluster)
? data.features[featureId - 1]
: this.data.dataArray[featureId - 1];
}