mirror of https://gitee.com/antv-l7/antv-l7
feat: 修复 l7-component 打包依赖报错问题 (#1413)
* refactor: 1.控件 LayerControl => LayerSwitch,防止在 LarkMap 中控件命名概念混淆 2.LayerSwitch 的参数 layers 新增支持传递 layer 的 id 数组 * fix: 修复 l7-component 打包依赖报错问题 Co-authored-by: yanxiong <oujinhui.ojh@antgroup.com>
This commit is contained in:
parent
5c1f29bbba
commit
a94f12b60f
|
@ -1,5 +1,4 @@
|
|||
import { ILayer } from '@antv/l7-core';
|
||||
import { BaseLayer } from '@antv/l7-layers';
|
||||
import { createL7Icon } from '../utils/icon';
|
||||
import SelectControl, {
|
||||
ControlOptionItem,
|
||||
|
@ -19,8 +18,8 @@ export default class LayerSwitch extends SelectControl<ILayerSwitchOption> {
|
|||
if (Array.isArray(layers) && layers.length) {
|
||||
const layerInstances: ILayer[] = [];
|
||||
layers.forEach((layer) => {
|
||||
if (layer instanceof BaseLayer) {
|
||||
layerInstances.push(layer);
|
||||
if (layer instanceof Object) {
|
||||
layerInstances.push(layer as ILayer);
|
||||
}
|
||||
if (typeof layer === 'string') {
|
||||
const targetLayer =
|
||||
|
|
Loading…
Reference in New Issue