fix: 修复 layer model 更新时候存在闪烁的问题 (#1358)

* fix: 修复 featureScale 错误

* style: lint style

* fix: remove featureScalePlugin async

* fix: 优化 layer model 的更新链路,避免闪烁

Co-authored-by: shihui <yiqianyao.yqy@alibaba-inc.com>
This commit is contained in:
YiQianYao 2022-09-28 17:15:15 +08:00 committed by GitHub
parent 16dda0a570
commit 33757f05f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -1366,6 +1366,9 @@ export default class BaseLayer<ChildLayerStyleOptions = {}>
};
protected dispatchModelLoad(models: IModel[]) {
this.models.forEach((model) => model.destroy());
this.models = [];
this.models = models;
this.emit('modelLoaded', null);
this.modelLoaded = true;

View File

@ -17,7 +17,8 @@ export default class LayerModelPlugin implements ILayerPlugin {
public prepareLayerModel(layer: ILayer) {
// 更新Model 配置项
layer.prepareBuildModel();
layer.clearModels();
// clear layerModel resource
layer.layerModel?.clearModels();
// 初始化 Model
layer.buildModels();
layer.layerModelNeedUpdate = false;