@antv/l7-scene 2.25.5 → 2.25.7
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/package.json +8 -8
- package/es/ILayerManager.d.ts +0 -9
- package/es/ILayerManager.js +0 -0
- package/es/IMapController.d.ts +0 -62
- package/es/IMapController.js +0 -0
- package/es/IPostProcessingPassPluggable.d.ts +0 -9
- package/es/IPostProcessingPassPluggable.js +0 -0
- package/es/boxSelect.d.ts +0 -23
- package/es/boxSelect.js +0 -104
- package/es/index.d.ts +0 -144
- package/es/index.js +0 -485
- package/lib/ILayerManager.d.ts +0 -9
- package/lib/ILayerManager.js +0 -17
- package/lib/IMapController.d.ts +0 -62
- package/lib/IMapController.js +0 -17
- package/lib/IPostProcessingPassPluggable.d.ts +0 -9
- package/lib/IPostProcessingPassPluggable.js +0 -17
- package/lib/boxSelect.d.ts +0 -23
- package/lib/boxSelect.js +0 -128
- package/lib/index.d.ts +0 -144
- package/lib/index.js +0 -516
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-scene",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "https://github.com/orgs/antvis/people",
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime": "^7.7.7",
|
|
17
17
|
"eventemitter3": "^4.0.7",
|
|
18
|
-
"@antv/l7-core": "2.25.
|
|
19
|
-
"@antv/l7-
|
|
20
|
-
"@antv/l7-
|
|
21
|
-
"@antv/l7-
|
|
22
|
-
"@antv/l7-component": "2.25.
|
|
23
|
-
"@antv/l7-layers": "2.25.
|
|
18
|
+
"@antv/l7-core": "2.25.7",
|
|
19
|
+
"@antv/l7-maps": "2.25.7",
|
|
20
|
+
"@antv/l7-renderer": "2.25.7",
|
|
21
|
+
"@antv/l7-utils": "2.25.7",
|
|
22
|
+
"@antv/l7-component": "2.25.7",
|
|
23
|
+
"@antv/l7-layers": "2.25.7"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@antv/l7-test-utils": "^2.25.
|
|
26
|
+
"@antv/l7-test-utils": "^2.25.7"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public",
|
package/es/ILayerManager.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ILayer } from '@antv/l7-core';
|
|
2
|
-
export default interface ILayerManager {
|
|
3
|
-
enableShaderPick: () => void;
|
|
4
|
-
diasbleShaderPick: () => void;
|
|
5
|
-
addLayer(layer: ILayer): void;
|
|
6
|
-
getLayers(): ILayer[];
|
|
7
|
-
getLayer(id: string): ILayer | undefined;
|
|
8
|
-
removeLayer(layer: ILayer): void;
|
|
9
|
-
}
|
package/es/ILayerManager.js
DELETED
|
File without changes
|
package/es/IMapController.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Bounds, ICameraOptions, ILngLat, IPoint, IStatusOptions, Point } from '@antv/l7-core';
|
|
2
|
-
export default interface IMapController {
|
|
3
|
-
/**
|
|
4
|
-
* 当前缩放等级
|
|
5
|
-
*/
|
|
6
|
-
getZoom(): number;
|
|
7
|
-
/**
|
|
8
|
-
* 中心点经纬度
|
|
9
|
-
*/
|
|
10
|
-
getCenter(options?: ICameraOptions): ILngLat;
|
|
11
|
-
/**
|
|
12
|
-
* 仰角
|
|
13
|
-
*/
|
|
14
|
-
getPitch(): number;
|
|
15
|
-
/**
|
|
16
|
-
* 逆时针旋转角度
|
|
17
|
-
*/
|
|
18
|
-
getRotation(): number;
|
|
19
|
-
/**
|
|
20
|
-
* 获取当前地图可视区域 `[西南角、东北角]`
|
|
21
|
-
*/
|
|
22
|
-
getBounds(): Bounds;
|
|
23
|
-
/**
|
|
24
|
-
* 放大地图
|
|
25
|
-
*/
|
|
26
|
-
zoomIn(): void;
|
|
27
|
-
/**
|
|
28
|
-
* 缩小地图
|
|
29
|
-
*/
|
|
30
|
-
zoomOut(): void;
|
|
31
|
-
/**
|
|
32
|
-
* 地图平移到指定点 `[x, y]`
|
|
33
|
-
*/
|
|
34
|
-
panTo(p: Point): void;
|
|
35
|
-
/**
|
|
36
|
-
* 地图平移到指定点 `[x, y]`
|
|
37
|
-
*/
|
|
38
|
-
panBy(x: number, y: number): void;
|
|
39
|
-
/**
|
|
40
|
-
* 调整地图适合指定区域
|
|
41
|
-
*/
|
|
42
|
-
fitBounds(bound: Bounds, fitBoundsOptions?: unknown): void;
|
|
43
|
-
getContainer(): HTMLElement | null;
|
|
44
|
-
getSize(): [number, number];
|
|
45
|
-
getMinZoom(): number;
|
|
46
|
-
getMaxZoom(): number;
|
|
47
|
-
getType(): string;
|
|
48
|
-
getMapContainer(): HTMLElement | null;
|
|
49
|
-
getMapCanvasContainer(): HTMLElement;
|
|
50
|
-
setRotation(rotation: number): void;
|
|
51
|
-
setZoomAndCenter(zoom: number, center: Point): void;
|
|
52
|
-
setCenter(center: [number, number], options?: ICameraOptions): void;
|
|
53
|
-
setPitch(pitch: number): void;
|
|
54
|
-
setZoom(zoom: number): void;
|
|
55
|
-
setMapStyle(style: any): void;
|
|
56
|
-
setMapStatus(option: Partial<IStatusOptions>): void;
|
|
57
|
-
pixelToLngLat(pixel: Point): ILngLat;
|
|
58
|
-
lngLatToPixel(lnglat: Point): IPoint;
|
|
59
|
-
containerToLngLat(pixel: Point): ILngLat;
|
|
60
|
-
lngLatToContainer(lnglat: Point): IPoint;
|
|
61
|
-
exportMap(type: 'jpg' | 'png'): Promise<string>;
|
|
62
|
-
}
|
package/es/IMapController.js
DELETED
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IPostProcessingPass } from '@antv/l7-core';
|
|
2
|
-
export default interface IPostProcessingPassPluggable {
|
|
3
|
-
/**
|
|
4
|
-
* 注册自定义后处理效果
|
|
5
|
-
* @param constructor 效果构造函数
|
|
6
|
-
* @param name 效果名,便于在 Layer 中引用
|
|
7
|
-
*/
|
|
8
|
-
registerPostProcessingPass(constructor: new (...args: any[]) => IPostProcessingPass<unknown>, name: string): void;
|
|
9
|
-
}
|
|
File without changes
|
package/es/boxSelect.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import type { Scene } from './index';
|
|
3
|
-
export declare const BoxSelectEventList: string[];
|
|
4
|
-
export type BoxSelectOptions = {
|
|
5
|
-
className?: string;
|
|
6
|
-
};
|
|
7
|
-
export default class BoxSelect extends EventEmitter {
|
|
8
|
-
protected scene: Scene;
|
|
9
|
-
protected options: BoxSelectOptions;
|
|
10
|
-
protected isEnable: boolean;
|
|
11
|
-
protected box: HTMLElement;
|
|
12
|
-
protected startEvent: any;
|
|
13
|
-
protected endEvent: any;
|
|
14
|
-
constructor(scene: Scene, options?: BoxSelectOptions);
|
|
15
|
-
get container(): HTMLElement;
|
|
16
|
-
enable(): void;
|
|
17
|
-
disable(): void;
|
|
18
|
-
protected onDragStart: (e: any) => void;
|
|
19
|
-
protected onDragging: (e: any) => void;
|
|
20
|
-
protected onDragEnd: (e: any) => void;
|
|
21
|
-
protected syncBoxBound(): void;
|
|
22
|
-
protected getLngLatBox(): import("@antv/l7-utils").BBox;
|
|
23
|
-
}
|
package/es/boxSelect.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
// src/boxSelect.ts
|
|
2
|
-
import { DOM, getBBoxFromPoints } from "@antv/l7-utils";
|
|
3
|
-
import { EventEmitter } from "eventemitter3";
|
|
4
|
-
var BoxSelectEventList = ["selectstart", "selecting", "selectend"];
|
|
5
|
-
var BoxSelect = class extends EventEmitter {
|
|
6
|
-
constructor(scene, options = {}) {
|
|
7
|
-
super();
|
|
8
|
-
this.isEnable = false;
|
|
9
|
-
this.onDragStart = (e) => {
|
|
10
|
-
if (e.target && e.stopPropagation) {
|
|
11
|
-
e.stopPropagation();
|
|
12
|
-
}
|
|
13
|
-
this.box.style.display = "block";
|
|
14
|
-
this.startEvent = this.endEvent = e;
|
|
15
|
-
this.syncBoxBound();
|
|
16
|
-
this.emit("selectstart", this.getLngLatBox(), this.startEvent, this.endEvent);
|
|
17
|
-
};
|
|
18
|
-
this.onDragging = (e) => {
|
|
19
|
-
if (e.target && e.stopPropagation) {
|
|
20
|
-
e.stopPropagation();
|
|
21
|
-
}
|
|
22
|
-
this.endEvent = e;
|
|
23
|
-
this.syncBoxBound();
|
|
24
|
-
this.emit("selecting", this.getLngLatBox(), this.startEvent, this.endEvent);
|
|
25
|
-
};
|
|
26
|
-
this.onDragEnd = (e) => {
|
|
27
|
-
if (e.target && e.stopPropagation) {
|
|
28
|
-
e.stopPropagation();
|
|
29
|
-
}
|
|
30
|
-
this.endEvent = e;
|
|
31
|
-
this.box.style.display = "none";
|
|
32
|
-
this.emit("selectend", this.getLngLatBox(), this.startEvent, this.endEvent);
|
|
33
|
-
};
|
|
34
|
-
this.scene = scene;
|
|
35
|
-
this.options = options;
|
|
36
|
-
}
|
|
37
|
-
get container() {
|
|
38
|
-
return this.scene.getMapService().getMarkerContainer();
|
|
39
|
-
}
|
|
40
|
-
enable() {
|
|
41
|
-
if (this.isEnable) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
const { className } = this.options;
|
|
45
|
-
this.scene.setMapStatus({
|
|
46
|
-
dragEnable: false
|
|
47
|
-
});
|
|
48
|
-
this.container.style.cursor = "crosshair";
|
|
49
|
-
if (!this.box) {
|
|
50
|
-
const box = DOM.create("div", void 0, this.container);
|
|
51
|
-
box.classList.add("l7-select-box");
|
|
52
|
-
if (className) {
|
|
53
|
-
box.classList.add(className);
|
|
54
|
-
}
|
|
55
|
-
box.style.display = "none";
|
|
56
|
-
this.box = box;
|
|
57
|
-
}
|
|
58
|
-
this.scene.on("dragstart", this.onDragStart);
|
|
59
|
-
this.scene.on("dragging", this.onDragging);
|
|
60
|
-
this.scene.on("dragend", this.onDragEnd);
|
|
61
|
-
this.isEnable = true;
|
|
62
|
-
}
|
|
63
|
-
disable() {
|
|
64
|
-
if (!this.isEnable) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this.scene.setMapStatus({
|
|
68
|
-
dragEnable: true
|
|
69
|
-
});
|
|
70
|
-
this.container.style.cursor = "auto";
|
|
71
|
-
this.scene.off("dragstart", this.onDragStart);
|
|
72
|
-
this.scene.off("dragging", this.onDragging);
|
|
73
|
-
this.scene.off("dragend", this.onDragEnd);
|
|
74
|
-
this.isEnable = false;
|
|
75
|
-
}
|
|
76
|
-
syncBoxBound() {
|
|
77
|
-
const { x: x1, y: y1 } = this.startEvent;
|
|
78
|
-
const { x: x2, y: y2 } = this.endEvent;
|
|
79
|
-
const left = Math.min(x1, x2);
|
|
80
|
-
const top = Math.min(y1, y2);
|
|
81
|
-
const width = Math.abs(x1 - x2);
|
|
82
|
-
const height = Math.abs(y1 - y2);
|
|
83
|
-
this.box.style.top = `${top}px`;
|
|
84
|
-
this.box.style.left = `${left}px`;
|
|
85
|
-
this.box.style.width = `${width}px`;
|
|
86
|
-
this.box.style.height = `${height}px`;
|
|
87
|
-
}
|
|
88
|
-
getLngLatBox() {
|
|
89
|
-
const {
|
|
90
|
-
lngLat: { lng: lng1, lat: lat1 }
|
|
91
|
-
} = this.startEvent;
|
|
92
|
-
const {
|
|
93
|
-
lngLat: { lng: lng2, lat: lat2 }
|
|
94
|
-
} = this.endEvent;
|
|
95
|
-
return getBBoxFromPoints([
|
|
96
|
-
[lng1, lat1],
|
|
97
|
-
[lng2, lat2]
|
|
98
|
-
]);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
export {
|
|
102
|
-
BoxSelectEventList,
|
|
103
|
-
BoxSelect as default
|
|
104
|
-
};
|
package/es/index.d.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import type { Bounds, ICameraOptions, IControl, IDebugService, IIconFontGlyph, IImage, ILayer, ILngLat, IMapService, IMarker, IMarkerLayer, IPoint, IPopup, IPostProcessingPass, ISceneConfig, IStatusOptions, L7Container, Point } from '@antv/l7-core';
|
|
2
|
-
import type { IProtocolHandler } from '@antv/l7-utils';
|
|
3
|
-
import type ILayerManager from './ILayerManager';
|
|
4
|
-
import type IMapController from './IMapController';
|
|
5
|
-
import type IPostProcessingPassPluggable from './IPostProcessingPassPluggable';
|
|
6
|
-
/**
|
|
7
|
-
* 暴露 Scene API
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* import { Scene } from 'l7/scene';
|
|
11
|
-
* import { PointLayer } from 'l7/layers';
|
|
12
|
-
*
|
|
13
|
-
* const scene = new Scene();
|
|
14
|
-
* const pointLayer = new PointLayer();
|
|
15
|
-
* scene.addLayer(pointLayer);
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
declare class Scene implements IPostProcessingPassPluggable, IMapController, ILayerManager {
|
|
19
|
-
private sceneService;
|
|
20
|
-
private mapService;
|
|
21
|
-
private controlService;
|
|
22
|
-
private layerService;
|
|
23
|
-
private debugService;
|
|
24
|
-
private iconService;
|
|
25
|
-
private markerService;
|
|
26
|
-
private popupService;
|
|
27
|
-
private fontService;
|
|
28
|
-
private interactionService;
|
|
29
|
-
private boxSelect;
|
|
30
|
-
private container;
|
|
31
|
-
constructor(config: ISceneConfig);
|
|
32
|
-
get map(): unknown;
|
|
33
|
-
get loaded(): boolean;
|
|
34
|
-
getServiceContainer(): L7Container;
|
|
35
|
-
getSize(): [number, number];
|
|
36
|
-
getMinZoom(): number;
|
|
37
|
-
getMaxZoom(): number;
|
|
38
|
-
getType(): string;
|
|
39
|
-
getMapContainer(): HTMLElement | null;
|
|
40
|
-
getMapCanvasContainer(): HTMLElement;
|
|
41
|
-
getMapService(): IMapService<unknown>;
|
|
42
|
-
/**
|
|
43
|
-
* 对外暴露 debugService
|
|
44
|
-
* @returns
|
|
45
|
-
*/
|
|
46
|
-
getDebugService(): IDebugService;
|
|
47
|
-
exportPng(type?: 'png' | 'jpg'): Promise<string>;
|
|
48
|
-
exportMap(type?: 'png' | 'jpg'): Promise<string>;
|
|
49
|
-
registerRenderService(render: any): void;
|
|
50
|
-
setBgColor(color: string): void;
|
|
51
|
-
addLayer(layer: ILayer): void;
|
|
52
|
-
preAddLayer(layer: ILayer): void;
|
|
53
|
-
initMask(layer: ILayer): ILayer | undefined;
|
|
54
|
-
addMask(mask: ILayer, layerId: string): void;
|
|
55
|
-
getPickedLayer(): number;
|
|
56
|
-
getLayers(): ILayer[];
|
|
57
|
-
getLayer(id: string): ILayer | undefined;
|
|
58
|
-
getLayerByName(name: string): ILayer | undefined;
|
|
59
|
-
removeLayer(layer: ILayer, parentLayer?: ILayer): Promise<void>;
|
|
60
|
-
removeAllLayer(): Promise<void>;
|
|
61
|
-
render(): void;
|
|
62
|
-
setEnableRender(flag: boolean): void;
|
|
63
|
-
/**
|
|
64
|
-
* 为 layer/point/text 支持 iconfont 模式支持
|
|
65
|
-
* @param fontUnicode
|
|
66
|
-
* @param name
|
|
67
|
-
*/
|
|
68
|
-
addIconFont(name: string, fontUnicode: string): void;
|
|
69
|
-
addIconFonts(options: string[][]): void;
|
|
70
|
-
/**
|
|
71
|
-
* 用户自定义添加第三方字体
|
|
72
|
-
* @param fontFamily
|
|
73
|
-
* @param fontPath
|
|
74
|
-
*/
|
|
75
|
-
addFontFace(fontFamily: string, fontPath: string): void;
|
|
76
|
-
addImage(id: string, img: IImage): Promise<void>;
|
|
77
|
-
hasImage(id: string): boolean;
|
|
78
|
-
removeImage(id: string): void;
|
|
79
|
-
addIconFontGlyphs(fontFamily: string, glyphs: IIconFontGlyph[]): void;
|
|
80
|
-
addControl(ctr: IControl): void;
|
|
81
|
-
removeControl(ctr: IControl): void;
|
|
82
|
-
getControlByName(name: string): IControl<any> | undefined;
|
|
83
|
-
addMarker(marker: IMarker): void;
|
|
84
|
-
addMarkerLayer(layer: IMarkerLayer): void;
|
|
85
|
-
removeMarkerLayer(layer: IMarkerLayer): void;
|
|
86
|
-
removeAllMarkers(): void;
|
|
87
|
-
/**
|
|
88
|
-
* @deprecated 请使用 removeAllMarkers
|
|
89
|
-
*/
|
|
90
|
-
removeAllMakers(): void;
|
|
91
|
-
addPopup(popup: IPopup): void;
|
|
92
|
-
removePopup(popup: IPopup): void;
|
|
93
|
-
on(type: string, handle: (...args: any[]) => void): void;
|
|
94
|
-
once(type: string, handle: (...args: any[]) => void): void;
|
|
95
|
-
emit(type: string, ...args: any[]): void;
|
|
96
|
-
off(type: string, handle: (...args: any[]) => void): void;
|
|
97
|
-
getZoom(): number;
|
|
98
|
-
getCenter(options?: ICameraOptions): ILngLat;
|
|
99
|
-
setCenter(center: [number, number], options?: ICameraOptions): void;
|
|
100
|
-
getPitch(): number;
|
|
101
|
-
setPitch(pitch: number): void;
|
|
102
|
-
getRotation(): number;
|
|
103
|
-
getBounds(): Bounds;
|
|
104
|
-
setRotation(rotation: number): void;
|
|
105
|
-
zoomIn(): void;
|
|
106
|
-
zoomOut(): void;
|
|
107
|
-
panTo(p: Point): void;
|
|
108
|
-
panBy(x: number, y: number): void;
|
|
109
|
-
getContainer(): HTMLElement | null;
|
|
110
|
-
setZoom(zoom: number): void;
|
|
111
|
-
fitBounds(bound: Bounds, options?: unknown): void;
|
|
112
|
-
setZoomAndCenter(zoom: number, center: Point): void;
|
|
113
|
-
setMapStyle(style: any): void;
|
|
114
|
-
setMapStatus(options: Partial<IStatusOptions>): void;
|
|
115
|
-
pixelToLngLat(pixel: Point): ILngLat;
|
|
116
|
-
lngLatToPixel(lnglat: Point): IPoint;
|
|
117
|
-
containerToLngLat(pixel: Point): ILngLat;
|
|
118
|
-
lngLatToContainer(lnglat: Point): IPoint;
|
|
119
|
-
destroy(): void;
|
|
120
|
-
/**
|
|
121
|
-
* 注册自定义后处理效果
|
|
122
|
-
* @param constructor 后处理效果构造函数
|
|
123
|
-
* @param name 后处理效果名称,便于在 Layer 中引用
|
|
124
|
-
*/
|
|
125
|
-
registerPostProcessingPass(constructor: new (...args: any[]) => IPostProcessingPass<unknown>, name: string): void;
|
|
126
|
-
enableShaderPick(): void;
|
|
127
|
-
disableShaderPick(): void;
|
|
128
|
-
/**
|
|
129
|
-
* @deprecated 请使用 disableShaderPick
|
|
130
|
-
*/
|
|
131
|
-
diasbleShaderPick(): void;
|
|
132
|
-
enableBoxSelect(once?: boolean): void;
|
|
133
|
-
disableBoxSelect(): void;
|
|
134
|
-
static addProtocol(protocol: string, handler: IProtocolHandler): void;
|
|
135
|
-
static removeProtocol(protocol: string): void;
|
|
136
|
-
getProtocol(protocol: string): IProtocolHandler;
|
|
137
|
-
startAnimate(): void;
|
|
138
|
-
stopAnimate(): void;
|
|
139
|
-
getPointSizeRange(): Float32Array;
|
|
140
|
-
private initComponent;
|
|
141
|
-
private initControl;
|
|
142
|
-
private initTileLayer;
|
|
143
|
-
}
|
|
144
|
-
export { Scene };
|