* feat: 新增 setAutoFit 方法,允许设置图层的 autoFit 属性值

* feat: 补充 setAutoFit 方法的返回值
This commit is contained in:
YiQianYao 2022-03-03 16:21:18 +08:00 committed by GitHub
parent cfbd3941b8
commit a780946552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -200,6 +200,7 @@ export interface ILayer {
id: number | { x: number; y: number }, id: number | { x: number; y: number },
option?: IActiveOption, option?: IActiveOption,
): void; ): void;
setAutoFit(autoFit: boolean): void;
style(options: unknown): ILayer; style(options: unknown): ILayer;
hide(): ILayer; hide(): ILayer;
show(): ILayer; show(): ILayer;

View File

@ -795,6 +795,14 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
}); });
return this; return this;
} }
public setAutoFit(autoFit: boolean): ILayer {
this.updateLayerConfig({
autoFit,
});
return this;
}
/** /**
* zoom to layer Bounds * zoom to layer Bounds
*/ */