@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.
- package/es/assets/iconfont/iconfont.js +6 -6
- package/es/constants/index.js +2 -2
- package/es/control/baseControl/buttonControl.js +109 -144
- package/es/control/baseControl/control.js +212 -258
- package/es/control/baseControl/popperControl.js +67 -95
- package/es/control/baseControl/selectControl.js +132 -178
- package/es/control/exportImage.js +59 -142
- package/es/control/fullscreen.js +69 -100
- package/es/control/geoLocate.js +37 -84
- package/es/control/layerSwitch.js +111 -154
- package/es/control/logo.js +43 -69
- package/es/control/mapTheme.js +57 -98
- package/es/control/mouseLocation.js +37 -69
- package/es/control/scale.js +107 -135
- package/es/control/swipe.js +297 -393
- package/es/control/zoom.js +80 -112
- package/es/css/index.css +10 -7
- package/es/index.js +667 -1
- package/es/marker-layer.js +274 -326
- package/es/marker.d.ts +0 -2
- package/es/marker.js +394 -453
- package/es/popup/layerPopup.js +277 -321
- package/es/popup/popup.js +422 -482
- package/es/utils/anchor.js +6 -6
- package/es/utils/icon.js +4 -4
- package/es/utils/popper.js +180 -196
- package/es/utils/screenfull.js +29 -51
- package/lib/assets/iconfont/iconfont.js +6 -6
- package/lib/constants/index.d.ts +60 -0
- package/lib/constants/index.js +2 -2
- package/lib/control/baseControl/buttonControl.d.ts +60 -0
- package/lib/control/baseControl/buttonControl.js +110 -143
- package/lib/control/baseControl/control.d.ts +112 -0
- package/lib/control/baseControl/control.js +213 -257
- package/lib/control/baseControl/index.d.ts +4 -0
- package/lib/control/baseControl/index.js +5 -5
- package/lib/control/baseControl/popperControl.d.ts +28 -0
- package/lib/control/baseControl/popperControl.js +68 -94
- package/lib/control/baseControl/selectControl.d.ts +53 -0
- package/lib/control/baseControl/selectControl.js +133 -177
- package/lib/control/exportImage.d.ts +19 -0
- package/lib/control/exportImage.js +60 -141
- package/lib/control/fullscreen.d.ts +20 -0
- package/lib/control/fullscreen.js +70 -99
- package/lib/control/geoLocate.d.ts +17 -0
- package/lib/control/geoLocate.js +38 -83
- package/lib/control/layerSwitch.d.ts +27 -0
- package/lib/control/layerSwitch.js +112 -153
- package/lib/control/logo.d.ts +14 -0
- package/lib/control/logo.js +44 -69
- package/lib/control/mapTheme.d.ts +11 -0
- package/lib/control/mapTheme.js +58 -97
- package/lib/control/mouseLocation.d.ts +16 -0
- package/lib/control/mouseLocation.js +38 -68
- package/lib/control/scale.d.ts +35 -0
- package/lib/control/scale.js +108 -134
- package/lib/control/swipe.d.ts +66 -0
- package/lib/control/swipe.js +298 -392
- package/lib/control/zoom.d.ts +39 -0
- package/lib/control/zoom.js +81 -111
- package/lib/css/index.css +10 -7
- package/lib/index.d.ts +19 -0
- package/lib/index.js +683 -17
- package/lib/interface.d.ts +18 -0
- package/lib/marker-layer.d.ts +55 -0
- package/lib/marker-layer.js +276 -324
- package/lib/marker.d.ts +58 -0
- package/lib/marker.js +395 -452
- package/lib/popup/layerPopup.d.ts +99 -0
- package/lib/popup/layerPopup.js +278 -320
- package/lib/popup/popup.d.ts +142 -0
- package/lib/popup/popup.js +423 -481
- package/lib/utils/anchor.d.ts +22 -0
- package/lib/utils/anchor.js +6 -6
- package/lib/utils/icon.d.ts +1 -0
- package/lib/utils/icon.js +6 -5
- package/lib/utils/popper.d.ts +76 -0
- package/lib/utils/popper.js +184 -196
- package/lib/utils/screenfull.d.ts +2 -0
- package/lib/utils/screenfull.js +29 -52
- package/package.json +16 -20
- package/CHANGELOG.md +0 -325
- 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
|
+
}
|