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

antvis / L7Plot / 9941196296

15 Jul 2024 02:22PM UTC coverage: 56.863% (-0.1%) from 56.968%
9941196296

push

github

web-flow
chore: 修改编译目标版本和主工程一致(es6),解决 legend 无法使用的问题。 (#360)

960 of 2222 branches covered (43.2%)

Branch coverage included in aggregate %.

2752 of 4306 relevant lines covered (63.91%)

236.24 hits per line

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

70.37
/packages/l7plot/src/core/map/register.ts
1
import { IImage } from '../../types';
2

126✔
3
/**
126✔
4
 * 自定义添加图片资源
126✔
5
 */
126✔
6
export const IMAGES_CACHE = new Map<string, IImage>();
126✔
7

126✔
8
export function registerImage(id: string, image: IImage) {
126✔
9
  IMAGES_CACHE.set(id, image);
126✔
10
}
126✔
11

126✔
12
export function registerImages(images: { id: string; image: IImage }[]) {
126✔
13
  images.forEach((iconFont) => {
126✔
14
    IMAGES_CACHE.set(iconFont.id, iconFont.image);
15
  });
16
}
17

126✔
18
export function getImage(id: string) {
19
  return IMAGES_CACHE.get(id);
13✔
20
}
21

22
export function hasImage(id: string) {
40✔
23
  return IMAGES_CACHE.has(id);
40✔
24
}
25

26
export function unregisterImage(id: string) {
27
  return IMAGES_CACHE.delete(id);
×
28
}
29

30
/**
×
31
 * 自定义添加第三方字体
32
 */
33
export const FONT_FACE_CACHE = new Map<string, string>();
×
34

35
export function registerFontFace(fontFamily: string, fontPath: string) {
36
  FONT_FACE_CACHE.set(fontFamily, fontPath);
37
}
38

126✔
39
export function unregisterFontFace(fontFamily: string) {
40
  return FONT_FACE_CACHE.delete(fontFamily);
13✔
41
}
42

43
/**
×
44
 * 自定义添加 iconfont
45
 */
46
export const ICON_FONT_CACHE = new Map<string, string>();
47

48
export function registerIconFont(name: string, fontUnicode: string) {
126✔
49
  ICON_FONT_CACHE.set(name, fontUnicode);
50
}
×
51

52
export function registerIconFonts(iconFonts: { name: string; fontUnicode: string }[]) {
53
  iconFonts.forEach((iconFont) => {
×
54
    ICON_FONT_CACHE.set(iconFont.name, iconFont.fontUnicode);
×
55
  });
56
}
57

58
export function unregisterIconFont(name) {
×
59
  return ICON_FONT_CACHE.delete(name);
60
}
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

© 2026 Coveralls, Inc