@antv/l7-scene 2.19.10 → 2.20.0

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.js CHANGED
@@ -7,7 +7,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
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
- import { ReglRendererService } from '@antv/l7-renderer';
10
+ import { DeviceRendererService, ReglRendererService } from '@antv/l7-renderer';
11
11
  import { DOM, SceneConifg } from '@antv/l7-utils';
12
12
  import BoxSelect, { BoxSelectEventList } from "./boxSelect";
13
13
  /**
@@ -28,7 +28,9 @@ var Scene = /*#__PURE__*/function () {
28
28
  var id = config.id,
29
29
  map = config.map,
30
30
  canvas = config.canvas,
31
- hasBaseMap = config.hasBaseMap;
31
+ hasBaseMap = config.hasBaseMap,
32
+ _config$renderer = config.renderer,
33
+ renderer = _config$renderer === void 0 ? 'regl' : _config$renderer;
32
34
  // 创建场景容器
33
35
  var sceneContainer = createSceneContainer();
34
36
  this.container = sceneContainer;
@@ -36,7 +38,7 @@ var Scene = /*#__PURE__*/function () {
36
38
  map.setContainer(sceneContainer, id, canvas, hasBaseMap);
37
39
 
38
40
  // 绑定渲染引擎服务
39
- sceneContainer.bind(TYPES.IRendererService).to(ReglRendererService).inSingletonScope();
41
+ sceneContainer.bind(TYPES.IRendererService).to(renderer === 'regl' ? ReglRendererService : DeviceRendererService).inSingletonScope();
40
42
 
41
43
  // 依赖注入
42
44
  this.sceneService = sceneContainer.get(TYPES.ISceneService);
@@ -436,7 +438,7 @@ var Scene = /*#__PURE__*/function () {
436
438
  value: function on(type, handle) {
437
439
  if (BoxSelectEventList.includes(type)) {
438
440
  var _this$boxSelect;
439
- (_this$boxSelect = this.boxSelect) === null || _this$boxSelect === void 0 ? void 0 : _this$boxSelect.on(type, handle);
441
+ (_this$boxSelect = this.boxSelect) === null || _this$boxSelect === void 0 || _this$boxSelect.on(type, handle);
440
442
  } else if (SceneEventList.includes(type)) {
441
443
  this.sceneService.on(type, handle);
442
444
  } else {
@@ -448,7 +450,7 @@ var Scene = /*#__PURE__*/function () {
448
450
  value: function once(type, handle) {
449
451
  if (BoxSelectEventList.includes(type)) {
450
452
  var _this$boxSelect2;
451
- (_this$boxSelect2 = this.boxSelect) === null || _this$boxSelect2 === void 0 ? void 0 : _this$boxSelect2.once(type, handle);
453
+ (_this$boxSelect2 = this.boxSelect) === null || _this$boxSelect2 === void 0 || _this$boxSelect2.once(type, handle);
452
454
  } else if (SceneEventList.includes(type)) {
453
455
  this.sceneService.once(type, handle);
454
456
  } else {
@@ -465,7 +467,7 @@ var Scene = /*#__PURE__*/function () {
465
467
  value: function off(type, handle) {
466
468
  if (BoxSelectEventList.includes(type)) {
467
469
  var _this$boxSelect3;
468
- (_this$boxSelect3 = this.boxSelect) === null || _this$boxSelect3 === void 0 ? void 0 : _this$boxSelect3.off(type, handle);
470
+ (_this$boxSelect3 = this.boxSelect) === null || _this$boxSelect3 === void 0 || _this$boxSelect3.off(type, handle);
469
471
  } else if (SceneEventList.includes(type)) {
470
472
  this.sceneService.off(type, handle);
471
473
  } else {
package/lib/index.js CHANGED
@@ -40,11 +40,11 @@ var import_l7_utils = require("@antv/l7-utils");
40
40
  var import_boxSelect = __toESM(require("./boxSelect"));
41
41
  var Scene = class {
42
42
  constructor(config) {
43
- const { id, map, canvas, hasBaseMap } = config;
43
+ const { id, map, canvas, hasBaseMap, renderer = "regl" } = config;
44
44
  const sceneContainer = (0, import_l7_core.createSceneContainer)();
45
45
  this.container = sceneContainer;
46
46
  map.setContainer(sceneContainer, id, canvas, hasBaseMap);
47
- sceneContainer.bind(import_l7_core.TYPES.IRendererService).to(import_l7_renderer.ReglRendererService).inSingletonScope();
47
+ sceneContainer.bind(import_l7_core.TYPES.IRendererService).to(renderer === "regl" ? import_l7_renderer.ReglRendererService : import_l7_renderer.DeviceRendererService).inSingletonScope();
48
48
  this.sceneService = sceneContainer.get(import_l7_core.TYPES.ISceneService);
49
49
  this.mapService = sceneContainer.get(
50
50
  import_l7_core.TYPES.IMapService
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-scene",
3
- "version": "2.19.10",
3
+ "version": "2.20.0",
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.19.10",
27
- "@antv/l7-core": "2.19.10",
28
- "@antv/l7-layers": "2.19.10",
29
- "@antv/l7-maps": "2.19.10",
30
- "@antv/l7-renderer": "2.19.10",
31
- "@antv/l7-utils": "2.19.10",
26
+ "@antv/l7-component": "2.20.0",
27
+ "@antv/l7-core": "2.20.0",
28
+ "@antv/l7-layers": "2.20.0",
29
+ "@antv/l7-maps": "2.20.0",
30
+ "@antv/l7-renderer": "2.20.0",
31
+ "@antv/l7-utils": "2.20.0",
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.19.10"
39
+ "@antv/l7-test-utils": "2.20.0"
40
40
  },
41
- "gitHead": "150d3dc74f975ad10d48868612b6f978e4bbce85",
41
+ "gitHead": "6b1a6b52bae44b05336459d4d80f7cace21da6f1",
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  }