• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

antvis / L7Plot / 3730327136

pending completion
3730327136

push

github

yunji
chore: publish

731 of 1962 branches covered (37.26%)

Branch coverage included in aggregate %.

3048 of 4600 relevant lines covered (66.26%)

175.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

26.79
/packages/composite-layers/src/composite-layers/icon-layer/icon-image.ts
1
import { IconImageLayerOptions } from './types';
2
import { DEFAULT_OPTIONS } from './constants';
1✔
3
import { IconLayer } from './icon';
1✔
4
import { Scene } from '../../types';
1✔
5
import { CompositeLayerEvent } from '../../core/constants';
1✔
6
import { CompositeLayer } from '../../core/composite-layer';
1✔
7

1✔
8
export class IconImageLayer extends IconLayer<IconImageLayerOptions> {
1✔
9
  /**
1✔
10
   * 默认配置项
1✔
11
   */
12
  static DefaultOptions = DEFAULT_OPTIONS;
×
13
  /**
14
   * 复合图层类型
15
   */
16
  public type = CompositeLayer.LayerType.IconImageLayer;
×
17

×
18
  /**
19
   * 添加到场景
20
   */
21
  public addTo(scene: Scene) {
22
    this.scene = scene;
1✔
23
    this.initAssets().then(() => {
×
24
      this.subLayers.addTo(scene);
×
25
      this.emit(CompositeLayerEvent.ADD);
×
26
    });
×
27
  }
×
28

29
  /**
30
   * 初始化资源
31
   */
32
  protected async initAssets() {
33
    await this.loadIconAtlas();
1✔
34
  }
×
35

×
36
  /**
×
37
   * load 图片资源
×
38
   */
39
  protected async loadIconAtlas() {
×
40
    const iconAtlas = this.options.iconAtlas;
×
41
    const scene = this.scene;
42
    await Promise.all(
43
      Object.keys(iconAtlas).map(async (icon: string) => {
44
        await scene?.addImage(icon, iconAtlas[icon]);
45
      })
46
    );
47
  }
48
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc