@antv/l7-layers 2.20.20 → 2.21.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.
Files changed (138) hide show
  1. package/es/canvas/index.d.ts +13 -8
  2. package/es/canvas/index.js +63 -36
  3. package/es/canvas/models/canvas.d.ts +19 -14
  4. package/es/canvas/models/canvas.js +125 -139
  5. package/es/canvas/models/constants.d.ts +2 -0
  6. package/es/canvas/models/constants.js +6 -0
  7. package/es/canvas/models/index.d.ts +2 -5
  8. package/es/canvas/models/index.js +2 -5
  9. package/es/core/BaseLayer.d.ts +18 -19
  10. package/es/core/BaseLayer.js +134 -101
  11. package/es/core/BaseModel.js +15 -31
  12. package/es/core/LayerPickService.js +4 -6
  13. package/es/core/TextureService.js +1 -2
  14. package/es/core/interface.d.ts +31 -4
  15. package/es/core/shape/Path.js +1 -2
  16. package/es/core/shape/arrow.js +2 -6
  17. package/es/core/shape/extrude.js +0 -1
  18. package/es/core/triangulation.js +2 -2
  19. package/es/earth/models/base.js +0 -1
  20. package/es/heatmap/index.js +0 -1
  21. package/es/heatmap/models/heatmap.d.ts +0 -1
  22. package/es/heatmap/models/heatmap.js +2 -5
  23. package/es/index.d.ts +2 -1
  24. package/es/index.js +2 -89
  25. package/es/line/models/arc.js +5 -5
  26. package/es/line/models/arc_3d.js +4 -4
  27. package/es/line/models/great_circle.js +4 -4
  28. package/es/line/models/line.js +8 -12
  29. package/es/line/models/simple_line.js +1 -2
  30. package/es/line/models/wall.js +5 -4
  31. package/es/line/shaders/line/line_vert.glsl +0 -2
  32. package/es/line/shaders/wall/wall_vert.glsl +15 -0
  33. package/es/plugins/DataMappingPlugin.d.ts +4 -7
  34. package/es/plugins/DataMappingPlugin.js +8 -25
  35. package/es/plugins/DataSourcePlugin.d.ts +0 -1
  36. package/es/plugins/DataSourcePlugin.js +4 -7
  37. package/es/plugins/FeatureScalePlugin.d.ts +2 -5
  38. package/es/plugins/FeatureScalePlugin.js +5 -7
  39. package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -1
  40. package/es/plugins/LayerAnimateStylePlugin.js +2 -5
  41. package/es/plugins/LayerMaskPlugin.d.ts +0 -1
  42. package/es/plugins/LayerMaskPlugin.js +2 -8
  43. package/es/plugins/LayerModelPlugin.d.ts +0 -1
  44. package/es/plugins/LayerModelPlugin.js +13 -18
  45. package/es/plugins/LayerStylePlugin.d.ts +0 -1
  46. package/es/plugins/LayerStylePlugin.js +2 -5
  47. package/es/plugins/LightingPlugin.d.ts +0 -1
  48. package/es/plugins/LightingPlugin.js +2 -5
  49. package/es/plugins/MultiPassRendererPlugin.d.ts +0 -1
  50. package/es/plugins/MultiPassRendererPlugin.js +2 -5
  51. package/es/plugins/PixelPickingPlugin.d.ts +2 -6
  52. package/es/plugins/PixelPickingPlugin.js +6 -12
  53. package/es/plugins/RegisterStyleAttributePlugin.d.ts +2 -5
  54. package/es/plugins/RegisterStyleAttributePlugin.js +2 -5
  55. package/es/plugins/ShaderUniformPlugin.d.ts +7 -8
  56. package/es/plugins/ShaderUniformPlugin.js +17 -43
  57. package/es/plugins/UpdateModelPlugin.d.ts +0 -1
  58. package/es/plugins/UpdateModelPlugin.js +2 -5
  59. package/es/plugins/UpdateStyleAttributePlugin.d.ts +2 -5
  60. package/es/plugins/UpdateStyleAttributePlugin.js +2 -6
  61. package/es/plugins/index.d.ts +15 -0
  62. package/es/plugins/index.js +18 -0
  63. package/es/point/models/fill.d.ts +1 -1
  64. package/es/point/models/fill.js +7 -10
  65. package/es/point/models/fillImage.js +4 -3
  66. package/es/point/models/image.js +4 -3
  67. package/es/polygon/models/extrude.js +0 -1
  68. package/es/polygon/models/fill.js +2 -3
  69. package/es/polygon/models/index.js +0 -1
  70. package/es/polygon/models/ocean.js +1 -2
  71. package/es/polygon/models/water.js +0 -2
  72. package/es/tile/core/BaseLayer.js +4 -5
  73. package/es/tile/interaction/getRasterData.js +0 -3
  74. package/es/tile/service/TileLayerService.d.ts +0 -1
  75. package/es/tile/service/TileLayerService.js +0 -1
  76. package/es/tile/service/TilePickService.d.ts +1 -1
  77. package/es/tile/service/TilePickService.js +2 -3
  78. package/es/tile/tile/Tile.js +8 -6
  79. package/es/utils/blend.js +7 -8
  80. package/es/utils/polylineNormal.js +0 -1
  81. package/es/utils/rampcolor_legend.js +1 -2
  82. package/es/wind/index.js +0 -1
  83. package/lib/canvas/index.js +63 -37
  84. package/lib/canvas/models/canvas.js +125 -138
  85. package/lib/canvas/models/constants.js +12 -0
  86. package/lib/canvas/models/index.js +22 -7
  87. package/lib/core/BaseLayer.js +134 -101
  88. package/lib/core/BaseModel.js +14 -30
  89. package/lib/core/LayerPickService.js +4 -6
  90. package/lib/core/TextureService.js +1 -2
  91. package/lib/core/shape/Path.js +1 -2
  92. package/lib/core/shape/arrow.js +2 -6
  93. package/lib/core/shape/extrude.js +0 -1
  94. package/lib/core/triangulation.js +2 -2
  95. package/lib/earth/models/base.js +0 -1
  96. package/lib/heatmap/index.js +0 -1
  97. package/lib/heatmap/models/heatmap.js +2 -5
  98. package/lib/index.js +9 -90
  99. package/lib/line/models/arc.js +4 -4
  100. package/lib/line/models/arc_3d.js +4 -4
  101. package/lib/line/models/great_circle.js +4 -4
  102. package/lib/line/models/line.js +10 -12
  103. package/lib/line/models/simple_line.js +0 -1
  104. package/lib/line/models/wall.js +5 -4
  105. package/lib/line/shaders/line/line_vert.glsl +0 -2
  106. package/lib/line/shaders/wall/wall_vert.glsl +15 -0
  107. package/lib/plugins/DataMappingPlugin.js +7 -24
  108. package/lib/plugins/DataSourcePlugin.js +3 -6
  109. package/lib/plugins/FeatureScalePlugin.js +5 -7
  110. package/lib/plugins/LayerAnimateStylePlugin.js +2 -5
  111. package/lib/plugins/LayerMaskPlugin.js +2 -8
  112. package/lib/plugins/LayerModelPlugin.js +13 -18
  113. package/lib/plugins/LayerStylePlugin.js +2 -5
  114. package/lib/plugins/LightingPlugin.js +2 -5
  115. package/lib/plugins/MultiPassRendererPlugin.js +2 -5
  116. package/lib/plugins/PixelPickingPlugin.js +6 -12
  117. package/lib/plugins/RegisterStyleAttributePlugin.js +2 -5
  118. package/lib/plugins/ShaderUniformPlugin.js +16 -42
  119. package/lib/plugins/UpdateModelPlugin.js +2 -5
  120. package/lib/plugins/UpdateStyleAttributePlugin.js +2 -5
  121. package/lib/plugins/index.js +26 -0
  122. package/lib/point/models/fill.js +10 -13
  123. package/lib/point/models/fillImage.js +4 -3
  124. package/lib/point/models/image.js +4 -3
  125. package/lib/polygon/models/extrude.js +0 -1
  126. package/lib/polygon/models/fill.js +1 -2
  127. package/lib/polygon/models/ocean.js +0 -1
  128. package/lib/polygon/models/water.js +0 -2
  129. package/lib/tile/core/BaseLayer.js +4 -5
  130. package/lib/tile/interaction/getRasterData.js +0 -3
  131. package/lib/tile/service/TileLayerService.js +0 -1
  132. package/lib/tile/service/TilePickService.js +2 -3
  133. package/lib/tile/tile/Tile.js +8 -6
  134. package/lib/utils/blend.js +7 -8
  135. package/lib/utils/polylineNormal.js +0 -1
  136. package/lib/utils/rampcolor_legend.js +1 -2
  137. package/lib/wind/index.js +0 -1
  138. package/package.json +18 -20
@@ -1,29 +1,24 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
- import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty";
4
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
6
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
8
- import _initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWarningHelper";
9
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
10
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
11
- import { IDebugLog, ILayerStage, TYPES } from '@antv/l7-core';
6
+ import { IDebugLog, ILayerStage } from '@antv/l7-core';
12
7
  import { lodashUtil, normalize, rgb2arr } from '@antv/l7-utils';
13
- import { inject, injectable } from 'inversify';
14
- import 'reflect-metadata';
15
8
  var cloneDeep = lodashUtil.cloneDeep;
16
- var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService), _dec3 = inject(TYPES.IFontService), _dec(_class = (_class2 = /*#__PURE__*/function () {
9
+ var DataMappingPlugin = /*#__PURE__*/function () {
17
10
  function DataMappingPlugin() {
18
11
  _classCallCheck(this, DataMappingPlugin);
19
- _initializerDefineProperty(this, "mapService", _descriptor, this);
20
- _initializerDefineProperty(this, "fontService", _descriptor2, this);
21
12
  }
22
13
  _createClass(DataMappingPlugin, [{
23
14
  key: "apply",
24
15
  value: function apply(layer, _ref) {
25
16
  var _this = this;
26
- var styleAttributeService = _ref.styleAttributeService;
17
+ var styleAttributeService = _ref.styleAttributeService,
18
+ mapService = _ref.mapService,
19
+ fontService = _ref.fontService;
20
+ this.mapService = mapService;
21
+ this.fontService = fontService;
27
22
  layer.hooks.init.tapPromise('DataMappingPlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
28
23
  return _regeneratorRuntime.wrap(function _callee$(_context) {
29
24
  while (1) switch (_context.prev = _context.next) {
@@ -87,7 +82,6 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
87
82
  return attribute.needRemapping;
88
83
  } // 如果filter变化
89
84
  );
90
-
91
85
  var filterData = dataArray;
92
86
  // 数据过滤完 再执行数据映射
93
87
  if (filter !== null && filter !== void 0 && filter.needRemapping && filter !== null && filter !== void 0 && filter.scale) {
@@ -99,7 +93,6 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
99
93
  // 过滤数据
100
94
  var encodeData = _this.mapping(layer, attributesToRemapping, filterData, layer.getEncodedData() // TODO 优化
101
95
  );
102
-
103
96
  layer.setEncodedData(encodeData);
104
97
  }
105
98
 
@@ -276,15 +269,5 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
276
269
  }
277
270
  }]);
278
271
  return DataMappingPlugin;
279
- }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "mapService", [_dec2], {
280
- configurable: true,
281
- enumerable: true,
282
- writable: true,
283
- initializer: null
284
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "fontService", [_dec3], {
285
- configurable: true,
286
- enumerable: true,
287
- writable: true,
288
- initializer: null
289
- })), _class2)) || _class);
272
+ }();
290
273
  export { DataMappingPlugin as default };
@@ -1,5 +1,4 @@
1
1
  import type { ILayer, ILayerPlugin, IMapService } from '@antv/l7-core';
2
- import 'reflect-metadata';
3
2
  export default class DataSourcePlugin implements ILayerPlugin {
4
3
  protected mapService: IMapService;
5
4
  apply(layer: ILayer): void;
@@ -1,13 +1,10 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- var _dec, _class;
5
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
- import { IDebugLog, ILayerStage, TYPES } from '@antv/l7-core';
5
+ import { IDebugLog, ILayerStage } from '@antv/l7-core';
7
6
  import Source from '@antv/l7-source';
8
- import { injectable } from 'inversify';
9
- import 'reflect-metadata';
10
- var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
7
+ var DataSourcePlugin = /*#__PURE__*/function () {
11
8
  function DataSourcePlugin() {
12
9
  _classCallCheck(this, DataSourcePlugin);
13
10
  }
@@ -15,7 +12,7 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
15
12
  key: "apply",
16
13
  value: function apply(layer) {
17
14
  var _this = this;
18
- this.mapService = layer.getContainer().get(TYPES.IMapService);
15
+ this.mapService = layer.getContainer().mapService;
19
16
  layer.hooks.init.tapPromise('DataSourcePlugin', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
20
17
  var source, _ref2, data, options;
21
18
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -102,5 +99,5 @@ var DataSourcePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
102
99
  }
103
100
  }]);
104
101
  return DataSourcePlugin;
105
- }()) || _class);
102
+ }();
106
103
  export { DataSourcePlugin as default };
@@ -1,13 +1,10 @@
1
- import type { ILayer, ILayerPlugin, IStyleAttributeService } from '@antv/l7-core';
2
- import 'reflect-metadata';
1
+ import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
3
2
  /**
4
3
  * 根据 Source 原始数据为指定字段创建 Scale,保存在 StyleAttribute 上,供下游插件使用
5
4
  */
6
5
  export default class FeatureScalePlugin implements ILayerPlugin {
7
6
  private scaleOptions;
8
- apply(layer: ILayer, { styleAttributeService, }: {
9
- styleAttributeService: IStyleAttributeService;
10
- }): void;
7
+ apply(layer: ILayer, { styleAttributeService }: L7Container): void;
11
8
  private isNumber;
12
9
  private caculateScalesForAttributes;
13
10
  /**
@@ -3,25 +3,23 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/esm/createClass";
5
5
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
- var _scaleMap, _dec, _class;
6
+ var _scaleMap;
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
8
  import { IDebugLog, ILayerStage, ScaleTypes, StyleScaleType } from '@antv/l7-core';
9
9
  import { lodashUtil } from '@antv/l7-utils';
10
10
  import { extent } from 'd3-array';
11
11
  import * as d3interpolate from 'd3-interpolate';
12
12
  import * as d3 from 'd3-scale';
13
- import { injectable } from 'inversify';
14
- import 'reflect-metadata';
15
13
  import identity from "../utils/identityScale";
16
14
  var isNil = lodashUtil.isNil,
17
15
  isString = lodashUtil.isString,
18
16
  uniq = lodashUtil.uniq;
19
17
  var dateRegex = /^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]?)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;
20
- var scaleMap = (_scaleMap = {}, _defineProperty(_scaleMap, ScaleTypes.LINEAR, d3.scaleLinear), _defineProperty(_scaleMap, ScaleTypes.POWER, d3.scalePow), _defineProperty(_scaleMap, ScaleTypes.LOG, d3.scaleLog), _defineProperty(_scaleMap, ScaleTypes.IDENTITY, identity), _defineProperty(_scaleMap, ScaleTypes.SEQUENTIAL, d3.scaleSequential), _defineProperty(_scaleMap, ScaleTypes.TIME, d3.scaleTime), _defineProperty(_scaleMap, ScaleTypes.QUANTILE, d3.scaleQuantile), _defineProperty(_scaleMap, ScaleTypes.QUANTIZE, d3.scaleQuantize), _defineProperty(_scaleMap, ScaleTypes.THRESHOLD, d3.scaleThreshold), _defineProperty(_scaleMap, ScaleTypes.CAT, d3.scaleOrdinal), _defineProperty(_scaleMap, ScaleTypes.DIVERGING, d3.scaleDiverging), _scaleMap);
18
+ var scaleMap = (_scaleMap = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_scaleMap, ScaleTypes.LINEAR, d3.scaleLinear), ScaleTypes.POWER, d3.scalePow), ScaleTypes.LOG, d3.scaleLog), ScaleTypes.IDENTITY, identity), ScaleTypes.SEQUENTIAL, d3.scaleSequential), ScaleTypes.TIME, d3.scaleTime), ScaleTypes.QUANTILE, d3.scaleQuantile), ScaleTypes.QUANTIZE, d3.scaleQuantize), ScaleTypes.THRESHOLD, d3.scaleThreshold), ScaleTypes.CAT, d3.scaleOrdinal), _defineProperty(_scaleMap, ScaleTypes.DIVERGING, d3.scaleDiverging));
21
19
  /**
22
20
  * 根据 Source 原始数据为指定字段创建 Scale,保存在 StyleAttribute 上,供下游插件使用
23
21
  */
24
- var FeatureScalePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
22
+ var FeatureScalePlugin = /*#__PURE__*/function () {
25
23
  function FeatureScalePlugin() {
26
24
  _classCallCheck(this, FeatureScalePlugin);
27
25
  _defineProperty(this, "scaleOptions", {});
@@ -280,7 +278,7 @@ var FeatureScalePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
280
278
  // quantile domain 需要根据ID 进行去重
281
279
  var values = [];
282
280
  if (type === ScaleTypes.QUANTILE) {
283
- // 根据 obejct 属性 _id 进行去重
281
+ // 根据 obejct 属性 _id 进行去重
284
282
  var idMap = new Map();
285
283
  data === null || data === void 0 || data.forEach(function (obj) {
286
284
  idMap.set(obj._id, obj[field]);
@@ -336,5 +334,5 @@ var FeatureScalePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
336
334
  }
337
335
  }]);
338
336
  return FeatureScalePlugin;
339
- }()) || _class);
337
+ }();
340
338
  export { FeatureScalePlugin as default };
@@ -1,5 +1,4 @@
1
1
  import type { ILayer, ILayerPlugin } from '@antv/l7-core';
2
- import 'reflect-metadata';
3
2
  export default class LayerAnimateStylePlugin implements ILayerPlugin {
4
3
  apply(layer: ILayer): void;
5
4
  }
@@ -1,10 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- var _dec, _class;
5
- import { injectable } from 'inversify';
6
- import 'reflect-metadata';
7
- var LayerAnimateStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
4
+ var LayerAnimateStylePlugin = /*#__PURE__*/function () {
8
5
  function LayerAnimateStylePlugin() {
9
6
  _classCallCheck(this, LayerAnimateStylePlugin);
10
7
  }
@@ -23,5 +20,5 @@ var LayerAnimateStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/f
23
20
  }
24
21
  }]);
25
22
  return LayerAnimateStylePlugin;
26
- }()) || _class);
23
+ }();
27
24
  export { LayerAnimateStylePlugin as default };
@@ -1,5 +1,4 @@
1
1
  import type { ILayer, ILayerPlugin } from '@antv/l7-core';
2
- import 'reflect-metadata';
3
2
  /**
4
3
  * 更新图层样式,初始图层相关配置
5
4
  */
@@ -1,13 +1,9 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- var _dec, _class;
5
- import { injectable } from 'inversify';
6
- import 'reflect-metadata';
7
3
  /**
8
4
  * 更新图层样式,初始图层相关配置
9
5
  */
10
- var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
6
+ var LayerStylePlugin = /*#__PURE__*/function () {
11
7
  function LayerStylePlugin() {
12
8
  _classCallCheck(this, LayerStylePlugin);
13
9
  }
@@ -20,8 +16,6 @@ var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
20
16
  enableMask = _layer$getLayerConfig.enableMask;
21
17
  // mask 初始化
22
18
  if (!layer.tileLayer && maskLayers && maskLayers.length > 0) {
23
- var _layer$masks;
24
- (_layer$masks = layer.masks).push.apply(_layer$masks, _toConsumableArray(maskLayers));
25
19
  layer.updateLayerConfig({
26
20
  mask: true && enableMask
27
21
  });
@@ -30,5 +24,5 @@ var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
30
24
  }
31
25
  }]);
32
26
  return LayerStylePlugin;
33
- }()) || _class);
27
+ }();
34
28
  export { LayerStylePlugin as default };
@@ -1,5 +1,4 @@
1
1
  import type { ILayer, ILayerPlugin } from '@antv/l7-core';
2
- import 'reflect-metadata';
3
2
  /**
4
3
  * Layer Model 初始化,更新,销毁
5
4
  */
@@ -1,16 +1,13 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- var _dec, _class;
5
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
5
  import { IDebugLog, ILayerStage } from '@antv/l7-core';
7
- import { injectable } from 'inversify';
8
- import 'reflect-metadata';
9
- import TileLayer from "../tile/core/BaseLayer";
6
+ // import TileLayer from '../tile/core/BaseLayer';
10
7
  /**
11
8
  * Layer Model 初始化,更新,销毁
12
9
  */
13
- var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
10
+ var LayerModelPlugin = /*#__PURE__*/function () {
14
11
  function LayerModelPlugin() {
15
12
  _classCallCheck(this, LayerModelPlugin);
16
13
  }
@@ -90,19 +87,18 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
90
87
  while (1) switch (_context4.prev = _context4.next) {
91
88
  case 0:
92
89
  if (!layer.getSource().isTile) {
93
- _context4.next = 4;
90
+ _context4.next = 3;
94
91
  break;
95
92
  }
96
93
  layer.prepareBuildModel();
97
- layer.tileLayer = new TileLayer(layer);
98
94
  return _context4.abrupt("return");
99
- case 4:
95
+ case 3:
100
96
  layer.log(IDebugLog.BuildModelStart, ILayerStage.INIT);
101
- _context4.next = 7;
97
+ _context4.next = 6;
102
98
  return _this.initLayerModel(layer);
103
- case 7:
99
+ case 6:
104
100
  layer.log(IDebugLog.BuildModelEnd, ILayerStage.INIT);
105
- case 8:
101
+ case 7:
106
102
  case "end":
107
103
  return _context4.stop();
108
104
  }
@@ -120,19 +116,18 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
120
116
  return _context5.abrupt("return", false);
121
117
  case 2:
122
118
  if (!layer.getSource().isTile) {
123
- _context5.next = 5;
119
+ _context5.next = 4;
124
120
  break;
125
121
  }
126
- layer.tileLayer = new TileLayer(layer);
127
122
  return _context5.abrupt("return", false);
128
- case 5:
123
+ case 4:
129
124
  layer.log(IDebugLog.BuildModelStart, ILayerStage.UPDATE);
130
- _context5.next = 8;
125
+ _context5.next = 7;
131
126
  return _this.prepareLayerModel(layer);
132
- case 8:
127
+ case 7:
133
128
  layer.log(IDebugLog.BuildModelEnd, ILayerStage.UPDATE);
134
129
  return _context5.abrupt("return", true);
135
- case 10:
130
+ case 9:
136
131
  case "end":
137
132
  return _context5.stop();
138
133
  }
@@ -145,5 +140,5 @@ var LayerModelPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
145
140
  }
146
141
  }]);
147
142
  return LayerModelPlugin;
148
- }()) || _class);
143
+ }();
149
144
  export { LayerModelPlugin as default };
@@ -1,5 +1,4 @@
1
1
  import type { ILayer, ILayerPlugin } from '@antv/l7-core';
2
- import 'reflect-metadata';
3
2
  /**
4
3
  * 更新图层样式,初始图层相关配置
5
4
  */
@@ -1,12 +1,9 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- var _dec, _class;
4
- import { injectable } from 'inversify';
5
- import 'reflect-metadata';
6
3
  /**
7
4
  * 更新图层样式,初始图层相关配置
8
5
  */
9
- var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
6
+ var LayerStylePlugin = /*#__PURE__*/function () {
10
7
  function LayerStylePlugin() {
11
8
  _classCallCheck(this, LayerStylePlugin);
12
9
  }
@@ -26,5 +23,5 @@ var LayerStylePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function
26
23
  }
27
24
  }]);
28
25
  return LayerStylePlugin;
29
- }()) || _class);
26
+ }();
30
27
  export { LayerStylePlugin as default };
@@ -1,5 +1,4 @@
1
1
  import type { ILayer, ILayerPlugin } from '@antv/l7-core';
2
- import 'reflect-metadata';
3
2
  interface IDirectionalLight {
4
3
  type: 'directional';
5
4
  direction: [number, number, number];
@@ -2,10 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
5
- var _dec, _class;
6
5
  var _excluded = ["type"];
7
- import { injectable } from 'inversify';
8
- import 'reflect-metadata';
9
6
  var lightTypeUniformMap = {
10
7
  directional: {
11
8
  lights: 'u_DirectionalLights',
@@ -72,7 +69,7 @@ export function generateLightingUniforms(lights) {
72
69
  /**
73
70
  * 光照 & Shadow
74
71
  */
75
- var LightingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
72
+ var LightingPlugin = /*#__PURE__*/function () {
76
73
  function LightingPlugin() {
77
74
  _classCallCheck(this, LightingPlugin);
78
75
  }
@@ -94,5 +91,5 @@ var LightingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function (
94
91
  }
95
92
  }]);
96
93
  return LightingPlugin;
97
- }()) || _class);
94
+ }();
98
95
  export { LightingPlugin as default };
@@ -1,5 +1,4 @@
1
1
  import type { ILayer, ILayerPlugin, IPass, IPostProcessingPass, IRendererService } from '@antv/l7-core';
2
- import 'reflect-metadata';
3
2
  /**
4
3
  * 自定义渲染管线:
5
4
  * ClearPass -> PixelPickingPass(可选) -> RenderPass/TAAPass -> PostProcessing -> CopyPass
@@ -1,8 +1,5 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- var _dec, _class;
4
- import { injectable } from 'inversify';
5
- import 'reflect-metadata';
6
3
  import { createMultiPassRenderer } from "../utils/multiPassRender";
7
4
 
8
5
  /**
@@ -18,7 +15,7 @@ import { createMultiPassRenderer } from "../utils/multiPassRender";
18
15
  * ],
19
16
  * })
20
17
  */
21
- var MultiPassRendererPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
18
+ var MultiPassRendererPlugin = /*#__PURE__*/function () {
22
19
  function MultiPassRendererPlugin() {
23
20
  _classCallCheck(this, MultiPassRendererPlugin);
24
21
  }
@@ -56,5 +53,5 @@ var MultiPassRendererPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/f
56
53
  }
57
54
  }]);
58
55
  return MultiPassRendererPlugin;
59
- }()) || _class);
56
+ }();
60
57
  export { MultiPassRendererPlugin as default };
@@ -1,5 +1,4 @@
1
- import type { ILayer, ILayerPlugin, IRendererService, IStyleAttributeService } from '@antv/l7-core';
2
- import 'reflect-metadata';
1
+ import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
3
2
  export default class PixelPickingPlugin implements ILayerPlugin {
4
3
  /**
5
4
  * Use map to keep order of insertion.
@@ -8,8 +7,5 @@ export default class PixelPickingPlugin implements ILayerPlugin {
8
7
  private pickingUniformMap;
9
8
  private pickOption2Array;
10
9
  private updatePickOption;
11
- apply(layer: ILayer, { rendererService, styleAttributeService, }: {
12
- rendererService: IRendererService;
13
- styleAttributeService: IStyleAttributeService;
14
- }): void;
10
+ apply(layer: ILayer, { styleAttributeService }: L7Container): void;
15
11
  }
@@ -1,11 +1,8 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- var _dec, _class;
5
4
  import { AttributeType, gl } from '@antv/l7-core';
6
5
  import { decodePickingColor, encodePickingColor, lodashUtil, rgb2arr } from '@antv/l7-utils';
7
- import { injectable } from 'inversify';
8
- import 'reflect-metadata';
9
6
  import { ShaderLocation } from "../core/CommonStyleAttribute";
10
7
  var isNumber = lodashUtil.isNumber;
11
8
  var PickingStage = {
@@ -13,7 +10,7 @@ var PickingStage = {
13
10
  ENCODE: 1.0,
14
11
  HIGHLIGHT: 2.0
15
12
  };
16
- var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
13
+ var PixelPickingPlugin = /*#__PURE__*/function () {
17
14
  function PixelPickingPlugin() {
18
15
  _classCallCheck(this, PixelPickingPlugin);
19
16
  }
@@ -27,7 +24,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
27
24
 
28
25
  function pickOption2Array() {
29
26
  var array = [];
30
- this.pickingUniformMap.forEach(function (value, key) {
27
+ this.pickingUniformMap.forEach(function (value) {
31
28
  if (isNumber(value)) {
32
29
  array.push(value);
33
30
  } else {
@@ -58,10 +55,8 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
58
55
  key: "apply",
59
56
  value: function apply(layer, _ref) {
60
57
  var _this2 = this;
61
- var rendererService = _ref.rendererService,
62
- styleAttributeService = _ref.styleAttributeService;
63
- var uniformBuffer;
64
- this.pickingUniformMap = new Map([['u_HighlightColor', [1, 0, 0, 1]], ['u_SelectColor', [1, 0, 0, 1]], ['u_PickingColor', [0, 0, 0]], ['u_PickingStage', 0], ['u_CurrentSelectedId', [0, 0, 0]], ['u_PickingThreshold', 10], ['u_PickingBuffer', 0], ['u_shaderPick', 0], ['u_EnableSelect', 0], ['u_activeMix', 0]]);
58
+ var styleAttributeService = _ref.styleAttributeService;
59
+ this.pickingUniformMap = new Map([['u_HighlightColor', [1, 0, 0, 1]], ['u_SelectColor', [1, 0, 0, 1]], ['u_PickingColor', [0, 0, 0]], ['u_PickingStage', 0], ['u_CurrentSelectedId', [0, 0, 0]], ['u_PickingThreshold', 10], ['u_PickingBuffer', 0], ['u_shaderPick', 0], ['u_activeMix', 0]]);
65
60
 
66
61
  // TODO: 由于 Shader 目前无法根据是否开启拾取进行内容修改,因此即使不开启也需要生成 a_PickingColor
67
62
  layer.hooks.init.tapPromise('PixelPickingPlugin', function () {
@@ -158,8 +153,7 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
158
153
  u_CurrentSelectedId: pickedColor,
159
154
  u_SelectColor: highlightColorInArray.map(function (c) {
160
155
  return c * 255;
161
- }),
162
- u_EnableSelect: 1
156
+ })
163
157
  };
164
158
  _this2.updatePickOption(option, layer);
165
159
  layer.models.forEach(function (model) {
@@ -169,5 +163,5 @@ var PixelPickingPlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/functi
169
163
  }
170
164
  }]);
171
165
  return PixelPickingPlugin;
172
- }()) || _class);
166
+ }();
173
167
  export { PixelPickingPlugin as default };
@@ -1,12 +1,9 @@
1
- import type { ILayer, ILayerPlugin, IStyleAttributeService } from '@antv/l7-core';
2
- import 'reflect-metadata';
1
+ import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
3
2
  /**
4
3
  * 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
5
4
  */
6
5
  export default class RegisterStyleAttributePlugin implements ILayerPlugin {
7
- apply(layer: ILayer, { styleAttributeService, }: {
8
- styleAttributeService: IStyleAttributeService;
9
- }): void;
6
+ apply(layer: ILayer, { styleAttributeService }: L7Container): void;
10
7
  private registerBuiltinAttributes;
11
8
  private registerPositionAttribute;
12
9
  private registerColorAttribute;
@@ -1,16 +1,13 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- var _dec, _class;
4
3
  import { AttributeType, gl } from '@antv/l7-core';
5
- import { injectable } from 'inversify';
6
- import 'reflect-metadata';
7
4
  import { ShaderLocation } from "../core/CommonStyleAttribute";
8
5
  import { isTileGroup } from "../tile/utils/utils";
9
6
 
10
7
  /**
11
8
  * 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
12
9
  */
13
- var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
10
+ var RegisterStyleAttributePlugin = /*#__PURE__*/function () {
14
11
  function RegisterStyleAttributePlugin() {
15
12
  _classCallCheck(this, RegisterStyleAttributePlugin);
16
13
  }
@@ -109,5 +106,5 @@ var RegisterStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE
109
106
  }
110
107
  }]);
111
108
  return RegisterStyleAttributePlugin;
112
- }()) || _class);
109
+ }();
113
110
  export { RegisterStyleAttributePlugin as default };
@@ -1,5 +1,4 @@
1
- import type { ILayer, ILayerPlugin } from '@antv/l7-core';
2
- import 'reflect-metadata';
1
+ import type { ILayer, ILayerPlugin, L7Container } from '@antv/l7-core';
3
2
  /**
4
3
  * 在渲染之前需要获取当前 Shader 所需 Uniform,例如:
5
4
  * 1. 从相机服务中获取 View & ProjectionMatrix,当前缩放等级等等
@@ -8,12 +7,12 @@ import 'reflect-metadata';
8
7
  * 3. 当前 Layer 本身的样式属性
9
8
  */
10
9
  export default class ShaderUniformPlugin implements ILayerPlugin {
11
- private readonly cameraService;
12
- private readonly coordinateSystemService;
13
- private readonly rendererService;
14
- private readonly mapService;
15
- private readonly layerService;
16
- apply(layer: ILayer): void;
10
+ private cameraService;
11
+ private coordinateSystemService;
12
+ private rendererService;
13
+ private mapService;
14
+ private layerService;
15
+ apply(layer: ILayer, { rendererService, mapService, layerService, coordinateSystemService, cameraService, }: L7Container): void;
17
16
  /**
18
17
  * 对于每个 layer 都有不同的几何中心点,因此在绘制每个 layer 的时候都需要重新设置
19
18
  * @param layer