@antv/l7-scene 2.11.7 → 2.12.1
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/IMapController.d.ts +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +64 -17
- package/lib/index.js +5 -4
- package/package.json +9 -9
package/es/IMapController.d.ts
CHANGED
|
@@ -58,5 +58,5 @@ export default interface IMapController {
|
|
|
58
58
|
lngLatToPixel(lnglat: Point): IPoint;
|
|
59
59
|
containerToLngLat(pixel: Point): ILngLat;
|
|
60
60
|
lngLatToContainer(lnglat: Point): IPoint;
|
|
61
|
-
exportMap(type: 'jpg' | 'png'): string
|
|
61
|
+
exportMap(type: 'jpg' | 'png'): Promise<string>;
|
|
62
62
|
}
|
package/es/index.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ declare class Scene implements IPostProcessingPassPluggable, IMapController, ILa
|
|
|
38
38
|
getMapContainer(): HTMLElement | null;
|
|
39
39
|
getMapCanvasContainer(): HTMLElement;
|
|
40
40
|
getMapService(): IMapService<unknown>;
|
|
41
|
-
exportPng(type?: 'png' | 'jpg'): string
|
|
42
|
-
exportMap(type?: 'png' | 'jpg'): string
|
|
41
|
+
exportPng(type?: 'png' | 'jpg'): Promise<string>;
|
|
42
|
+
exportMap(type?: 'png' | 'jpg'): Promise<string>;
|
|
43
43
|
registerRenderService(render: any): void;
|
|
44
44
|
setBgColor(color: string): void;
|
|
45
45
|
addLayer(layer: ILayer): void;
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
@@ -8,7 +8,7 @@ import { Logo } from '@antv/l7-component';
|
|
|
8
8
|
import { createLayerContainer, createSceneContainer, SceneEventList, TYPES } from '@antv/l7-core';
|
|
9
9
|
import { MaskLayer } from '@antv/l7-layers';
|
|
10
10
|
import { ReglRendererService } from '@antv/l7-renderer';
|
|
11
|
-
import { DOM, isMini } from '@antv/l7-utils';
|
|
11
|
+
import { DOM, isMini, setMiniScene } from '@antv/l7-utils';
|
|
12
12
|
import BoxSelect, { BoxSelectEventList } from "./boxSelect";
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -49,6 +49,7 @@ var Scene = /*#__PURE__*/function () {
|
|
|
49
49
|
this.interactionService = sceneContainer.get(TYPES.IInteractionService);
|
|
50
50
|
this.popupService = sceneContainer.get(TYPES.IPopupService);
|
|
51
51
|
this.boxSelect = new BoxSelect(this, {});
|
|
52
|
+
setMiniScene((config === null || config === void 0 ? void 0 : config.isMini) || false);
|
|
52
53
|
|
|
53
54
|
if (isMini) {
|
|
54
55
|
this.sceneService.initMiniScene(config);
|
|
@@ -113,14 +114,60 @@ var Scene = /*#__PURE__*/function () {
|
|
|
113
114
|
}
|
|
114
115
|
}, {
|
|
115
116
|
key: "exportPng",
|
|
116
|
-
value: function
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
value: function () {
|
|
118
|
+
var _exportPng = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(type) {
|
|
119
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
120
|
+
while (1) {
|
|
121
|
+
switch (_context.prev = _context.next) {
|
|
122
|
+
case 0:
|
|
123
|
+
_context.next = 2;
|
|
124
|
+
return this.sceneService.exportPng(type);
|
|
125
|
+
|
|
126
|
+
case 2:
|
|
127
|
+
return _context.abrupt("return", _context.sent);
|
|
128
|
+
|
|
129
|
+
case 3:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context.stop();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}, _callee, this);
|
|
135
|
+
}));
|
|
136
|
+
|
|
137
|
+
function exportPng(_x) {
|
|
138
|
+
return _exportPng.apply(this, arguments);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return exportPng;
|
|
142
|
+
}()
|
|
119
143
|
}, {
|
|
120
144
|
key: "exportMap",
|
|
121
|
-
value: function
|
|
122
|
-
|
|
123
|
-
|
|
145
|
+
value: function () {
|
|
146
|
+
var _exportMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(type) {
|
|
147
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
148
|
+
while (1) {
|
|
149
|
+
switch (_context2.prev = _context2.next) {
|
|
150
|
+
case 0:
|
|
151
|
+
_context2.next = 2;
|
|
152
|
+
return this.sceneService.exportPng(type);
|
|
153
|
+
|
|
154
|
+
case 2:
|
|
155
|
+
return _context2.abrupt("return", _context2.sent);
|
|
156
|
+
|
|
157
|
+
case 3:
|
|
158
|
+
case "end":
|
|
159
|
+
return _context2.stop();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}, _callee2, this);
|
|
163
|
+
}));
|
|
164
|
+
|
|
165
|
+
function exportMap(_x2) {
|
|
166
|
+
return _exportMap.apply(this, arguments);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return exportMap;
|
|
170
|
+
}()
|
|
124
171
|
}, {
|
|
125
172
|
key: "registerRenderService",
|
|
126
173
|
value: function registerRenderService(render) {
|
|
@@ -281,21 +328,21 @@ var Scene = /*#__PURE__*/function () {
|
|
|
281
328
|
}, {
|
|
282
329
|
key: "addImage",
|
|
283
330
|
value: function () {
|
|
284
|
-
var _addImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
285
|
-
return _regeneratorRuntime.wrap(function
|
|
331
|
+
var _addImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, img) {
|
|
332
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
286
333
|
while (1) {
|
|
287
|
-
switch (
|
|
334
|
+
switch (_context3.prev = _context3.next) {
|
|
288
335
|
case 0:
|
|
289
336
|
if (isMini) {
|
|
290
|
-
|
|
337
|
+
_context3.next = 5;
|
|
291
338
|
break;
|
|
292
339
|
}
|
|
293
340
|
|
|
294
|
-
|
|
341
|
+
_context3.next = 3;
|
|
295
342
|
return this.iconService.addImage(id, img);
|
|
296
343
|
|
|
297
344
|
case 3:
|
|
298
|
-
|
|
345
|
+
_context3.next = 6;
|
|
299
346
|
break;
|
|
300
347
|
|
|
301
348
|
case 5:
|
|
@@ -303,13 +350,13 @@ var Scene = /*#__PURE__*/function () {
|
|
|
303
350
|
|
|
304
351
|
case 6:
|
|
305
352
|
case "end":
|
|
306
|
-
return
|
|
353
|
+
return _context3.stop();
|
|
307
354
|
}
|
|
308
355
|
}
|
|
309
|
-
},
|
|
356
|
+
}, _callee3, this);
|
|
310
357
|
}));
|
|
311
358
|
|
|
312
|
-
function addImage(
|
|
359
|
+
function addImage(_x3, _x4) {
|
|
313
360
|
return _addImage.apply(this, arguments);
|
|
314
361
|
}
|
|
315
362
|
|
package/lib/index.js
CHANGED
|
@@ -48,6 +48,7 @@ var Scene = class {
|
|
|
48
48
|
this.interactionService = sceneContainer.get(import_l7_core.TYPES.IInteractionService);
|
|
49
49
|
this.popupService = sceneContainer.get(import_l7_core.TYPES.IPopupService);
|
|
50
50
|
this.boxSelect = new import_boxSelect.default(this, {});
|
|
51
|
+
(0, import_l7_utils.setMiniScene)((config == null ? void 0 : config.isMini) || false);
|
|
51
52
|
if (import_l7_utils.isMini) {
|
|
52
53
|
this.sceneService.initMiniScene(config);
|
|
53
54
|
} else {
|
|
@@ -86,11 +87,11 @@ var Scene = class {
|
|
|
86
87
|
getMapService() {
|
|
87
88
|
return this.mapService;
|
|
88
89
|
}
|
|
89
|
-
exportPng(type) {
|
|
90
|
-
return this.sceneService.exportPng(type);
|
|
90
|
+
async exportPng(type) {
|
|
91
|
+
return await this.sceneService.exportPng(type);
|
|
91
92
|
}
|
|
92
|
-
exportMap(type) {
|
|
93
|
-
return this.sceneService.exportPng(type);
|
|
93
|
+
async exportMap(type) {
|
|
94
|
+
return await this.sceneService.exportPng(type);
|
|
94
95
|
}
|
|
95
96
|
registerRenderService(render) {
|
|
96
97
|
if (this.sceneService.loaded) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-scene",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.1",
|
|
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.
|
|
27
|
-
"@antv/l7-core": "2.
|
|
28
|
-
"@antv/l7-layers": "2.
|
|
29
|
-
"@antv/l7-maps": "2.
|
|
30
|
-
"@antv/l7-renderer": "2.
|
|
31
|
-
"@antv/l7-utils": "2.
|
|
26
|
+
"@antv/l7-component": "2.12.1",
|
|
27
|
+
"@antv/l7-core": "2.12.1",
|
|
28
|
+
"@antv/l7-layers": "2.12.1",
|
|
29
|
+
"@antv/l7-maps": "2.12.1",
|
|
30
|
+
"@antv/l7-renderer": "2.12.1",
|
|
31
|
+
"@antv/l7-utils": "2.12.1",
|
|
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.
|
|
39
|
+
"@antv/l7-test-utils": "2.12.1"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "9e483bb35d0a9afeed94b3d68ce4b136e8356a32",
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
}
|