Feat cluster (#950)

* feat: add cluster demo

* fix(baselayer): 聚合图共用source 时数据不更新问题

layer  增加cluster zoom 标识符'

* fix(source): lint error

* fix: 聚合图缩放等级范围设置

* fix: demo

* fix: demo lint
This commit is contained in:
@thinkinggis 2022-01-26 11:18:59 +08:00 committed by GitHub
parent fe0fa62a05
commit af9c72e19a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -46,12 +46,11 @@ export default class DataSourcePlugin implements ILayerPlugin {
// 如果 dataSource 有更新,跳过 zoom 的判断,直接更新一次
if (
cluster &&
(dataSourceNeedUpdate || Math.abs(layer.clusterZoom - newZoom) >= 1) &&
maxZoom > layer.clusterZoom
(dataSourceNeedUpdate || Math.abs(layer.clusterZoom - newZoom) >= 1)
) {
// TODO 判断数据是否更新
if (zoom !== Math.floor(newZoom)) {
source.updateClusterData(Math.round(newZoom));
source.updateClusterData(Math.floor(newZoom));
}
layer.clusterZoom = newZoom;
return true;