mirror of https://gitee.com/antv-l7/antv-l7
Fix scale update diff (#1576)
* feat: scale update * docs: scale/filter document * docs: this image is missing a text alternative * fix: add scale options diff * fix: lint error
This commit is contained in:
parent
cefe7a71ed
commit
56b22369ac
|
@ -664,6 +664,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}>
|
|||
return this;
|
||||
}
|
||||
public scale(field: string | number | IScaleOptions, cfg?: IScale) {
|
||||
const preOption = { ...this.scaleOptions };
|
||||
if (isObject(field)) {
|
||||
this.scaleOptions = {
|
||||
...this.scaleOptions,
|
||||
|
@ -672,7 +673,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}>
|
|||
} else {
|
||||
this.scaleOptions[field] = cfg;
|
||||
}
|
||||
if (this.styleAttributeService) {
|
||||
if (this.styleAttributeService && !isEqual(preOption, this.scaleOptions)) {
|
||||
const scaleOptions = isObject(field) ? field : { [field]: cfg };
|
||||
this.styleAttributeService.updateScaleAttribute(scaleOptions);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue