@antv/l7-scene 2.13.1 → 2.13.3

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 CHANGED
@@ -49,8 +49,8 @@ declare class Scene implements IPostProcessingPassPluggable, IMapController, ILa
49
49
  getLayers(): ILayer[];
50
50
  getLayer(id: string): ILayer | undefined;
51
51
  getLayerByName(name: string): ILayer | undefined;
52
- removeLayer(layer: ILayer, parentLayer?: ILayer): void;
53
- removeAllLayer(): void;
52
+ removeLayer(layer: ILayer, parentLayer?: ILayer): Promise<void>;
53
+ removeAllLayer(): Promise<void>;
54
54
  render(): void;
55
55
  setEnableRender(flag: boolean): void;
56
56
  /**
package/es/index.js CHANGED
@@ -266,14 +266,54 @@ var Scene = /*#__PURE__*/function () {
266
266
  }
267
267
  }, {
268
268
  key: "removeLayer",
269
- value: function removeLayer(layer, parentLayer) {
270
- this.layerService.remove(layer, parentLayer);
271
- }
269
+ value: function () {
270
+ var _removeLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(layer, parentLayer) {
271
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
272
+ while (1) {
273
+ switch (_context3.prev = _context3.next) {
274
+ case 0:
275
+ _context3.next = 2;
276
+ return this.layerService.remove(layer, parentLayer);
277
+
278
+ case 2:
279
+ case "end":
280
+ return _context3.stop();
281
+ }
282
+ }
283
+ }, _callee3, this);
284
+ }));
285
+
286
+ function removeLayer(_x3, _x4) {
287
+ return _removeLayer.apply(this, arguments);
288
+ }
289
+
290
+ return removeLayer;
291
+ }()
272
292
  }, {
273
293
  key: "removeAllLayer",
274
- value: function removeAllLayer() {
275
- this.layerService.removeAllLayers();
276
- }
294
+ value: function () {
295
+ var _removeAllLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
296
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
297
+ while (1) {
298
+ switch (_context4.prev = _context4.next) {
299
+ case 0:
300
+ _context4.next = 2;
301
+ return this.layerService.removeAllLayers();
302
+
303
+ case 2:
304
+ case "end":
305
+ return _context4.stop();
306
+ }
307
+ }
308
+ }, _callee4, this);
309
+ }));
310
+
311
+ function removeAllLayer() {
312
+ return _removeAllLayer.apply(this, arguments);
313
+ }
314
+
315
+ return removeAllLayer;
316
+ }()
277
317
  }, {
278
318
  key: "render",
279
319
  value: function render() {
@@ -328,21 +368,21 @@ var Scene = /*#__PURE__*/function () {
328
368
  }, {
329
369
  key: "addImage",
330
370
  value: function () {
331
- var _addImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, img) {
332
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
371
+ var _addImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, img) {
372
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
333
373
  while (1) {
334
- switch (_context3.prev = _context3.next) {
374
+ switch (_context5.prev = _context5.next) {
335
375
  case 0:
336
376
  if (isMini) {
337
- _context3.next = 5;
377
+ _context5.next = 5;
338
378
  break;
339
379
  }
340
380
 
341
- _context3.next = 3;
381
+ _context5.next = 3;
342
382
  return this.iconService.addImage(id, img);
343
383
 
344
384
  case 3:
345
- _context3.next = 6;
385
+ _context5.next = 6;
346
386
  break;
347
387
 
348
388
  case 5:
@@ -350,13 +390,13 @@ var Scene = /*#__PURE__*/function () {
350
390
 
351
391
  case 6:
352
392
  case "end":
353
- return _context3.stop();
393
+ return _context5.stop();
354
394
  }
355
395
  }
356
- }, _callee3, this);
396
+ }, _callee5, this);
357
397
  }));
358
398
 
359
- function addImage(_x3, _x4) {
399
+ function addImage(_x5, _x6) {
360
400
  return _addImage.apply(this, arguments);
361
401
  }
362
402
 
package/lib/boxSelect.js CHANGED
@@ -34,12 +34,7 @@ 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(
38
- "selectstart",
39
- this.getLngLatBox(),
40
- this.startEvent,
41
- this.endEvent
42
- );
37
+ this.emit("selectstart", this.getLngLatBox(), this.startEvent, this.endEvent);
43
38
  };
44
39
  this.onDragging = (e) => {
45
40
  this.endEvent = e;
@@ -67,11 +62,7 @@ var BoxSelect = class extends import_eventemitter3.EventEmitter {
67
62
  });
68
63
  this.container.style.cursor = "crosshair";
69
64
  if (!this.box) {
70
- const box = import_l7_utils.DOM.create(
71
- "div",
72
- void 0,
73
- this.container
74
- );
65
+ const box = import_l7_utils.DOM.create("div", void 0, this.container);
75
66
  box.classList.add("l7-select-box");
76
67
  if (className) {
77
68
  box.classList.add(className);
package/lib/index.js CHANGED
@@ -16,10 +16,7 @@ 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(
20
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
- mod
22
- ));
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
23
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
24
21
 
25
22
  // src/index.ts
@@ -42,21 +39,13 @@ var Scene = class {
42
39
  map.setContainer(sceneContainer, id, canvas, hasBaseMap);
43
40
  sceneContainer.bind(import_l7_core.TYPES.IRendererService).to(import_l7_renderer.ReglRendererService).inSingletonScope();
44
41
  this.sceneService = sceneContainer.get(import_l7_core.TYPES.ISceneService);
45
- this.mapService = sceneContainer.get(
46
- import_l7_core.TYPES.IMapService
47
- );
42
+ this.mapService = sceneContainer.get(import_l7_core.TYPES.IMapService);
48
43
  this.iconService = sceneContainer.get(import_l7_core.TYPES.IIconService);
49
44
  this.fontService = sceneContainer.get(import_l7_core.TYPES.IFontService);
50
- this.controlService = sceneContainer.get(
51
- import_l7_core.TYPES.IControlService
52
- );
45
+ this.controlService = sceneContainer.get(import_l7_core.TYPES.IControlService);
53
46
  this.layerService = sceneContainer.get(import_l7_core.TYPES.ILayerService);
54
- this.markerService = sceneContainer.get(
55
- import_l7_core.TYPES.IMarkerService
56
- );
57
- this.interactionService = sceneContainer.get(
58
- import_l7_core.TYPES.IInteractionService
59
- );
47
+ this.markerService = sceneContainer.get(import_l7_core.TYPES.IMarkerService);
48
+ this.interactionService = sceneContainer.get(import_l7_core.TYPES.IInteractionService);
60
49
  this.popupService = sceneContainer.get(import_l7_core.TYPES.IPopupService);
61
50
  this.boxSelect = new import_boxSelect.default(this, {});
62
51
  (0, import_l7_utils.setMiniScene)((config == null ? void 0 : config.isMini) || false);
@@ -172,11 +161,11 @@ var Scene = class {
172
161
  getLayerByName(name) {
173
162
  return this.layerService.getLayerByName(name);
174
163
  }
175
- removeLayer(layer, parentLayer) {
176
- this.layerService.remove(layer, parentLayer);
164
+ async removeLayer(layer, parentLayer) {
165
+ await this.layerService.remove(layer, parentLayer);
177
166
  }
178
- removeAllLayer() {
179
- this.layerService.removeAllLayers();
167
+ async removeAllLayer() {
168
+ await this.layerService.removeAllLayers();
180
169
  }
181
170
  render() {
182
171
  this.sceneService.render();
@@ -318,13 +307,10 @@ var Scene = class {
318
307
  }
319
308
  fitBounds(bound, options) {
320
309
  const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();
321
- this.mapService.fitBounds(
322
- bound,
323
- options || {
324
- ...fitBoundsOptions,
325
- animate
326
- }
327
- );
310
+ this.mapService.fitBounds(bound, options || {
311
+ ...fitBoundsOptions,
312
+ animate
313
+ });
328
314
  }
329
315
  setZoomAndCenter(zoom, center) {
330
316
  this.mapService.setZoomAndCenter(zoom, center);
@@ -374,12 +360,9 @@ var Scene = class {
374
360
  return this.sceneService.getPointSizeRange();
375
361
  }
376
362
  initComponent(id) {
377
- this.controlService.init(
378
- {
379
- container: import_l7_utils.DOM.getContainer(id)
380
- },
381
- this.container
382
- );
363
+ this.controlService.init({
364
+ container: import_l7_utils.DOM.getContainer(id)
365
+ }, this.container);
383
366
  this.markerService.init(this.container);
384
367
  this.popupService.init(this.container);
385
368
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-scene",
3
- "version": "2.13.1",
3
+ "version": "2.13.3",
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.1",
27
- "@antv/l7-core": "2.13.1",
28
- "@antv/l7-layers": "2.13.1",
29
- "@antv/l7-maps": "2.13.1",
30
- "@antv/l7-renderer": "2.13.1",
31
- "@antv/l7-utils": "2.13.1",
26
+ "@antv/l7-component": "2.13.3",
27
+ "@antv/l7-core": "2.13.3",
28
+ "@antv/l7-layers": "2.13.3",
29
+ "@antv/l7-maps": "2.13.3",
30
+ "@antv/l7-renderer": "2.13.3",
31
+ "@antv/l7-utils": "2.13.3",
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.1"
39
+ "@antv/l7-test-utils": "2.13.3"
40
40
  },
41
- "gitHead": "6a7cbf5974ee1b3f38f926b3eaac97a144013ef2",
41
+ "gitHead": "c737d472363367279bc2fba8c14646a3d4af7bb7",
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  }