@antv/l7-scene 2.9.20 → 2.9.22

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.
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=ILayerManager.js.map
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=IMapController.js.map
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=IPostProcessingPassPluggable.js.map
package/es/index.js CHANGED
@@ -1,50 +1,41 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
4
  import _createClass from "@babel/runtime/helpers/createClass";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
-
6
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
-
8
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
-
10
5
  import { Logo } from '@antv/l7-component';
11
6
  import { createLayerContainer, createSceneContainer, SceneEventList, TYPES } from '@antv/l7-core';
12
7
  import { MaskLayer } from '@antv/l7-layers';
13
8
  import { ReglRendererService } from '@antv/l7-renderer';
14
9
  import { DOM, isMini } from '@antv/l7-utils';
15
10
 
16
- var Scene = function () {
11
+ /**
12
+ * 暴露 Scene API
13
+ *
14
+ * @example
15
+ * import { Scene } from 'l7/scene';
16
+ * import { PointLayer } from 'l7/layers';
17
+ *
18
+ * const scene = new Scene();
19
+ * const pointLayer = new PointLayer();
20
+ * scene.addLayer(pointLayer);
21
+ *
22
+ */
23
+ var Scene = /*#__PURE__*/function () {
17
24
  function Scene(config) {
18
25
  _classCallCheck(this, Scene);
19
26
 
20
- _defineProperty(this, "sceneService", void 0);
21
-
22
- _defineProperty(this, "mapService", void 0);
23
-
24
- _defineProperty(this, "controlService", void 0);
25
-
26
- _defineProperty(this, "layerService", void 0);
27
-
28
- _defineProperty(this, "iconService", void 0);
29
-
30
- _defineProperty(this, "markerService", void 0);
31
-
32
- _defineProperty(this, "popupService", void 0);
33
-
34
- _defineProperty(this, "fontService", void 0);
35
-
36
- _defineProperty(this, "interactionService", void 0);
37
-
38
- _defineProperty(this, "container", void 0);
39
-
40
27
  var id = config.id,
41
28
  map = config.map,
42
29
  canvas = config.canvas,
43
- hasBaseMap = config.hasBaseMap;
30
+ hasBaseMap = config.hasBaseMap; // 创建场景容器
31
+
44
32
  var sceneContainer = createSceneContainer();
45
- this.container = sceneContainer;
46
- map.setContainer(sceneContainer, id, canvas, hasBaseMap);
47
- sceneContainer.bind(TYPES.IRendererService).to(ReglRendererService).inSingletonScope();
33
+ this.container = sceneContainer; // 绑定地图服务
34
+
35
+ map.setContainer(sceneContainer, id, canvas, hasBaseMap); // 绑定渲染引擎服务
36
+
37
+ sceneContainer.bind(TYPES.IRendererService).to(ReglRendererService).inSingletonScope(); // 依赖注入
38
+
48
39
  this.sceneService = sceneContainer.get(TYPES.ISceneService);
49
40
  this.mapService = sceneContainer.get(TYPES.IMapService);
50
41
  this.iconService = sceneContainer.get(TYPES.IIconService);
@@ -58,8 +49,10 @@ var Scene = function () {
58
49
  if (isMini) {
59
50
  this.sceneService.initMiniScene(config);
60
51
  } else {
61
- this.initComponent(id);
62
- this.sceneService.init(config);
52
+ this.initComponent(id); // 初始化 scene
53
+
54
+ this.sceneService.init(config); // TODO: 初始化组件
55
+
63
56
  this.initControl();
64
57
  }
65
58
  }
@@ -143,16 +136,20 @@ var Scene = function () {
143
136
  key: "setBgColor",
144
137
  value: function setBgColor(color) {
145
138
  this.mapService.setBgColor(color);
146
- }
139
+ } // layer 管理
140
+
147
141
  }, {
148
142
  key: "addLayer",
149
143
  value: function addLayer(layer) {
144
+ // 为当前图层创建一个容器
145
+ // TODO: 初始化的时候设置 容器
150
146
  var layerContainer = createLayerContainer(this.container);
151
147
  layer.setContainer(layerContainer, this.container);
152
148
  this.sceneService.addLayer(layer);
153
149
  var layerConfig = layer.getLayerConfig();
154
150
 
155
151
  if (layerConfig) {
152
+ // 若 layer 未初始化成功,则 layerConfig 为 undefined (scene loaded 尚未执行完成)
156
153
  var mask = layerConfig.mask,
157
154
  maskfence = layerConfig.maskfence,
158
155
  _layerConfig$maskColo = layerConfig.maskColor,
@@ -223,7 +220,14 @@ var Scene = function () {
223
220
  key: "setEnableRender",
224
221
  value: function setEnableRender(flag) {
225
222
  this.layerService.setEnableRender(flag);
226
- }
223
+ } // asset method
224
+
225
+ /**
226
+ * 为 layer/point/text 支持 iconfont 模式支持
227
+ * @param fontUnicode
228
+ * @param name
229
+ */
230
+
227
231
  }, {
228
232
  key: "addIconFont",
229
233
  value: function addIconFont(name, fontUnicode) {
@@ -242,6 +246,12 @@ var Scene = function () {
242
246
  _this2.fontService.addIconFont(name, fontUnicode);
243
247
  });
244
248
  }
249
+ /**
250
+ * 用户自定义添加第三方字体
251
+ * @param fontFamily
252
+ * @param fontPath
253
+ */
254
+
245
255
  }, {
246
256
  key: "addFontFace",
247
257
  value: function addFontFace(fontFamily, fontPath) {
@@ -254,7 +264,8 @@ var Scene = function () {
254
264
  this.iconService.addImage(id, img);
255
265
  } else {
256
266
  this.iconService.addImageMini(id, img, this.sceneService);
257
- }
267
+ } // this.iconService.addImage(id, img);
268
+
258
269
  }
259
270
  }, {
260
271
  key: "hasImage",
@@ -270,7 +281,8 @@ var Scene = function () {
270
281
  key: "addIconFontGlyphs",
271
282
  value: function addIconFontGlyphs(fontFamily, glyphs) {
272
283
  this.fontService.addIconGlyphs(glyphs);
273
- }
284
+ } // map control method
285
+
274
286
  }, {
275
287
  key: "addControl",
276
288
  value: function addControl(ctr) {
@@ -285,7 +297,8 @@ var Scene = function () {
285
297
  key: "getControlByName",
286
298
  value: function getControlByName(name) {
287
299
  return this.controlService.getControlByName(name);
288
- }
300
+ } // marker
301
+
289
302
  }, {
290
303
  key: "addMarker",
291
304
  value: function addMarker(marker) {
@@ -325,7 +338,8 @@ var Scene = function () {
325
338
  key: "off",
326
339
  value: function off(type, handle) {
327
340
  SceneEventList.indexOf(type) === -1 ? this.mapService.off(type, handle) : this.sceneService.off(type, handle);
328
- }
341
+ } // implements IMapController
342
+
329
343
  }, {
330
344
  key: "getZoom",
331
345
  value: function getZoom() {
@@ -403,7 +417,8 @@ var Scene = function () {
403
417
  fitBoundsOptions = _this$sceneService$ge.fitBoundsOptions,
404
418
  animate = _this$sceneService$ge.animate;
405
419
 
406
- this.mapService.fitBounds(bound, options || _objectSpread(_objectSpread({}, fitBoundsOptions), {}, {
420
+ this.mapService.fitBounds(bound, // 选项优先级:用户传入,覆盖animate直接配置,覆盖Scene配置项传入
421
+ options || _objectSpread(_objectSpread({}, fitBoundsOptions), {}, {
407
422
  animate: animate
408
423
  }));
409
424
  }
@@ -421,7 +436,8 @@ var Scene = function () {
421
436
  key: "setMapStatus",
422
437
  value: function setMapStatus(options) {
423
438
  this.mapService.setMapStatus(options);
424
- }
439
+ } // conversion Method
440
+
425
441
  }, {
426
442
  key: "pixelToLngLat",
427
443
  value: function pixelToLngLat(pixel) {
@@ -445,13 +461,14 @@ var Scene = function () {
445
461
  }, {
446
462
  key: "destroy",
447
463
  value: function destroy() {
448
- this.sceneService.destroy();
464
+ this.sceneService.destroy(); // TODO: 清理其他 Service 例如 IconService
449
465
  }
450
466
  }, {
451
467
  key: "registerPostProcessingPass",
452
468
  value: function registerPostProcessingPass(constructor, name) {
453
469
  this.container.bind(TYPES.IPostProcessingPass).to(constructor).whenTargetNamed(name);
454
- }
470
+ } // 控制 shader pick 计算
471
+
455
472
  }, {
456
473
  key: "enableShaderPick",
457
474
  value: function enableShaderPick() {
@@ -461,7 +478,8 @@ var Scene = function () {
461
478
  key: "diasbleShaderPick",
462
479
  value: function diasbleShaderPick() {
463
480
  this.layerService.disableShaderPick();
464
- }
481
+ } // get current point size info
482
+
465
483
  }, {
466
484
  key: "getPointSizeRange",
467
485
  value: function getPointSizeRange() {
@@ -494,5 +512,4 @@ var Scene = function () {
494
512
  return Scene;
495
513
  }();
496
514
 
497
- export { Scene };
498
- //# sourceMappingURL=index.js.map
515
+ export { Scene };
@@ -1,2 +1,17 @@
1
- "use strict";
2
- //# sourceMappingURL=ILayerManager.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/ILayerManager.ts
16
+ var ILayerManager_exports = {};
17
+ module.exports = __toCommonJS(ILayerManager_exports);
@@ -1,2 +1,17 @@
1
- "use strict";
2
- //# sourceMappingURL=IMapController.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/IMapController.ts
16
+ var IMapController_exports = {};
17
+ module.exports = __toCommonJS(IMapController_exports);
@@ -1,2 +1,17 @@
1
- "use strict";
2
- //# sourceMappingURL=IPostProcessingPassPluggable.js.map
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/IPostProcessingPassPluggable.ts
16
+ var IPostProcessingPassPluggable_exports = {};
17
+ module.exports = __toCommonJS(IPostProcessingPassPluggable_exports);
package/lib/index.js CHANGED
@@ -1,66 +1,49 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
4
18
 
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
19
+ // src/index.ts
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ Scene: () => Scene
7
23
  });
8
- exports.Scene = void 0;
9
-
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
-
18
- var _l7Component = require("@antv/l7-component");
19
-
20
- var _l7Core = require("@antv/l7-core");
21
-
22
- var _l7Layers = require("@antv/l7-layers");
23
-
24
- var _l7Renderer = require("@antv/l7-renderer");
25
-
26
- var _l7Utils = require("@antv/l7-utils");
27
-
28
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
29
-
30
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
31
-
32
- var Scene = function () {
33
- function Scene(config) {
34
- (0, _classCallCheck2.default)(this, Scene);
35
- (0, _defineProperty2.default)(this, "sceneService", void 0);
36
- (0, _defineProperty2.default)(this, "mapService", void 0);
37
- (0, _defineProperty2.default)(this, "controlService", void 0);
38
- (0, _defineProperty2.default)(this, "layerService", void 0);
39
- (0, _defineProperty2.default)(this, "iconService", void 0);
40
- (0, _defineProperty2.default)(this, "markerService", void 0);
41
- (0, _defineProperty2.default)(this, "popupService", void 0);
42
- (0, _defineProperty2.default)(this, "fontService", void 0);
43
- (0, _defineProperty2.default)(this, "interactionService", void 0);
44
- (0, _defineProperty2.default)(this, "container", void 0);
45
- var id = config.id,
46
- map = config.map,
47
- canvas = config.canvas,
48
- hasBaseMap = config.hasBaseMap;
49
- var sceneContainer = (0, _l7Core.createSceneContainer)();
24
+ module.exports = __toCommonJS(src_exports);
25
+ var import_l7_component = require("@antv/l7-component");
26
+ var import_l7_core = require("@antv/l7-core");
27
+ var import_l7_layers = require("@antv/l7-layers");
28
+ var import_l7_renderer = require("@antv/l7-renderer");
29
+ var import_l7_utils = require("@antv/l7-utils");
30
+ var Scene = class {
31
+ constructor(config) {
32
+ const { id, map, canvas, hasBaseMap } = config;
33
+ const sceneContainer = (0, import_l7_core.createSceneContainer)();
50
34
  this.container = sceneContainer;
51
35
  map.setContainer(sceneContainer, id, canvas, hasBaseMap);
52
- sceneContainer.bind(_l7Core.TYPES.IRendererService).to(_l7Renderer.ReglRendererService).inSingletonScope();
53
- this.sceneService = sceneContainer.get(_l7Core.TYPES.ISceneService);
54
- this.mapService = sceneContainer.get(_l7Core.TYPES.IMapService);
55
- this.iconService = sceneContainer.get(_l7Core.TYPES.IIconService);
56
- this.fontService = sceneContainer.get(_l7Core.TYPES.IFontService);
57
- this.controlService = sceneContainer.get(_l7Core.TYPES.IControlService);
58
- this.layerService = sceneContainer.get(_l7Core.TYPES.ILayerService);
59
- this.markerService = sceneContainer.get(_l7Core.TYPES.IMarkerService);
60
- this.interactionService = sceneContainer.get(_l7Core.TYPES.IInteractionService);
61
- this.popupService = sceneContainer.get(_l7Core.TYPES.IPopupService);
62
-
63
- if (_l7Utils.isMini) {
36
+ sceneContainer.bind(import_l7_core.TYPES.IRendererService).to(import_l7_renderer.ReglRendererService).inSingletonScope();
37
+ this.sceneService = sceneContainer.get(import_l7_core.TYPES.ISceneService);
38
+ this.mapService = sceneContainer.get(import_l7_core.TYPES.IMapService);
39
+ this.iconService = sceneContainer.get(import_l7_core.TYPES.IIconService);
40
+ this.fontService = sceneContainer.get(import_l7_core.TYPES.IFontService);
41
+ this.controlService = sceneContainer.get(import_l7_core.TYPES.IControlService);
42
+ this.layerService = sceneContainer.get(import_l7_core.TYPES.ILayerService);
43
+ this.markerService = sceneContainer.get(import_l7_core.TYPES.IMarkerService);
44
+ this.interactionService = sceneContainer.get(import_l7_core.TYPES.IInteractionService);
45
+ this.popupService = sceneContainer.get(import_l7_core.TYPES.IPopupService);
46
+ if (import_l7_utils.isMini) {
64
47
  this.sceneService.initMiniScene(config);
65
48
  } else {
66
49
  this.initComponent(id);
@@ -68,435 +51,273 @@ var Scene = function () {
68
51
  this.initControl();
69
52
  }
70
53
  }
71
-
72
- (0, _createClass2.default)(Scene, [{
73
- key: "map",
74
- get: function get() {
75
- return this.mapService.map;
76
- }
77
- }, {
78
- key: "loaded",
79
- get: function get() {
80
- return this.sceneService.loaded;
81
- }
82
- }, {
83
- key: "getServiceContainer",
84
- value: function getServiceContainer() {
85
- return this.container;
86
- }
87
- }, {
88
- key: "getSize",
89
- value: function getSize() {
90
- return this.mapService.getSize();
91
- }
92
- }, {
93
- key: "getMinZoom",
94
- value: function getMinZoom() {
95
- return this.mapService.getMinZoom();
96
- }
97
- }, {
98
- key: "getMaxZoom",
99
- value: function getMaxZoom() {
100
- return this.mapService.getMaxZoom();
101
- }
102
- }, {
103
- key: "getType",
104
- value: function getType() {
105
- return this.mapService.getType();
106
- }
107
- }, {
108
- key: "getMapContainer",
109
- value: function getMapContainer() {
110
- return this.mapService.getMapContainer();
111
- }
112
- }, {
113
- key: "getMapCanvasContainer",
114
- value: function getMapCanvasContainer() {
115
- return this.mapService.getMapCanvasContainer();
116
- }
117
- }, {
118
- key: "getMapService",
119
- value: function getMapService() {
120
- return this.mapService;
121
- }
122
- }, {
123
- key: "exportPng",
124
- value: function exportPng(type) {
125
- return this.sceneService.exportPng(type);
126
- }
127
- }, {
128
- key: "exportMap",
129
- value: function exportMap(type) {
130
- return this.sceneService.exportPng(type);
131
- }
132
- }, {
133
- key: "registerRenderService",
134
- value: function registerRenderService(render) {
135
- var _this = this;
136
-
137
- if (this.sceneService.loaded) {
138
- var renderSerivce = new render(this);
54
+ get map() {
55
+ return this.mapService.map;
56
+ }
57
+ get loaded() {
58
+ return this.sceneService.loaded;
59
+ }
60
+ getServiceContainer() {
61
+ return this.container;
62
+ }
63
+ getSize() {
64
+ return this.mapService.getSize();
65
+ }
66
+ getMinZoom() {
67
+ return this.mapService.getMinZoom();
68
+ }
69
+ getMaxZoom() {
70
+ return this.mapService.getMaxZoom();
71
+ }
72
+ getType() {
73
+ return this.mapService.getType();
74
+ }
75
+ getMapContainer() {
76
+ return this.mapService.getMapContainer();
77
+ }
78
+ getMapCanvasContainer() {
79
+ return this.mapService.getMapCanvasContainer();
80
+ }
81
+ getMapService() {
82
+ return this.mapService;
83
+ }
84
+ exportPng(type) {
85
+ return this.sceneService.exportPng(type);
86
+ }
87
+ exportMap(type) {
88
+ return this.sceneService.exportPng(type);
89
+ }
90
+ registerRenderService(render) {
91
+ if (this.sceneService.loaded) {
92
+ const renderSerivce = new render(this);
93
+ renderSerivce.init();
94
+ } else {
95
+ this.on("loaded", () => {
96
+ const renderSerivce = new render(this);
139
97
  renderSerivce.init();
140
- } else {
141
- this.on('loaded', function () {
142
- var renderSerivce = new render(_this);
143
- renderSerivce.init();
144
- });
145
- }
146
- }
147
- }, {
148
- key: "setBgColor",
149
- value: function setBgColor(color) {
150
- this.mapService.setBgColor(color);
151
- }
152
- }, {
153
- key: "addLayer",
154
- value: function addLayer(layer) {
155
- var layerContainer = (0, _l7Core.createLayerContainer)(this.container);
156
- layer.setContainer(layerContainer, this.container);
157
- this.sceneService.addLayer(layer);
158
- var layerConfig = layer.getLayerConfig();
159
-
160
- if (layerConfig) {
161
- var mask = layerConfig.mask,
162
- maskfence = layerConfig.maskfence,
163
- _layerConfig$maskColo = layerConfig.maskColor,
164
- maskColor = _layerConfig$maskColo === void 0 ? '#000' : _layerConfig$maskColo,
165
- _layerConfig$maskOpac = layerConfig.maskOpacity,
166
- maskOpacity = _layerConfig$maskOpac === void 0 ? 0 : _layerConfig$maskOpac;
167
-
168
- if (mask && maskfence) {
169
- var maskInstance = new _l7Layers.MaskLayer().source(maskfence).shape('fill').color(maskColor).style({
170
- opacity: maskOpacity
171
- });
172
- this.addMask(maskInstance, layer.id);
173
- }
174
- } else {
175
- console.warn('addLayer should run after scene loaded!');
176
- }
177
- }
178
- }, {
179
- key: "addMask",
180
- value: function addMask(mask, layerId) {
181
- var parent = this.getLayer(layerId);
182
-
183
- if (parent) {
184
- var layerContainer = (0, _l7Core.createLayerContainer)(this.container);
185
- mask.setContainer(layerContainer, this.container);
186
- parent.addMaskLayer(mask);
187
- this.sceneService.addLayer(mask);
188
- } else {
189
- console.warn('parent layer not find!');
190
- }
191
- }
192
- }, {
193
- key: "getPickedLayer",
194
- value: function getPickedLayer() {
195
- return this.layerService.pickedLayerId;
196
- }
197
- }, {
198
- key: "getLayers",
199
- value: function getLayers() {
200
- return this.layerService.getLayers();
201
- }
202
- }, {
203
- key: "getLayer",
204
- value: function getLayer(id) {
205
- return this.layerService.getLayer(id);
206
- }
207
- }, {
208
- key: "getLayerByName",
209
- value: function getLayerByName(name) {
210
- return this.layerService.getLayerByName(name);
211
- }
212
- }, {
213
- key: "removeLayer",
214
- value: function removeLayer(layer, parentLayer) {
215
- this.layerService.remove(layer, parentLayer);
216
- }
217
- }, {
218
- key: "removeAllLayer",
219
- value: function removeAllLayer() {
220
- this.layerService.removeAllLayers();
221
- }
222
- }, {
223
- key: "render",
224
- value: function render() {
225
- this.sceneService.render();
226
- }
227
- }, {
228
- key: "setEnableRender",
229
- value: function setEnableRender(flag) {
230
- this.layerService.setEnableRender(flag);
231
- }
232
- }, {
233
- key: "addIconFont",
234
- value: function addIconFont(name, fontUnicode) {
235
- this.fontService.addIconFont(name, fontUnicode);
236
- }
237
- }, {
238
- key: "addIconFonts",
239
- value: function addIconFonts(options) {
240
- var _this2 = this;
241
-
242
- options.forEach(function (_ref) {
243
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
244
- name = _ref2[0],
245
- fontUnicode = _ref2[1];
246
-
247
- _this2.fontService.addIconFont(name, fontUnicode);
248
98
  });
249
99
  }
250
- }, {
251
- key: "addFontFace",
252
- value: function addFontFace(fontFamily, fontPath) {
253
- this.sceneService.addFontFace(fontFamily, fontPath);
254
- }
255
- }, {
256
- key: "addImage",
257
- value: function addImage(id, img) {
258
- if (!_l7Utils.isMini) {
259
- this.iconService.addImage(id, img);
260
- } else {
261
- this.iconService.addImageMini(id, img, this.sceneService);
100
+ }
101
+ setBgColor(color) {
102
+ this.mapService.setBgColor(color);
103
+ }
104
+ addLayer(layer) {
105
+ const layerContainer = (0, import_l7_core.createLayerContainer)(this.container);
106
+ layer.setContainer(layerContainer, this.container);
107
+ this.sceneService.addLayer(layer);
108
+ const layerConfig = layer.getLayerConfig();
109
+ if (layerConfig) {
110
+ const {
111
+ mask,
112
+ maskfence,
113
+ maskColor = "#000",
114
+ maskOpacity = 0
115
+ } = layerConfig;
116
+ if (mask && maskfence) {
117
+ const maskInstance = new import_l7_layers.MaskLayer().source(maskfence).shape("fill").color(maskColor).style({
118
+ opacity: maskOpacity
119
+ });
120
+ this.addMask(maskInstance, layer.id);
262
121
  }
122
+ } else {
123
+ console.warn("addLayer should run after scene loaded!");
263
124
  }
264
- }, {
265
- key: "hasImage",
266
- value: function hasImage(id) {
267
- return this.iconService.hasImage(id);
268
- }
269
- }, {
270
- key: "removeImage",
271
- value: function removeImage(id) {
272
- this.iconService.removeImage(id);
273
- }
274
- }, {
275
- key: "addIconFontGlyphs",
276
- value: function addIconFontGlyphs(fontFamily, glyphs) {
277
- this.fontService.addIconGlyphs(glyphs);
278
- }
279
- }, {
280
- key: "addControl",
281
- value: function addControl(ctr) {
282
- this.controlService.addControl(ctr, this.container);
283
- }
284
- }, {
285
- key: "removeControl",
286
- value: function removeControl(ctr) {
287
- this.controlService.removeControl(ctr);
288
- }
289
- }, {
290
- key: "getControlByName",
291
- value: function getControlByName(name) {
292
- return this.controlService.getControlByName(name);
293
- }
294
- }, {
295
- key: "addMarker",
296
- value: function addMarker(marker) {
297
- this.markerService.addMarker(marker);
298
- }
299
- }, {
300
- key: "addMarkerLayer",
301
- value: function addMarkerLayer(layer) {
302
- this.markerService.addMarkerLayer(layer);
303
- }
304
- }, {
305
- key: "removeMarkerLayer",
306
- value: function removeMarkerLayer(layer) {
307
- this.markerService.removeMarkerLayer(layer);
308
- }
309
- }, {
310
- key: "removeAllMakers",
311
- value: function removeAllMakers() {
312
- this.markerService.removeAllMarkers();
313
- }
314
- }, {
315
- key: "addPopup",
316
- value: function addPopup(popup) {
317
- this.popupService.addPopup(popup);
318
- }
319
- }, {
320
- key: "on",
321
- value: function on(type, handle) {
322
- _l7Core.SceneEventList.indexOf(type) === -1 ? this.mapService.on(type, handle) : this.sceneService.on(type, handle);
323
- }
324
- }, {
325
- key: "once",
326
- value: function once(type, handle) {
327
- _l7Core.SceneEventList.indexOf(type) === -1 ? this.mapService.once(type, handle) : this.sceneService.once(type, handle);
328
- }
329
- }, {
330
- key: "off",
331
- value: function off(type, handle) {
332
- _l7Core.SceneEventList.indexOf(type) === -1 ? this.mapService.off(type, handle) : this.sceneService.off(type, handle);
333
- }
334
- }, {
335
- key: "getZoom",
336
- value: function getZoom() {
337
- return this.mapService.getZoom();
338
- }
339
- }, {
340
- key: "getCenter",
341
- value: function getCenter(options) {
342
- return this.mapService.getCenter(options);
343
- }
344
- }, {
345
- key: "setCenter",
346
- value: function setCenter(center, options) {
347
- return this.mapService.setCenter(center, options);
348
- }
349
- }, {
350
- key: "getPitch",
351
- value: function getPitch() {
352
- return this.mapService.getPitch();
353
- }
354
- }, {
355
- key: "setPitch",
356
- value: function setPitch(pitch) {
357
- return this.mapService.setPitch(pitch);
358
- }
359
- }, {
360
- key: "getRotation",
361
- value: function getRotation() {
362
- return this.mapService.getRotation();
363
- }
364
- }, {
365
- key: "getBounds",
366
- value: function getBounds() {
367
- return this.mapService.getBounds();
368
- }
369
- }, {
370
- key: "setRotation",
371
- value: function setRotation(rotation) {
372
- this.mapService.setRotation(rotation);
373
- }
374
- }, {
375
- key: "zoomIn",
376
- value: function zoomIn() {
377
- this.mapService.zoomIn();
378
- }
379
- }, {
380
- key: "zoomOut",
381
- value: function zoomOut() {
382
- this.mapService.zoomOut();
383
- }
384
- }, {
385
- key: "panTo",
386
- value: function panTo(p) {
387
- this.mapService.panTo(p);
388
- }
389
- }, {
390
- key: "panBy",
391
- value: function panBy(x, y) {
392
- this.mapService.panBy(x, y);
393
- }
394
- }, {
395
- key: "getContainer",
396
- value: function getContainer() {
397
- return this.mapService.getContainer();
398
- }
399
- }, {
400
- key: "setZoom",
401
- value: function setZoom(zoom) {
402
- this.mapService.setZoom(zoom);
403
- }
404
- }, {
405
- key: "fitBounds",
406
- value: function fitBounds(bound, options) {
407
- var _this$sceneService$ge = this.sceneService.getSceneConfig(),
408
- fitBoundsOptions = _this$sceneService$ge.fitBoundsOptions,
409
- animate = _this$sceneService$ge.animate;
410
-
411
- this.mapService.fitBounds(bound, options || _objectSpread(_objectSpread({}, fitBoundsOptions), {}, {
412
- animate: animate
413
- }));
414
- }
415
- }, {
416
- key: "setZoomAndCenter",
417
- value: function setZoomAndCenter(zoom, center) {
418
- this.mapService.setZoomAndCenter(zoom, center);
419
- }
420
- }, {
421
- key: "setMapStyle",
422
- value: function setMapStyle(style) {
423
- this.mapService.setMapStyle(style);
424
- }
425
- }, {
426
- key: "setMapStatus",
427
- value: function setMapStatus(options) {
428
- this.mapService.setMapStatus(options);
429
- }
430
- }, {
431
- key: "pixelToLngLat",
432
- value: function pixelToLngLat(pixel) {
433
- return this.mapService.pixelToLngLat(pixel);
434
- }
435
- }, {
436
- key: "lngLatToPixel",
437
- value: function lngLatToPixel(lnglat) {
438
- return this.mapService.lngLatToPixel(lnglat);
439
- }
440
- }, {
441
- key: "containerToLngLat",
442
- value: function containerToLngLat(pixel) {
443
- return this.mapService.containerToLngLat(pixel);
444
- }
445
- }, {
446
- key: "lngLatToContainer",
447
- value: function lngLatToContainer(lnglat) {
448
- return this.mapService.lngLatToContainer(lnglat);
449
- }
450
- }, {
451
- key: "destroy",
452
- value: function destroy() {
453
- this.sceneService.destroy();
454
- }
455
- }, {
456
- key: "registerPostProcessingPass",
457
- value: function registerPostProcessingPass(constructor, name) {
458
- this.container.bind(_l7Core.TYPES.IPostProcessingPass).to(constructor).whenTargetNamed(name);
459
- }
460
- }, {
461
- key: "enableShaderPick",
462
- value: function enableShaderPick() {
463
- this.layerService.enableShaderPick();
464
- }
465
- }, {
466
- key: "diasbleShaderPick",
467
- value: function diasbleShaderPick() {
468
- this.layerService.disableShaderPick();
469
- }
470
- }, {
471
- key: "getPointSizeRange",
472
- value: function getPointSizeRange() {
473
- return this.sceneService.getPointSizeRange();
125
+ }
126
+ addMask(mask, layerId) {
127
+ const parent = this.getLayer(layerId);
128
+ if (parent) {
129
+ const layerContainer = (0, import_l7_core.createLayerContainer)(this.container);
130
+ mask.setContainer(layerContainer, this.container);
131
+ parent.addMaskLayer(mask);
132
+ this.sceneService.addLayer(mask);
133
+ } else {
134
+ console.warn("parent layer not find!");
474
135
  }
475
- }, {
476
- key: "initComponent",
477
- value: function initComponent(id) {
478
- this.controlService.init({
479
- container: _l7Utils.DOM.getContainer(id)
480
- }, this.container);
481
- this.markerService.init(this.container);
482
- this.popupService.init(this.container);
136
+ }
137
+ getPickedLayer() {
138
+ return this.layerService.pickedLayerId;
139
+ }
140
+ getLayers() {
141
+ return this.layerService.getLayers();
142
+ }
143
+ getLayer(id) {
144
+ return this.layerService.getLayer(id);
145
+ }
146
+ getLayerByName(name) {
147
+ return this.layerService.getLayerByName(name);
148
+ }
149
+ removeLayer(layer, parentLayer) {
150
+ this.layerService.remove(layer, parentLayer);
151
+ }
152
+ removeAllLayer() {
153
+ this.layerService.removeAllLayers();
154
+ }
155
+ render() {
156
+ this.sceneService.render();
157
+ }
158
+ setEnableRender(flag) {
159
+ this.layerService.setEnableRender(flag);
160
+ }
161
+ addIconFont(name, fontUnicode) {
162
+ this.fontService.addIconFont(name, fontUnicode);
163
+ }
164
+ addIconFonts(options) {
165
+ options.forEach(([name, fontUnicode]) => {
166
+ this.fontService.addIconFont(name, fontUnicode);
167
+ });
168
+ }
169
+ addFontFace(fontFamily, fontPath) {
170
+ this.sceneService.addFontFace(fontFamily, fontPath);
171
+ }
172
+ addImage(id, img) {
173
+ if (!import_l7_utils.isMini) {
174
+ this.iconService.addImage(id, img);
175
+ } else {
176
+ this.iconService.addImageMini(id, img, this.sceneService);
483
177
  }
484
- }, {
485
- key: "initControl",
486
- value: function initControl() {
487
- var _this$sceneService$ge2 = this.sceneService.getSceneConfig(),
488
- logoVisible = _this$sceneService$ge2.logoVisible,
489
- logoPosition = _this$sceneService$ge2.logoPosition;
490
-
491
- if (logoVisible) {
492
- this.addControl(new _l7Component.Logo({
493
- position: logoPosition
494
- }));
495
- }
178
+ }
179
+ hasImage(id) {
180
+ return this.iconService.hasImage(id);
181
+ }
182
+ removeImage(id) {
183
+ this.iconService.removeImage(id);
184
+ }
185
+ addIconFontGlyphs(fontFamily, glyphs) {
186
+ this.fontService.addIconGlyphs(glyphs);
187
+ }
188
+ addControl(ctr) {
189
+ this.controlService.addControl(ctr, this.container);
190
+ }
191
+ removeControl(ctr) {
192
+ this.controlService.removeControl(ctr);
193
+ }
194
+ getControlByName(name) {
195
+ return this.controlService.getControlByName(name);
196
+ }
197
+ addMarker(marker) {
198
+ this.markerService.addMarker(marker);
199
+ }
200
+ addMarkerLayer(layer) {
201
+ this.markerService.addMarkerLayer(layer);
202
+ }
203
+ removeMarkerLayer(layer) {
204
+ this.markerService.removeMarkerLayer(layer);
205
+ }
206
+ removeAllMakers() {
207
+ this.markerService.removeAllMarkers();
208
+ }
209
+ addPopup(popup) {
210
+ this.popupService.addPopup(popup);
211
+ }
212
+ on(type, handle) {
213
+ import_l7_core.SceneEventList.indexOf(type) === -1 ? this.mapService.on(type, handle) : this.sceneService.on(type, handle);
214
+ }
215
+ once(type, handle) {
216
+ import_l7_core.SceneEventList.indexOf(type) === -1 ? this.mapService.once(type, handle) : this.sceneService.once(type, handle);
217
+ }
218
+ off(type, handle) {
219
+ import_l7_core.SceneEventList.indexOf(type) === -1 ? this.mapService.off(type, handle) : this.sceneService.off(type, handle);
220
+ }
221
+ getZoom() {
222
+ return this.mapService.getZoom();
223
+ }
224
+ getCenter(options) {
225
+ return this.mapService.getCenter(options);
226
+ }
227
+ setCenter(center, options) {
228
+ return this.mapService.setCenter(center, options);
229
+ }
230
+ getPitch() {
231
+ return this.mapService.getPitch();
232
+ }
233
+ setPitch(pitch) {
234
+ return this.mapService.setPitch(pitch);
235
+ }
236
+ getRotation() {
237
+ return this.mapService.getRotation();
238
+ }
239
+ getBounds() {
240
+ return this.mapService.getBounds();
241
+ }
242
+ setRotation(rotation) {
243
+ this.mapService.setRotation(rotation);
244
+ }
245
+ zoomIn() {
246
+ this.mapService.zoomIn();
247
+ }
248
+ zoomOut() {
249
+ this.mapService.zoomOut();
250
+ }
251
+ panTo(p) {
252
+ this.mapService.panTo(p);
253
+ }
254
+ panBy(x, y) {
255
+ this.mapService.panBy(x, y);
256
+ }
257
+ getContainer() {
258
+ return this.mapService.getContainer();
259
+ }
260
+ setZoom(zoom) {
261
+ this.mapService.setZoom(zoom);
262
+ }
263
+ fitBounds(bound, options) {
264
+ const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();
265
+ this.mapService.fitBounds(bound, options || {
266
+ ...fitBoundsOptions,
267
+ animate
268
+ });
269
+ }
270
+ setZoomAndCenter(zoom, center) {
271
+ this.mapService.setZoomAndCenter(zoom, center);
272
+ }
273
+ setMapStyle(style) {
274
+ this.mapService.setMapStyle(style);
275
+ }
276
+ setMapStatus(options) {
277
+ this.mapService.setMapStatus(options);
278
+ }
279
+ pixelToLngLat(pixel) {
280
+ return this.mapService.pixelToLngLat(pixel);
281
+ }
282
+ lngLatToPixel(lnglat) {
283
+ return this.mapService.lngLatToPixel(lnglat);
284
+ }
285
+ containerToLngLat(pixel) {
286
+ return this.mapService.containerToLngLat(pixel);
287
+ }
288
+ lngLatToContainer(lnglat) {
289
+ return this.mapService.lngLatToContainer(lnglat);
290
+ }
291
+ destroy() {
292
+ this.sceneService.destroy();
293
+ }
294
+ registerPostProcessingPass(constructor, name) {
295
+ this.container.bind(import_l7_core.TYPES.IPostProcessingPass).to(constructor).whenTargetNamed(name);
296
+ }
297
+ enableShaderPick() {
298
+ this.layerService.enableShaderPick();
299
+ }
300
+ diasbleShaderPick() {
301
+ this.layerService.disableShaderPick();
302
+ }
303
+ getPointSizeRange() {
304
+ return this.sceneService.getPointSizeRange();
305
+ }
306
+ initComponent(id) {
307
+ this.controlService.init({
308
+ container: import_l7_utils.DOM.getContainer(id)
309
+ }, this.container);
310
+ this.markerService.init(this.container);
311
+ this.popupService.init(this.container);
312
+ }
313
+ initControl() {
314
+ const { logoVisible, logoPosition } = this.sceneService.getSceneConfig();
315
+ if (logoVisible) {
316
+ this.addControl(new import_l7_component.Logo({ position: logoPosition }));
496
317
  }
497
- }]);
498
- return Scene;
499
- }();
500
-
501
- exports.Scene = Scene;
502
- //# sourceMappingURL=index.js.map
318
+ }
319
+ };
320
+ // Annotate the CommonJS export names for ESM import in node:
321
+ 0 && (module.exports = {
322
+ Scene
323
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-scene",
3
- "version": "2.9.20",
3
+ "version": "2.9.22",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -14,27 +14,27 @@
14
14
  "scripts": {
15
15
  "tsc": "tsc --project tsconfig.build.json",
16
16
  "clean": "rimraf dist; rimraf es; rimraf lib;",
17
- "build": "run-p build:*",
18
- "build:cjs": "cross-env BABEL_ENV=cjs NODE_ENV=production babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
19
- "build:esm": "cross-env BABEL_ENV=esm NODE_ENV=production babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
20
- "watch": "cross-env BABEL_ENV=cjs NODE_ENV=production babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
17
+ "build": "father build",
18
+ "build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
19
+ "build:esm": "BABEL_ENV=esm babel src --root-mode upward --out-dir es --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
20
+ "watch": "BABEL_ENV=cjs babel src --watch --root-mode upward --out-dir lib --source-maps --extensions .ts,.tsx --delete-dir-on-start --no-comments",
21
21
  "sync": "tnpm sync"
22
22
  },
23
23
  "author": "xiaoiver",
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
- "@antv/l7-component": "2.9.20",
27
- "@antv/l7-core": "2.9.20",
28
- "@antv/l7-layers": "2.9.20",
29
- "@antv/l7-maps": "2.9.20",
30
- "@antv/l7-renderer": "2.9.20",
31
- "@antv/l7-utils": "2.9.20",
26
+ "@antv/l7-component": "2.9.22",
27
+ "@antv/l7-core": "2.9.22",
28
+ "@antv/l7-layers": "2.9.22",
29
+ "@antv/l7-maps": "2.9.22",
30
+ "@antv/l7-renderer": "2.9.22",
31
+ "@antv/l7-utils": "2.9.22",
32
32
  "@babel/runtime": "^7.7.7",
33
33
  "inversify": "^5.0.1",
34
34
  "mapbox-gl": "^1.2.1",
35
35
  "reflect-metadata": "^0.1.13"
36
36
  },
37
- "gitHead": "5eb7db7af79e6f96b628bf1e8d1b687224556d04",
37
+ "gitHead": "4133f88548e4525d6f3b565762be9549bce474c8",
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"ILayerManager.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IMapController.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IPostProcessingPassPluggable.js"}
package/es/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["Logo","createLayerContainer","createSceneContainer","SceneEventList","TYPES","MaskLayer","ReglRendererService","DOM","isMini","Scene","config","id","map","canvas","hasBaseMap","sceneContainer","container","setContainer","bind","IRendererService","to","inSingletonScope","sceneService","get","ISceneService","mapService","IMapService","iconService","IIconService","fontService","IFontService","controlService","IControlService","layerService","ILayerService","markerService","IMarkerService","interactionService","IInteractionService","popupService","IPopupService","initMiniScene","initComponent","init","initControl","loaded","getSize","getMinZoom","getMaxZoom","getType","getMapContainer","getMapCanvasContainer","type","exportPng","render","renderSerivce","on","color","setBgColor","layer","layerContainer","addLayer","layerConfig","getLayerConfig","mask","maskfence","maskColor","maskOpacity","maskInstance","source","shape","style","opacity","addMask","console","warn","layerId","parent","getLayer","addMaskLayer","pickedLayerId","getLayers","name","getLayerByName","parentLayer","remove","removeAllLayers","flag","setEnableRender","fontUnicode","addIconFont","options","forEach","fontFamily","fontPath","addFontFace","img","addImage","addImageMini","hasImage","removeImage","glyphs","addIconGlyphs","ctr","addControl","removeControl","getControlByName","marker","addMarker","addMarkerLayer","removeMarkerLayer","removeAllMarkers","popup","addPopup","handle","indexOf","once","off","getZoom","getCenter","center","setCenter","getPitch","pitch","setPitch","getRotation","getBounds","rotation","setRotation","zoomIn","zoomOut","p","panTo","x","y","panBy","getContainer","zoom","setZoom","bound","getSceneConfig","fitBoundsOptions","animate","fitBounds","setZoomAndCenter","setMapStyle","setMapStatus","pixel","pixelToLngLat","lnglat","lngLatToPixel","containerToLngLat","lngLatToContainer","destroy","constructor","IPostProcessingPass","whenTargetNamed","enableShaderPick","disableShaderPick","getPointSizeRange","logoVisible","logoPosition","position"],"mappings":";;;;;;;;;AAAA,SAASA,IAAT,QAAqB,oBAArB;AACA,SAEEC,oBAFF,EAGEC,oBAHF,EA4BEC,cA5BF,EA6BEC,KA7BF,QA8BO,eA9BP;AA+BA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,mBAAT,QAAoC,mBAApC;AACA,SAASC,GAAT,EAAcC,MAAd,QAA4B,gBAA5B;;IAkBMC,K;AAaJ,iBAAmBC,MAAnB,EAAyC;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACvC,QAAQC,EAAR,GAAwCD,MAAxC,CAAQC,EAAR;AAAA,QAAYC,GAAZ,GAAwCF,MAAxC,CAAYE,GAAZ;AAAA,QAAiBC,MAAjB,GAAwCH,MAAxC,CAAiBG,MAAjB;AAAA,QAAyBC,UAAzB,GAAwCJ,MAAxC,CAAyBI,UAAzB;AAEA,QAAMC,cAAc,GAAGb,oBAAoB,EAA3C;AACA,SAAKc,SAAL,GAAiBD,cAAjB;AAEAH,IAAAA,GAAG,CAACK,YAAJ,CAAiBF,cAAjB,EAAiCJ,EAAjC,EAAqCE,MAArC,EAA6CC,UAA7C;AAGAC,IAAAA,cAAc,CACXG,IADH,CAC0Bd,KAAK,CAACe,gBADhC,EAEGC,EAFH,CAEMd,mBAFN,EAGGe,gBAHH;AAMA,SAAKC,YAAL,GAAoBP,cAAc,CAACQ,GAAf,CAAkCnB,KAAK,CAACoB,aAAxC,CAApB;AACA,SAAKC,UAAL,GAAkBV,cAAc,CAACQ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;AAAEkK,UAAAA,QAAQ,EAAED;AAAZ,SAAT,CAAhB;AACD;AACF;;;;;;AAGH,SAASxJ,KAAT","sourcesContent":["import { Logo } from '@antv/l7-component';\nimport {\n Bounds,\n createLayerContainer,\n createSceneContainer,\n ICameraOptions,\n IControl,\n IControlService,\n IFontService,\n IIconFontGlyph,\n IIconService,\n IImage,\n IInteractionService,\n ILayer,\n ILayerService,\n ILngLat,\n IMapService,\n IMarker,\n IMarkerLayer,\n IMarkerService,\n IPoint,\n IPopup,\n IPopupService,\n IPostProcessingPass,\n IRendererService,\n ISceneConfig,\n ISceneService,\n IStatusOptions,\n Point,\n SceneEventList,\n TYPES,\n} from '@antv/l7-core';\nimport { MaskLayer } from '@antv/l7-layers';\nimport { ReglRendererService } from '@antv/l7-renderer';\nimport { DOM, isMini } from '@antv/l7-utils';\nimport { Container } from 'inversify';\nimport ILayerManager from './ILayerManager';\nimport IMapController from './IMapController';\nimport IPostProcessingPassPluggable from './IPostProcessingPassPluggable';\n\n/**\n * 暴露 Scene API\n *\n * @example\n * import { Scene } from 'l7/scene';\n * import { PointLayer } from 'l7/layers';\n *\n * const scene = new Scene();\n * const pointLayer = new PointLayer();\n * scene.addLayer(pointLayer);\n *\n */\nclass Scene\n implements IPostProcessingPassPluggable, IMapController, ILayerManager {\n private sceneService: ISceneService;\n private mapService: IMapService<unknown>;\n private controlService: IControlService;\n private layerService: ILayerService;\n private iconService: IIconService;\n private markerService: IMarkerService;\n private popupService: IPopupService;\n private fontService: IFontService;\n private interactionService: IInteractionService;\n private container: Container;\n\n public constructor(config: ISceneConfig) {\n const { id, map, canvas, hasBaseMap } = config;\n // 创建场景容器\n const sceneContainer = createSceneContainer();\n this.container = sceneContainer;\n // 绑定地图服务\n map.setContainer(sceneContainer, id, canvas, hasBaseMap);\n\n // 绑定渲染引擎服务\n sceneContainer\n .bind<IRendererService>(TYPES.IRendererService)\n .to(ReglRendererService)\n .inSingletonScope();\n\n // 依赖注入\n this.sceneService = sceneContainer.get<ISceneService>(TYPES.ISceneService);\n this.mapService = sceneContainer.get<IMapService<unknown>>(\n TYPES.IMapService,\n );\n this.iconService = sceneContainer.get<IIconService>(TYPES.IIconService);\n this.fontService = sceneContainer.get<IFontService>(TYPES.IFontService);\n this.controlService = sceneContainer.get<IControlService>(\n TYPES.IControlService,\n );\n this.layerService = sceneContainer.get<ILayerService>(TYPES.ILayerService);\n\n this.markerService = sceneContainer.get<IMarkerService>(\n TYPES.IMarkerService,\n );\n this.interactionService = sceneContainer.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n this.popupService = sceneContainer.get<IPopupService>(TYPES.IPopupService);\n\n if (isMini) {\n this.sceneService.initMiniScene(config);\n } else {\n this.initComponent(id);\n\n // 初始化 scene\n this.sceneService.init(config);\n // TODO: 初始化组件\n\n this.initControl();\n }\n }\n\n public get map() {\n return this.mapService.map;\n }\n\n public get loaded() {\n return this.sceneService.loaded;\n }\n\n public getServiceContainer(): Container {\n return this.container;\n }\n public getSize(): [number, number] {\n return this.mapService.getSize();\n }\n public getMinZoom(): number {\n return this.mapService.getMinZoom();\n }\n public getMaxZoom(): number {\n return this.mapService.getMaxZoom();\n }\n public getType(): string {\n return this.mapService.getType();\n }\n public getMapContainer(): HTMLElement | null {\n return this.mapService.getMapContainer();\n }\n public getMapCanvasContainer(): HTMLElement {\n return this.mapService.getMapCanvasContainer() as HTMLElement;\n }\n\n public getMapService(): IMapService<unknown> {\n return this.mapService;\n }\n public exportPng(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public exportMap(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public registerRenderService(render: any) {\n if (this.sceneService.loaded) {\n const renderSerivce = new render(this);\n renderSerivce.init();\n } else {\n this.on('loaded', () => {\n const renderSerivce = new render(this);\n renderSerivce.init();\n });\n }\n }\n\n public setBgColor(color: string) {\n this.mapService.setBgColor(color);\n }\n\n // layer 管理\n public addLayer(layer: ILayer): void {\n // 为当前图层创建一个容器\n // TODO: 初始化的时候设置 容器\n const layerContainer = createLayerContainer(this.container);\n layer.setContainer(layerContainer, this.container);\n this.sceneService.addLayer(layer);\n\n const layerConfig = layer.getLayerConfig();\n if (layerConfig) {\n // 若 layer 未初始化成功,则 layerConfig 为 undefined (scene loaded 尚未执行完成)\n const {\n mask,\n maskfence,\n maskColor = '#000',\n maskOpacity = 0,\n } = layerConfig;\n if (mask && maskfence) {\n const maskInstance = new MaskLayer()\n .source(maskfence)\n .shape('fill')\n .color(maskColor)\n .style({\n opacity: maskOpacity,\n });\n\n this.addMask(maskInstance, layer.id);\n }\n } else {\n console.warn('addLayer should run after scene loaded!');\n }\n }\n\n public addMask(mask: ILayer, layerId: string) {\n const parent = this.getLayer(layerId);\n if (parent) {\n const layerContainer = createLayerContainer(this.container);\n mask.setContainer(layerContainer, this.container);\n parent.addMaskLayer(mask);\n this.sceneService.addLayer(mask);\n } else {\n console.warn('parent layer not find!');\n }\n }\n\n public getPickedLayer() {\n return this.layerService.pickedLayerId;\n }\n\n public getLayers(): ILayer[] {\n return this.layerService.getLayers();\n }\n\n public getLayer(id: string): ILayer | undefined {\n return this.layerService.getLayer(id);\n }\n\n public getLayerByName(name: string): ILayer | undefined {\n return this.layerService.getLayerByName(name);\n }\n\n public removeLayer(layer: ILayer, parentLayer?: ILayer): void {\n this.layerService.remove(layer, parentLayer);\n }\n\n public removeAllLayer(): void {\n this.layerService.removeAllLayers();\n }\n\n public render(): void {\n this.sceneService.render();\n }\n\n public setEnableRender(flag: boolean) {\n this.layerService.setEnableRender(flag);\n }\n\n // asset method\n /**\n * 为 layer/point/text 支持 iconfont 模式支持\n * @param fontUnicode\n * @param name\n */\n public addIconFont(name: string, fontUnicode: string): void {\n this.fontService.addIconFont(name, fontUnicode);\n }\n\n public addIconFonts(options: string[][]): void {\n options.forEach(([name, fontUnicode]) => {\n this.fontService.addIconFont(name, fontUnicode);\n });\n }\n /**\n * 用户自定义添加第三方字体\n * @param fontFamily\n * @param fontPath\n */\n public addFontFace(fontFamily: string, fontPath: string): void {\n this.sceneService.addFontFace(fontFamily, fontPath);\n }\n\n public addImage(id: string, img: IImage) {\n if (!isMini) {\n this.iconService.addImage(id, img);\n } else {\n this.iconService.addImageMini(id, img, this.sceneService);\n }\n // this.iconService.addImage(id, img);\n }\n\n public hasImage(id: string) {\n return this.iconService.hasImage(id);\n }\n\n public removeImage(id: string) {\n this.iconService.removeImage(id);\n }\n\n public addIconFontGlyphs(fontFamily: string, glyphs: IIconFontGlyph[]) {\n this.fontService.addIconGlyphs(glyphs);\n }\n\n // map control method\n public addControl(ctr: IControl) {\n this.controlService.addControl(ctr, this.container);\n }\n\n public removeControl(ctr: IControl) {\n this.controlService.removeControl(ctr);\n }\n\n public getControlByName(name: string) {\n return this.controlService.getControlByName(name);\n }\n\n // marker\n public addMarker(marker: IMarker) {\n this.markerService.addMarker(marker);\n }\n\n public addMarkerLayer(layer: IMarkerLayer) {\n this.markerService.addMarkerLayer(layer);\n }\n\n public removeMarkerLayer(layer: IMarkerLayer) {\n this.markerService.removeMarkerLayer(layer);\n }\n\n public removeAllMakers() {\n this.markerService.removeAllMarkers();\n }\n\n public addPopup(popup: IPopup) {\n this.popupService.addPopup(popup);\n }\n\n public on(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.on(type, handle)\n : this.sceneService.on(type, handle);\n }\n\n public once(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.once(type, handle)\n : this.sceneService.once(type, handle);\n }\n\n public off(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.off(type, handle)\n : this.sceneService.off(type, handle);\n }\n\n // implements IMapController\n\n public getZoom(): number {\n return this.mapService.getZoom();\n }\n\n public getCenter(options?: ICameraOptions): ILngLat {\n return this.mapService.getCenter(options);\n }\n\n public setCenter(center: [number, number], options?: ICameraOptions) {\n return this.mapService.setCenter(center, options);\n }\n\n public getPitch(): number {\n return this.mapService.getPitch();\n }\n\n public setPitch(pitch: number) {\n return this.mapService.setPitch(pitch);\n }\n\n public getRotation(): number {\n return this.mapService.getRotation();\n }\n\n public getBounds(): Bounds {\n return this.mapService.getBounds();\n }\n\n public setRotation(rotation: number): void {\n this.mapService.setRotation(rotation);\n }\n public zoomIn(): void {\n this.mapService.zoomIn();\n }\n\n public zoomOut(): void {\n this.mapService.zoomOut();\n }\n\n public panTo(p: Point): void {\n this.mapService.panTo(p);\n }\n\n public panBy(x: number, y: number): void {\n this.mapService.panBy(x, y);\n }\n\n public getContainer() {\n return this.mapService.getContainer();\n }\n public setZoom(zoom: number): void {\n this.mapService.setZoom(zoom);\n }\n public fitBounds(bound: Bounds, options?: unknown): void {\n const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();\n this.mapService.fitBounds(\n bound,\n // 选项优先级:用户传入,覆盖animate直接配置,覆盖Scene配置项传入\n options || {\n ...(fitBoundsOptions as object),\n animate,\n },\n );\n }\n\n public setZoomAndCenter(zoom: number, center: Point): void {\n this.mapService.setZoomAndCenter(zoom, center);\n }\n\n public setMapStyle(style: any): void {\n this.mapService.setMapStyle(style);\n }\n\n public setMapStatus(options: Partial<IStatusOptions>) {\n this.mapService.setMapStatus(options);\n }\n\n // conversion Method\n public pixelToLngLat(pixel: Point): ILngLat {\n return this.mapService.pixelToLngLat(pixel);\n }\n\n public lngLatToPixel(lnglat: Point): IPoint {\n return this.mapService.lngLatToPixel(lnglat);\n }\n\n public containerToLngLat(pixel: Point): ILngLat {\n return this.mapService.containerToLngLat(pixel);\n }\n\n public lngLatToContainer(lnglat: Point): IPoint {\n return this.mapService.lngLatToContainer(lnglat);\n }\n\n public destroy() {\n this.sceneService.destroy();\n // TODO: 清理其他 Service 例如 IconService\n }\n\n public registerPostProcessingPass(\n constructor: new (...args: any[]) => IPostProcessingPass<unknown>,\n name: string,\n ) {\n this.container\n .bind<IPostProcessingPass<unknown>>(TYPES.IPostProcessingPass)\n .to(constructor)\n .whenTargetNamed(name);\n }\n\n // 控制 shader pick 计算\n public enableShaderPick() {\n this.layerService.enableShaderPick();\n }\n\n public diasbleShaderPick() {\n this.layerService.disableShaderPick();\n }\n\n // get current point size info\n public getPointSizeRange() {\n return this.sceneService.getPointSizeRange();\n }\n\n private initComponent(id: string | HTMLDivElement) {\n this.controlService.init(\n {\n container: DOM.getContainer(id),\n },\n this.container,\n );\n this.markerService.init(this.container);\n this.popupService.init(this.container);\n }\n\n private initControl() {\n const { logoVisible, logoPosition } = this.sceneService.getSceneConfig();\n if (logoVisible) {\n this.addControl(new Logo({ position: logoPosition }));\n }\n }\n}\n\nexport { Scene };\n"],"file":"index.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"ILayerManager.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IMapController.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"IPostProcessingPassPluggable.js"}
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["Scene","config","id","map","canvas","hasBaseMap","sceneContainer","container","setContainer","bind","TYPES","IRendererService","to","ReglRendererService","inSingletonScope","sceneService","get","ISceneService","mapService","IMapService","iconService","IIconService","fontService","IFontService","controlService","IControlService","layerService","ILayerService","markerService","IMarkerService","interactionService","IInteractionService","popupService","IPopupService","isMini","initMiniScene","initComponent","init","initControl","loaded","getSize","getMinZoom","getMaxZoom","getType","getMapContainer","getMapCanvasContainer","type","exportPng","render","renderSerivce","on","color","setBgColor","layer","layerContainer","addLayer","layerConfig","getLayerConfig","mask","maskfence","maskColor","maskOpacity","maskInstance","MaskLayer","source","shape","style","opacity","addMask","console","warn","layerId","parent","getLayer","addMaskLayer","pickedLayerId","getLayers","name","getLayerByName","parentLayer","remove","removeAllLayers","flag","setEnableRender","fontUnicode","addIconFont","options","forEach","fontFamily","fontPath","addFontFace","img","addImage","addImageMini","hasImage","removeImage","glyphs","addIconGlyphs","ctr","addControl","removeControl","getControlByName","marker","addMarker","addMarkerLayer","removeMarkerLayer","removeAllMarkers","popup","addPopup","handle","SceneEventList","indexOf","once","off","getZoom","getCenter","center","setCenter","getPitch","pitch","setPitch","getRotation","getBounds","rotation","setRotation","zoomIn","zoomOut","p","panTo","x","y","panBy","getContainer","zoom","setZoom","bound","getSceneConfig","fitBoundsOptions","animate","fitBounds","setZoomAndCenter","setMapStyle","setMapStatus","pixel","pixelToLngLat","lnglat","lngLatToPixel","containerToLngLat","lngLatToContainer","destroy","constructor","IPostProcessingPass","whenTargetNamed","enableShaderPick","disableShaderPick","getPointSizeRange","DOM","logoVisible","logoPosition","Logo","position"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AA+BA;;AACA;;AACA;;;;;;IAkBMA,K;AAaJ,iBAAmBC,MAAnB,EAAyC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACvC,QAAQC,EAAR,GAAwCD,MAAxC,CAAQC,EAAR;AAAA,QAAYC,GAAZ,GAAwCF,MAAxC,CAAYE,GAAZ;AAAA,QAAiBC,MAAjB,GAAwCH,MAAxC,CAAiBG,MAAjB;AAAA,QAAyBC,UAAzB,GAAwCJ,MAAxC,CAAyBI,UAAzB;AAEA,QAAMC,cAAc,GAAG,mCAAvB;AACA,SAAKC,SAAL,GAAiBD,cAAjB;AAEAH,IAAAA,GAAG,CAACK,YAAJ,CAAiBF,cAAjB,EAAiCJ,EAAjC,EAAqCE,MAArC,EAA6CC,UAA7C;AAGAC,IAAAA,cAAc,CACXG,IADH,CAC0BC,cAAMC,gBADhC,EAEGC,EAFH,CAEMC,+BAFN,EAGGC,gBAHH;AAMA,SAAKC,YAAL,GAAoBT,cAAc,CAACU,GAAf,CAAkCN,cAAMO,aAAxC,CAApB;AACA,SAAKC,UAAL,GAAkBZ,cAAc,CAACU,GAA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Container,\n ICameraOptions,\n IControl,\n IControlService,\n IFontService,\n IIconFontGlyph,\n IIconService,\n IImage,\n IInteractionService,\n ILayer,\n ILayerService,\n ILngLat,\n IMapService,\n IMarker,\n IMarkerLayer,\n IMarkerService,\n IPoint,\n IPopup,\n IPopupService,\n IPostProcessingPass,\n IRendererService,\n ISceneConfig,\n ISceneService,\n IStatusOptions,\n Point,\n SceneEventList,\n TYPES,\n} from '@antv/l7-core';\nimport { MaskLayer } from '@antv/l7-layers';\nimport { ReglRendererService } from '@antv/l7-renderer';\nimport { DOM, isMini } from '@antv/l7-utils';\nimport { Container } from 'inversify';\nimport ILayerManager from './ILayerManager';\nimport IMapController from './IMapController';\nimport IPostProcessingPassPluggable from './IPostProcessingPassPluggable';\n\n/**\n * 暴露 Scene API\n *\n * @example\n * import { Scene } from 'l7/scene';\n * import { PointLayer } from 'l7/layers';\n *\n * const scene = new Scene();\n * const pointLayer = new PointLayer();\n * scene.addLayer(pointLayer);\n *\n */\nclass Scene\n implements IPostProcessingPassPluggable, IMapController, ILayerManager {\n private sceneService: ISceneService;\n private mapService: IMapService<unknown>;\n private controlService: IControlService;\n private layerService: ILayerService;\n private iconService: IIconService;\n private markerService: IMarkerService;\n private popupService: IPopupService;\n private fontService: IFontService;\n private interactionService: IInteractionService;\n private container: Container;\n\n public constructor(config: ISceneConfig) {\n const { id, map, canvas, hasBaseMap } = config;\n // 创建场景容器\n const sceneContainer = createSceneContainer();\n this.container = sceneContainer;\n // 绑定地图服务\n map.setContainer(sceneContainer, id, canvas, hasBaseMap);\n\n // 绑定渲染引擎服务\n sceneContainer\n .bind<IRendererService>(TYPES.IRendererService)\n .to(ReglRendererService)\n .inSingletonScope();\n\n // 依赖注入\n this.sceneService = sceneContainer.get<ISceneService>(TYPES.ISceneService);\n this.mapService = sceneContainer.get<IMapService<unknown>>(\n TYPES.IMapService,\n );\n this.iconService = sceneContainer.get<IIconService>(TYPES.IIconService);\n this.fontService = sceneContainer.get<IFontService>(TYPES.IFontService);\n this.controlService = sceneContainer.get<IControlService>(\n TYPES.IControlService,\n );\n this.layerService = sceneContainer.get<ILayerService>(TYPES.ILayerService);\n\n this.markerService = sceneContainer.get<IMarkerService>(\n TYPES.IMarkerService,\n );\n this.interactionService = sceneContainer.get<IInteractionService>(\n TYPES.IInteractionService,\n );\n this.popupService = sceneContainer.get<IPopupService>(TYPES.IPopupService);\n\n if (isMini) {\n this.sceneService.initMiniScene(config);\n } else {\n this.initComponent(id);\n\n // 初始化 scene\n this.sceneService.init(config);\n // TODO: 初始化组件\n\n this.initControl();\n }\n }\n\n public get map() {\n return this.mapService.map;\n }\n\n public get loaded() {\n return this.sceneService.loaded;\n }\n\n public getServiceContainer(): Container {\n return this.container;\n }\n public getSize(): [number, number] {\n return this.mapService.getSize();\n }\n public getMinZoom(): number {\n return this.mapService.getMinZoom();\n }\n public getMaxZoom(): number {\n return this.mapService.getMaxZoom();\n }\n public getType(): string {\n return this.mapService.getType();\n }\n public getMapContainer(): HTMLElement | null {\n return this.mapService.getMapContainer();\n }\n public getMapCanvasContainer(): HTMLElement {\n return this.mapService.getMapCanvasContainer() as HTMLElement;\n }\n\n public getMapService(): IMapService<unknown> {\n return this.mapService;\n }\n public exportPng(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public exportMap(type?: 'png' | 'jpg'): string {\n return this.sceneService.exportPng(type);\n }\n\n public registerRenderService(render: any) {\n if (this.sceneService.loaded) {\n const renderSerivce = new render(this);\n renderSerivce.init();\n } else {\n this.on('loaded', () => {\n const renderSerivce = new render(this);\n renderSerivce.init();\n });\n }\n }\n\n public setBgColor(color: string) {\n this.mapService.setBgColor(color);\n }\n\n // layer 管理\n public addLayer(layer: ILayer): void {\n // 为当前图层创建一个容器\n // TODO: 初始化的时候设置 容器\n const layerContainer = createLayerContainer(this.container);\n layer.setContainer(layerContainer, this.container);\n this.sceneService.addLayer(layer);\n\n const layerConfig = layer.getLayerConfig();\n if (layerConfig) {\n // 若 layer 未初始化成功,则 layerConfig 为 undefined (scene loaded 尚未执行完成)\n const {\n mask,\n maskfence,\n maskColor = '#000',\n maskOpacity = 0,\n } = layerConfig;\n if (mask && maskfence) {\n const maskInstance = new MaskLayer()\n .source(maskfence)\n .shape('fill')\n .color(maskColor)\n .style({\n opacity: maskOpacity,\n });\n\n this.addMask(maskInstance, layer.id);\n }\n } else {\n console.warn('addLayer should run after scene loaded!');\n }\n }\n\n public addMask(mask: ILayer, layerId: string) {\n const parent = this.getLayer(layerId);\n if (parent) {\n const layerContainer = createLayerContainer(this.container);\n mask.setContainer(layerContainer, this.container);\n parent.addMaskLayer(mask);\n this.sceneService.addLayer(mask);\n } else {\n console.warn('parent layer not find!');\n }\n }\n\n public getPickedLayer() {\n return this.layerService.pickedLayerId;\n }\n\n public getLayers(): ILayer[] {\n return this.layerService.getLayers();\n }\n\n public getLayer(id: string): ILayer | undefined {\n return this.layerService.getLayer(id);\n }\n\n public getLayerByName(name: string): ILayer | undefined {\n return this.layerService.getLayerByName(name);\n }\n\n public removeLayer(layer: ILayer, parentLayer?: ILayer): void {\n this.layerService.remove(layer, parentLayer);\n }\n\n public removeAllLayer(): void {\n this.layerService.removeAllLayers();\n }\n\n public render(): void {\n this.sceneService.render();\n }\n\n public setEnableRender(flag: boolean) {\n this.layerService.setEnableRender(flag);\n }\n\n // asset method\n /**\n * 为 layer/point/text 支持 iconfont 模式支持\n * @param fontUnicode\n * @param name\n */\n public addIconFont(name: string, fontUnicode: string): void {\n this.fontService.addIconFont(name, fontUnicode);\n }\n\n public addIconFonts(options: string[][]): void {\n options.forEach(([name, fontUnicode]) => {\n this.fontService.addIconFont(name, fontUnicode);\n });\n }\n /**\n * 用户自定义添加第三方字体\n * @param fontFamily\n * @param fontPath\n */\n public addFontFace(fontFamily: string, fontPath: string): void {\n this.sceneService.addFontFace(fontFamily, fontPath);\n }\n\n public addImage(id: string, img: IImage) {\n if (!isMini) {\n this.iconService.addImage(id, img);\n } else {\n this.iconService.addImageMini(id, img, this.sceneService);\n }\n // this.iconService.addImage(id, img);\n }\n\n public hasImage(id: string) {\n return this.iconService.hasImage(id);\n }\n\n public removeImage(id: string) {\n this.iconService.removeImage(id);\n }\n\n public addIconFontGlyphs(fontFamily: string, glyphs: IIconFontGlyph[]) {\n this.fontService.addIconGlyphs(glyphs);\n }\n\n // map control method\n public addControl(ctr: IControl) {\n this.controlService.addControl(ctr, this.container);\n }\n\n public removeControl(ctr: IControl) {\n this.controlService.removeControl(ctr);\n }\n\n public getControlByName(name: string) {\n return this.controlService.getControlByName(name);\n }\n\n // marker\n public addMarker(marker: IMarker) {\n this.markerService.addMarker(marker);\n }\n\n public addMarkerLayer(layer: IMarkerLayer) {\n this.markerService.addMarkerLayer(layer);\n }\n\n public removeMarkerLayer(layer: IMarkerLayer) {\n this.markerService.removeMarkerLayer(layer);\n }\n\n public removeAllMakers() {\n this.markerService.removeAllMarkers();\n }\n\n public addPopup(popup: IPopup) {\n this.popupService.addPopup(popup);\n }\n\n public on(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.on(type, handle)\n : this.sceneService.on(type, handle);\n }\n\n public once(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.once(type, handle)\n : this.sceneService.once(type, handle);\n }\n\n public off(type: string, handle: (...args: any[]) => void): void {\n SceneEventList.indexOf(type) === -1\n ? this.mapService.off(type, handle)\n : this.sceneService.off(type, handle);\n }\n\n // implements IMapController\n\n public getZoom(): number {\n return this.mapService.getZoom();\n }\n\n public getCenter(options?: ICameraOptions): ILngLat {\n return this.mapService.getCenter(options);\n }\n\n public setCenter(center: [number, number], options?: ICameraOptions) {\n return this.mapService.setCenter(center, options);\n }\n\n public getPitch(): number {\n return this.mapService.getPitch();\n }\n\n public setPitch(pitch: number) {\n return this.mapService.setPitch(pitch);\n }\n\n public getRotation(): number {\n return this.mapService.getRotation();\n }\n\n public getBounds(): Bounds {\n return this.mapService.getBounds();\n }\n\n public setRotation(rotation: number): void {\n this.mapService.setRotation(rotation);\n }\n public zoomIn(): void {\n this.mapService.zoomIn();\n }\n\n public zoomOut(): void {\n this.mapService.zoomOut();\n }\n\n public panTo(p: Point): void {\n this.mapService.panTo(p);\n }\n\n public panBy(x: number, y: number): void {\n this.mapService.panBy(x, y);\n }\n\n public getContainer() {\n return this.mapService.getContainer();\n }\n public setZoom(zoom: number): void {\n this.mapService.setZoom(zoom);\n }\n public fitBounds(bound: Bounds, options?: unknown): void {\n const { fitBoundsOptions, animate } = this.sceneService.getSceneConfig();\n this.mapService.fitBounds(\n bound,\n // 选项优先级:用户传入,覆盖animate直接配置,覆盖Scene配置项传入\n options || {\n ...(fitBoundsOptions as object),\n animate,\n },\n );\n }\n\n public setZoomAndCenter(zoom: number, center: Point): void {\n this.mapService.setZoomAndCenter(zoom, center);\n }\n\n public setMapStyle(style: any): void {\n this.mapService.setMapStyle(style);\n }\n\n public setMapStatus(options: Partial<IStatusOptions>) {\n this.mapService.setMapStatus(options);\n }\n\n // conversion Method\n public pixelToLngLat(pixel: Point): ILngLat {\n return this.mapService.pixelToLngLat(pixel);\n }\n\n public lngLatToPixel(lnglat: Point): IPoint {\n return this.mapService.lngLatToPixel(lnglat);\n }\n\n public containerToLngLat(pixel: Point): ILngLat {\n return this.mapService.containerToLngLat(pixel);\n }\n\n public lngLatToContainer(lnglat: Point): IPoint {\n return this.mapService.lngLatToContainer(lnglat);\n }\n\n public destroy() {\n this.sceneService.destroy();\n // TODO: 清理其他 Service 例如 IconService\n }\n\n public registerPostProcessingPass(\n constructor: new (...args: any[]) => IPostProcessingPass<unknown>,\n name: string,\n ) {\n this.container\n .bind<IPostProcessingPass<unknown>>(TYPES.IPostProcessingPass)\n .to(constructor)\n .whenTargetNamed(name);\n }\n\n // 控制 shader pick 计算\n public enableShaderPick() {\n this.layerService.enableShaderPick();\n }\n\n public diasbleShaderPick() {\n this.layerService.disableShaderPick();\n }\n\n // get current point size info\n public getPointSizeRange() {\n return this.sceneService.getPointSizeRange();\n }\n\n private initComponent(id: string | HTMLDivElement) {\n this.controlService.init(\n {\n container: DOM.getContainer(id),\n },\n this.container,\n );\n this.markerService.init(this.container);\n this.popupService.init(this.container);\n }\n\n private initControl() {\n const { logoVisible, logoPosition } = this.sceneService.getSceneConfig();\n if (logoVisible) {\n this.addControl(new Logo({ position: logoPosition }));\n }\n }\n}\n\nexport { Scene };\n"],"file":"index.js"}