mirror of https://gitee.com/antv-l7/antv-l7
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:
parent
16dda0a570
commit
33757f05f4
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue