@antv/l7-scene 2.13.4 → 2.13.6
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/index.d.ts +7 -1
- package/es/index.js +12 -0
- package/lib/boxSelect.js +11 -2
- package/lib/index.js +34 -12
- package/package.json +9 -9
package/es/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bounds, ICameraOptions, IControl, IIconFontGlyph, IImage, ILayer, ILngLat, IMapService, IMarker, IMarkerLayer, IPoint, IPopup, IPostProcessingPass, ISceneConfig, IStatusOptions, Point } from '@antv/l7-core';
|
|
1
|
+
import { Bounds, ICameraOptions, IControl, IIconFontGlyph, IImage, ILayer, IDebugService, ILngLat, IMapService, IMarker, IMarkerLayer, IPoint, IPopup, IPostProcessingPass, ISceneConfig, IStatusOptions, Point } from '@antv/l7-core';
|
|
2
2
|
import { Container } from 'inversify';
|
|
3
3
|
import ILayerManager from './ILayerManager';
|
|
4
4
|
import IMapController from './IMapController';
|
|
@@ -20,6 +20,7 @@ declare class Scene implements IPostProcessingPassPluggable, IMapController, ILa
|
|
|
20
20
|
private mapService;
|
|
21
21
|
private controlService;
|
|
22
22
|
private layerService;
|
|
23
|
+
private debugService;
|
|
23
24
|
private iconService;
|
|
24
25
|
private markerService;
|
|
25
26
|
private popupService;
|
|
@@ -38,6 +39,11 @@ declare class Scene implements IPostProcessingPassPluggable, IMapController, ILa
|
|
|
38
39
|
getMapContainer(): HTMLElement | null;
|
|
39
40
|
getMapCanvasContainer(): HTMLElement;
|
|
40
41
|
getMapService(): IMapService<unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* 对外暴露 debugService
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
getDebugService(): IDebugService;
|
|
41
47
|
exportPng(type?: 'png' | 'jpg'): Promise<string>;
|
|
42
48
|
exportMap(type?: 'png' | 'jpg'): Promise<string>;
|
|
43
49
|
registerRenderService(render: any): void;
|
package/es/index.js
CHANGED
|
@@ -45,6 +45,8 @@ var Scene = /*#__PURE__*/function () {
|
|
|
45
45
|
this.fontService = sceneContainer.get(TYPES.IFontService);
|
|
46
46
|
this.controlService = sceneContainer.get(TYPES.IControlService);
|
|
47
47
|
this.layerService = sceneContainer.get(TYPES.ILayerService);
|
|
48
|
+
this.debugService = sceneContainer.get(TYPES.IDebugService);
|
|
49
|
+
this.debugService.setEnable(config.debug);
|
|
48
50
|
this.markerService = sceneContainer.get(TYPES.IMarkerService);
|
|
49
51
|
this.interactionService = sceneContainer.get(TYPES.IInteractionService);
|
|
50
52
|
this.popupService = sceneContainer.get(TYPES.IPopupService);
|
|
@@ -112,6 +114,16 @@ var Scene = /*#__PURE__*/function () {
|
|
|
112
114
|
value: function getMapService() {
|
|
113
115
|
return this.mapService;
|
|
114
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* 对外暴露 debugService
|
|
119
|
+
* @returns
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
}, {
|
|
123
|
+
key: "getDebugService",
|
|
124
|
+
value: function getDebugService() {
|
|
125
|
+
return this.debugService;
|
|
126
|
+
}
|
|
115
127
|
}, {
|
|
116
128
|
key: "exportPng",
|
|
117
129
|
value: function () {
|
package/lib/boxSelect.js
CHANGED
|
@@ -34,7 +34,12 @@ var BoxSelect = class extends import_eventemitter3.EventEmitter {
|
|
|
34
34
|
this.box.style.display = "block";
|
|
35
35
|
this.startEvent = this.endEvent = e;
|
|
36
36
|
this.syncBoxBound();
|
|
37
|
-
this.emit(
|
|
37
|
+
this.emit(
|
|
38
|
+
"selectstart",
|
|
39
|
+
this.getLngLatBox(),
|
|
40
|
+
this.startEvent,
|
|
41
|
+
this.endEvent
|
|
42
|
+
);
|
|
38
43
|
};
|
|
39
44
|
this.onDragging = (e) => {
|
|
40
45
|
this.endEvent = e;
|
|
@@ -62,7 +67,11 @@ var BoxSelect = class extends import_eventemitter3.EventEmitter {
|
|
|
62
67
|
});
|
|
63
68
|
this.container.style.cursor = "crosshair";
|
|
64
69
|
if (!this.box) {
|
|
65
|
-
const box = import_l7_utils.DOM.create(
|
|
70
|
+
const box = import_l7_utils.DOM.create(
|
|
71
|
+
"div",
|
|
72
|
+
void 0,
|
|
73
|
+
this.container
|
|
74
|
+
);
|
|
66
75
|
box.classList.add("l7-select-box");
|
|
67
76
|
if (className) {
|
|
68
77
|
box.classList.add(className);
|
package/lib/index.js
CHANGED
|
@@ -16,7 +16,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
20
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
24
|
|
|
22
25
|
// src/index.ts
|
|
@@ -39,13 +42,23 @@ var Scene = class {
|
|
|
39
42
|
map.setContainer(sceneContainer, id, canvas, hasBaseMap);
|
|
40
43
|
sceneContainer.bind(import_l7_core.TYPES.IRendererService).to(import_l7_renderer.ReglRendererService).inSingletonScope();
|
|
41
44
|
this.sceneService = sceneContainer.get(import_l7_core.TYPES.ISceneService);
|
|
42
|
-
this.mapService = sceneContainer.get(
|
|
45
|
+
this.mapService = sceneContainer.get(
|
|
46
|
+
import_l7_core.TYPES.IMapService
|
|
47
|
+
);
|
|
43
48
|
this.iconService = sceneContainer.get(import_l7_core.TYPES.IIconService);
|
|
44
49
|
this.fontService = sceneContainer.get(import_l7_core.TYPES.IFontService);
|
|
45
|
-
this.controlService = sceneContainer.get(
|
|
50
|
+
this.controlService = sceneContainer.get(
|
|
51
|
+
import_l7_core.TYPES.IControlService
|
|
52
|
+
);
|
|
46
53
|
this.layerService = sceneContainer.get(import_l7_core.TYPES.ILayerService);
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
54
|
+
this.debugService = sceneContainer.get(import_l7_core.TYPES.IDebugService);
|
|
55
|
+
this.debugService.setEnable(config.debug);
|
|
56
|
+
this.markerService = sceneContainer.get(
|
|
57
|
+
import_l7_core.TYPES.IMarkerService
|
|
58
|
+
);
|
|
59
|
+
this.interactionService = sceneContainer.get(
|
|
60
|
+
import_l7_core.TYPES.IInteractionService
|
|
61
|
+
);
|
|
49
62
|
this.popupService = sceneContainer.get(import_l7_core.TYPES.IPopupService);
|
|
50
63
|
this.boxSelect = new import_boxSelect.default(this, {});
|
|
51
64
|
(0, import_l7_utils.setMiniScene)((config == null ? void 0 : config.isMini) || false);
|
|
@@ -87,6 +100,9 @@ var Scene = class {
|
|
|
87
100
|
getMapService() {
|
|
88
101
|
return this.mapService;
|
|
89
102
|
}
|
|
103
|
+
getDebugService() {
|
|
104
|
+
return this.debugService;
|
|
105
|
+
}
|
|
90
106
|
async exportPng(type) {
|
|
91
107
|
return await this.sceneService.exportPng(type);
|
|
92
108
|
}
|
|
@@ -307,10 +323,13 @@ var Scene = class {
|
|
|
307
323
|
}
|
|
308
324
|
fitBounds(bound, options) {
|
|
309
325
|
const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();
|
|
310
|
-
this.mapService.fitBounds(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
326
|
+
this.mapService.fitBounds(
|
|
327
|
+
bound,
|
|
328
|
+
options || {
|
|
329
|
+
...fitBoundsOptions,
|
|
330
|
+
animate
|
|
331
|
+
}
|
|
332
|
+
);
|
|
314
333
|
}
|
|
315
334
|
setZoomAndCenter(zoom, center) {
|
|
316
335
|
this.mapService.setZoomAndCenter(zoom, center);
|
|
@@ -360,9 +379,12 @@ var Scene = class {
|
|
|
360
379
|
return this.sceneService.getPointSizeRange();
|
|
361
380
|
}
|
|
362
381
|
initComponent(id) {
|
|
363
|
-
this.controlService.init(
|
|
364
|
-
|
|
365
|
-
|
|
382
|
+
this.controlService.init(
|
|
383
|
+
{
|
|
384
|
+
container: import_l7_utils.DOM.getContainer(id)
|
|
385
|
+
},
|
|
386
|
+
this.container
|
|
387
|
+
);
|
|
366
388
|
this.markerService.init(this.container);
|
|
367
389
|
this.popupService.init(this.container);
|
|
368
390
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-scene",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"author": "xiaoiver",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@antv/l7-component": "2.13.
|
|
27
|
-
"@antv/l7-core": "2.13.
|
|
28
|
-
"@antv/l7-layers": "2.13.
|
|
29
|
-
"@antv/l7-maps": "2.13.
|
|
30
|
-
"@antv/l7-renderer": "2.13.
|
|
31
|
-
"@antv/l7-utils": "2.13.
|
|
26
|
+
"@antv/l7-component": "2.13.6",
|
|
27
|
+
"@antv/l7-core": "2.13.6",
|
|
28
|
+
"@antv/l7-layers": "2.13.6",
|
|
29
|
+
"@antv/l7-maps": "2.13.6",
|
|
30
|
+
"@antv/l7-renderer": "2.13.6",
|
|
31
|
+
"@antv/l7-utils": "2.13.6",
|
|
32
32
|
"@babel/runtime": "^7.7.7",
|
|
33
33
|
"eventemitter3": "^4.0.7",
|
|
34
34
|
"inversify": "^5.0.1",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"reflect-metadata": "^0.1.13"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@antv/l7-test-utils": "2.13.
|
|
39
|
+
"@antv/l7-test-utils": "2.13.6"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "dc11ec312f2078704e548ba540d3289e1f752441",
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
}
|