@antv/l7-component 2.21.0 → 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 (83) 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 -393
  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 +274 -326
  20. package/es/marker.d.ts +0 -2
  21. package/es/marker.js +394 -453
  22. package/es/popup/layerPopup.js +277 -321
  23. package/es/popup/popup.js +422 -482
  24. package/es/utils/anchor.js +6 -6
  25. package/es/utils/icon.js +4 -4
  26. package/es/utils/popper.js +180 -196
  27. package/es/utils/screenfull.js +29 -51
  28. package/lib/assets/iconfont/iconfont.js +6 -6
  29. package/lib/constants/index.d.ts +60 -0
  30. package/lib/constants/index.js +2 -2
  31. package/lib/control/baseControl/buttonControl.d.ts +60 -0
  32. package/lib/control/baseControl/buttonControl.js +110 -143
  33. package/lib/control/baseControl/control.d.ts +112 -0
  34. package/lib/control/baseControl/control.js +213 -257
  35. package/lib/control/baseControl/index.d.ts +4 -0
  36. package/lib/control/baseControl/index.js +5 -5
  37. package/lib/control/baseControl/popperControl.d.ts +28 -0
  38. package/lib/control/baseControl/popperControl.js +68 -94
  39. package/lib/control/baseControl/selectControl.d.ts +53 -0
  40. package/lib/control/baseControl/selectControl.js +133 -177
  41. package/lib/control/exportImage.d.ts +19 -0
  42. package/lib/control/exportImage.js +60 -141
  43. package/lib/control/fullscreen.d.ts +20 -0
  44. package/lib/control/fullscreen.js +70 -99
  45. package/lib/control/geoLocate.d.ts +17 -0
  46. package/lib/control/geoLocate.js +38 -83
  47. package/lib/control/layerSwitch.d.ts +27 -0
  48. package/lib/control/layerSwitch.js +112 -153
  49. package/lib/control/logo.d.ts +14 -0
  50. package/lib/control/logo.js +44 -69
  51. package/lib/control/mapTheme.d.ts +11 -0
  52. package/lib/control/mapTheme.js +58 -97
  53. package/lib/control/mouseLocation.d.ts +16 -0
  54. package/lib/control/mouseLocation.js +38 -68
  55. package/lib/control/scale.d.ts +35 -0
  56. package/lib/control/scale.js +108 -134
  57. package/lib/control/swipe.d.ts +66 -0
  58. package/lib/control/swipe.js +298 -392
  59. package/lib/control/zoom.d.ts +39 -0
  60. package/lib/control/zoom.js +81 -111
  61. package/lib/css/index.css +10 -7
  62. package/lib/index.d.ts +19 -0
  63. package/lib/index.js +683 -17
  64. package/lib/interface.d.ts +18 -0
  65. package/lib/marker-layer.d.ts +55 -0
  66. package/lib/marker-layer.js +276 -324
  67. package/lib/marker.d.ts +58 -0
  68. package/lib/marker.js +395 -452
  69. package/lib/popup/layerPopup.d.ts +99 -0
  70. package/lib/popup/layerPopup.js +278 -320
  71. package/lib/popup/popup.d.ts +142 -0
  72. package/lib/popup/popup.js +423 -481
  73. package/lib/utils/anchor.d.ts +22 -0
  74. package/lib/utils/anchor.js +6 -6
  75. package/lib/utils/icon.d.ts +1 -0
  76. package/lib/utils/icon.js +6 -5
  77. package/lib/utils/popper.d.ts +76 -0
  78. package/lib/utils/popper.js +184 -196
  79. package/lib/utils/screenfull.d.ts +2 -0
  80. package/lib/utils/screenfull.js +29 -52
  81. package/package.json +16 -20
  82. package/CHANGELOG.md +0 -325
  83. 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
+ }