From abc4bf10906469d8bd3b64dd7aae322b7379a366 Mon Sep 17 00:00:00 2001 From: thinkinggis Date: Wed, 10 Apr 2019 20:51:57 +0800 Subject: [PATCH] fix(source): cluster layer --- src/core/source.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/source.js b/src/core/source.js index 25841350ea..765636ea5d 100644 --- a/src/core/source.js +++ b/src/core/source.js @@ -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]; }