@antv/l7-component 2.21.1 → 2.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/es/assets/iconfont/iconfont.js +6 -6
  2. package/es/constants/index.js +2 -2
  3. package/es/control/baseControl/buttonControl.js +109 -144
  4. package/es/control/baseControl/control.js +212 -258
  5. package/es/control/baseControl/popperControl.js +67 -95
  6. package/es/control/baseControl/selectControl.js +132 -178
  7. package/es/control/exportImage.js +59 -142
  8. package/es/control/fullscreen.js +69 -100
  9. package/es/control/geoLocate.js +37 -84
  10. package/es/control/layerSwitch.js +111 -154
  11. package/es/control/logo.js +43 -69
  12. package/es/control/mapTheme.js +57 -98
  13. package/es/control/mouseLocation.js +37 -69
  14. package/es/control/scale.js +107 -135
  15. package/es/control/swipe.js +297 -389
  16. package/es/control/zoom.js +80 -112
  17. package/es/css/index.css +10 -7
  18. package/es/index.js +667 -1
  19. package/es/marker-layer.js +275 -326
  20. package/es/marker.js +394 -446
  21. package/es/popup/layerPopup.js +277 -321
  22. package/es/popup/popup.js +422 -482
  23. package/es/utils/anchor.js +6 -6
  24. package/es/utils/icon.js +4 -4
  25. package/es/utils/popper.js +180 -196
  26. package/es/utils/screenfull.js +29 -51
  27. package/lib/assets/iconfont/iconfont.js +6 -6
  28. package/lib/constants/index.d.ts +60 -0
  29. package/lib/constants/index.js +2 -2
  30. package/lib/control/baseControl/buttonControl.d.ts +60 -0
  31. package/lib/control/baseControl/buttonControl.js +110 -143
  32. package/lib/control/baseControl/control.d.ts +112 -0
  33. package/lib/control/baseControl/control.js +213 -257
  34. package/lib/control/baseControl/index.d.ts +4 -0
  35. package/lib/control/baseControl/index.js +5 -5
  36. package/lib/control/baseControl/popperControl.d.ts +28 -0
  37. package/lib/control/baseControl/popperControl.js +68 -94
  38. package/lib/control/baseControl/selectControl.d.ts +53 -0
  39. package/lib/control/baseControl/selectControl.js +133 -177
  40. package/lib/control/exportImage.d.ts +19 -0
  41. package/lib/control/exportImage.js +60 -141
  42. package/lib/control/fullscreen.d.ts +20 -0
  43. package/lib/control/fullscreen.js +70 -99
  44. package/lib/control/geoLocate.d.ts +17 -0
  45. package/lib/control/geoLocate.js +38 -83
  46. package/lib/control/layerSwitch.d.ts +27 -0
  47. package/lib/control/layerSwitch.js +112 -153
  48. package/lib/control/logo.d.ts +14 -0
  49. package/lib/control/logo.js +44 -69
  50. package/lib/control/mapTheme.d.ts +11 -0
  51. package/lib/control/mapTheme.js +58 -97
  52. package/lib/control/mouseLocation.d.ts +16 -0
  53. package/lib/control/mouseLocation.js +38 -68
  54. package/lib/control/scale.d.ts +35 -0
  55. package/lib/control/scale.js +108 -134
  56. package/lib/control/swipe.d.ts +66 -0
  57. package/lib/control/swipe.js +298 -388
  58. package/lib/control/zoom.d.ts +39 -0
  59. package/lib/control/zoom.js +81 -111
  60. package/lib/css/index.css +10 -7
  61. package/lib/index.d.ts +19 -0
  62. package/lib/index.js +683 -17
  63. package/lib/interface.d.ts +18 -0
  64. package/lib/marker-layer.d.ts +55 -0
  65. package/lib/marker-layer.js +277 -324
  66. package/lib/marker.d.ts +58 -0
  67. package/lib/marker.js +395 -445
  68. package/lib/popup/layerPopup.d.ts +99 -0
  69. package/lib/popup/layerPopup.js +278 -320
  70. package/lib/popup/popup.d.ts +142 -0
  71. package/lib/popup/popup.js +423 -481
  72. package/lib/utils/anchor.d.ts +22 -0
  73. package/lib/utils/anchor.js +6 -6
  74. package/lib/utils/icon.d.ts +1 -0
  75. package/lib/utils/icon.js +6 -5
  76. package/lib/utils/popper.d.ts +76 -0
  77. package/lib/utils/popper.js +184 -196
  78. package/lib/utils/screenfull.d.ts +2 -0
  79. package/lib/utils/screenfull.js +29 -52
  80. package/package.json +16 -20
  81. package/CHANGELOG.md +0 -325
  82. package/LICENSE.md +0 -21
@@ -0,0 +1,18 @@
1
+ export type ControlEvent = 'show' | 'hide' | 'add' | 'remove' | string;
2
+ export interface IMarkerStyleOption {
3
+ element?: (...args: any[]) => any;
4
+ style: {
5
+ [key: string]: any;
6
+ } | ((...args: any[]) => any);
7
+ className: string;
8
+ field?: string;
9
+ method?: 'sum' | 'max' | 'min' | 'mean';
10
+ radius: number;
11
+ maxZoom: number;
12
+ minZoom: number;
13
+ zoom: number;
14
+ }
15
+ export interface IMarkerLayerOption {
16
+ cluster: boolean;
17
+ clusterOption: Partial<IMarkerStyleOption>;
18
+ }
@@ -0,0 +1,55 @@
1
+ import type { IMarker, L7Container } from '@antv/l7-core';
2
+ import { EventEmitter } from 'eventemitter3';
3
+ import type { IMarkerLayerOption } from './interface';
4
+ export default class MarkerLayer extends EventEmitter {
5
+ private markers;
6
+ private markerLayerOption;
7
+ private clusterIndex;
8
+ private points;
9
+ private clusterMarkers;
10
+ private mapsService;
11
+ private scene;
12
+ private zoom;
13
+ private bbox;
14
+ private inited;
15
+ private containerSize;
16
+ constructor(option?: Partial<IMarkerLayerOption>);
17
+ getDefault(): {
18
+ cluster: boolean;
19
+ clusterOption: {
20
+ radius: number;
21
+ maxZoom: number;
22
+ minZoom: number;
23
+ zoom: number;
24
+ style: {};
25
+ className: string;
26
+ };
27
+ };
28
+ addTo(scene: L7Container): this;
29
+ private setContainerSize;
30
+ private getContainerSize;
31
+ addMarker(marker: IMarker): void;
32
+ removeMarker(marker: IMarker): void;
33
+ /**
34
+ * 隐藏 marker 在每个 marker 上单独修改属性而不是在 markerContainer 上修改(在 markerContainer 修改会有用户在场景加载完之前调用失败的问题)
35
+ */
36
+ hide(): void;
37
+ /**
38
+ * 显示 marker
39
+ */
40
+ show(): void;
41
+ getMarkers(): IMarker[];
42
+ getOriginMarkers(): IMarker[];
43
+ addMarkers(): void;
44
+ clear(): void;
45
+ destroy(): void;
46
+ private addPoint;
47
+ private removePoint;
48
+ private initCluster;
49
+ private getClusterMarker;
50
+ private getLeaves;
51
+ private clusterMarker;
52
+ private normalMarker;
53
+ private update;
54
+ private generateElement;
55
+ }