@antv/l7-layers 2.10.2 → 2.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/es/Geometry/index.js +8 -8
  2. package/es/Geometry/models/billboard.js +9 -9
  3. package/es/Geometry/models/plane.js +10 -10
  4. package/es/Geometry/models/sprite.js +10 -10
  5. package/es/canvas/index.js +8 -8
  6. package/es/canvas/models/canvas.js +9 -9
  7. package/es/citybuliding/building.js +8 -8
  8. package/es/citybuliding/models/build.js +7 -7
  9. package/es/core/BaseLayer.js +37 -46
  10. package/es/core/BaseModel.js +8 -8
  11. package/es/core/LayerPickService.js +4 -4
  12. package/es/core/shape/Path.js +1 -1
  13. package/es/core/shape/extrude.js +1 -1
  14. package/es/core/triangulation.js +2 -2
  15. package/es/earth/index.js +8 -8
  16. package/es/earth/models/atmosphere.js +6 -6
  17. package/es/earth/models/base.js +8 -8
  18. package/es/earth/models/bloomsphere.js +6 -6
  19. package/es/earth/utils.js +1 -1
  20. package/es/heatmap/index.js +8 -8
  21. package/es/heatmap/models/grid.js +6 -6
  22. package/es/heatmap/models/grid3d.js +6 -6
  23. package/es/heatmap/models/heatmap.js +8 -8
  24. package/es/heatmap/models/hexagon.js +6 -6
  25. package/es/image/index.js +8 -8
  26. package/es/image/models/dataImage.js +6 -6
  27. package/es/image/models/image.js +6 -6
  28. package/es/image/models/tileDataImage.js +6 -6
  29. package/es/line/index.js +9 -9
  30. package/es/line/models/arc.js +8 -8
  31. package/es/line/models/arc_3d.js +8 -8
  32. package/es/line/models/earthArc_3d.js +8 -8
  33. package/es/line/models/great_circle.js +8 -8
  34. package/es/line/models/half.js +6 -6
  35. package/es/line/models/line.js +8 -8
  36. package/es/line/models/linearline.js +8 -8
  37. package/es/line/models/simpleLine.js +6 -6
  38. package/es/line/models/simpleTileLine.js +6 -6
  39. package/es/line/models/tile.js +6 -6
  40. package/es/line/models/wall.js +8 -8
  41. package/es/mask/index.js +8 -8
  42. package/es/mask/models/fill.js +6 -6
  43. package/es/plugins/DataMappingPlugin.d.ts +0 -2
  44. package/es/plugins/DataMappingPlugin.js +24 -97
  45. package/es/plugins/DataSourcePlugin.js +27 -19
  46. package/es/plugins/FeatureScalePlugin.d.ts +0 -1
  47. package/es/plugins/FeatureScalePlugin.js +7 -23
  48. package/es/plugins/LayerAnimateStylePlugin.js +3 -3
  49. package/es/plugins/LayerModelPlugin.js +4 -7
  50. package/es/plugins/LayerStylePlugin.js +2 -2
  51. package/es/plugins/LightingPlugin.js +4 -4
  52. package/es/plugins/MultiPassRendererPlugin.js +2 -2
  53. package/es/plugins/PixelPickingPlugin.js +2 -2
  54. package/es/plugins/RegisterStyleAttributePlugin.js +2 -2
  55. package/es/plugins/ShaderUniformPlugin.js +6 -6
  56. package/es/plugins/UpdateModelPlugin.js +5 -2
  57. package/es/plugins/UpdateStyleAttributePlugin.js +3 -7
  58. package/es/point/index.js +8 -8
  59. package/es/point/models/earthExtrude.js +8 -8
  60. package/es/point/models/earthFill.js +8 -8
  61. package/es/point/models/extrude.js +8 -8
  62. package/es/point/models/fill.js +9 -9
  63. package/es/point/models/fillmage.js +9 -9
  64. package/es/point/models/image.js +8 -8
  65. package/es/point/models/normal.js +7 -7
  66. package/es/point/models/radar.js +9 -9
  67. package/es/point/models/simplePoint.js +7 -7
  68. package/es/point/models/text.js +45 -29
  69. package/es/point/models/tile.js +6 -6
  70. package/es/point/models/tileText.js +9 -9
  71. package/es/point/shape/extrude.js +1 -1
  72. package/es/polygon/index.js +8 -8
  73. package/es/polygon/models/extrude.js +7 -7
  74. package/es/polygon/models/fill.js +6 -6
  75. package/es/polygon/models/ocean.js +7 -7
  76. package/es/polygon/models/tile.js +6 -6
  77. package/es/polygon/models/water.js +7 -7
  78. package/es/raster/index.js +8 -8
  79. package/es/raster/models/raster.js +6 -6
  80. package/es/raster/models/rasterRgb.js +8 -8
  81. package/es/raster/models/rasterTile.js +6 -6
  82. package/es/raster/raster.js +10 -10
  83. package/es/tile/interaction/getRasterData.js +1 -1
  84. package/es/tile/interaction/utils.js +1 -1
  85. package/es/tile/manager/base.js +5 -5
  86. package/es/tile/service/TileLayerService.js +5 -5
  87. package/es/tile/service/TilePickService.d.ts +3 -3
  88. package/es/tile/service/TilePickService.js +31 -7
  89. package/es/tile/service/TileSourceService.d.ts +7 -0
  90. package/es/tile/service/TileSourceService.js +39 -0
  91. package/es/tile/style/utils.js +1 -1
  92. package/es/tile/tileFactory/DebugTile.js +6 -6
  93. package/es/tile/tileFactory/ImageTile.js +7 -7
  94. package/es/tile/tileFactory/MaskTile.js +8 -8
  95. package/es/tile/tileFactory/RasterRGBTile.js +7 -7
  96. package/es/tile/tileFactory/RasterTile.js +7 -7
  97. package/es/tile/tileFactory/Tile.d.ts +11 -0
  98. package/es/tile/tileFactory/Tile.js +68 -5
  99. package/es/tile/tileFactory/VectorTile.d.ts +1 -1
  100. package/es/tile/tileFactory/VectorTile.js +8 -14
  101. package/es/tile/tileFactory/layers/RasterDataLayer.js +8 -8
  102. package/es/tile/tileFactory/layers/TileDebugLayer.js +8 -8
  103. package/es/tile/tileLayer/BaseLayer.js +4 -4
  104. package/es/utils/blend.js +1 -1
  105. package/es/utils/collision-index.js +4 -4
  106. package/es/utils/extrude_polyline.js +5 -5
  107. package/es/utils/grid-index.js +3 -3
  108. package/es/utils/multiPassRender.js +1 -1
  109. package/es/utils/polylineNormal.js +1 -1
  110. package/es/utils/simpleLine.js +3 -3
  111. package/es/wind/index.js +8 -8
  112. package/es/wind/models/wind.js +11 -8
  113. package/es/wind/models/windRender.js +3 -3
  114. package/lib/core/BaseLayer.js +24 -33
  115. package/lib/plugins/DataMappingPlugin.js +16 -87
  116. package/lib/plugins/DataSourcePlugin.js +24 -16
  117. package/lib/plugins/FeatureScalePlugin.js +2 -18
  118. package/lib/plugins/LayerModelPlugin.js +1 -4
  119. package/lib/plugins/UpdateModelPlugin.js +3 -0
  120. package/lib/plugins/UpdateStyleAttributePlugin.js +1 -5
  121. package/lib/point/models/text.js +36 -20
  122. package/lib/tile/service/TilePickService.js +29 -3
  123. package/lib/tile/service/TileSourceService.js +59 -0
  124. package/lib/tile/tileFactory/MaskTile.js +1 -1
  125. package/lib/tile/tileFactory/Tile.js +64 -0
  126. package/lib/tile/tileFactory/VectorTile.js +1 -7
  127. package/lib/wind/models/wind.js +3 -0
  128. package/package.json +6 -6
@@ -1,9 +1,9 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
8
 
9
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -1,10 +1,10 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
 
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -1,10 +1,10 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
 
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -75,7 +75,7 @@ var MaskTile = /*#__PURE__*/function (_Tile) {
75
75
  sourceLayer = _this$parent$getLayer.sourceLayer,
76
76
  featureId = _this$parent$getLayer.featureId;
77
77
 
78
- var features = this.sourceTile.data.layers[sourceLayer].features;
78
+ var features = this.getFeatures(sourceLayer);
79
79
  return {
80
80
  data: {
81
81
  type: 'FeatureCollection',
@@ -1,10 +1,10 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
 
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -1,10 +1,10 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
 
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -19,5 +19,16 @@ export default abstract class Tile implements ITile {
19
19
  protected addLayer(layer: ILayer): Promise<void>;
20
20
  updateVisible(value: boolean): void;
21
21
  updateOptions(key: string, value: any): void;
22
+ /**
23
+ * 一个 Tile 可能有多个 layer,但是在发生拾取、点击事件的时候只有一个生效
24
+ */
25
+ getMainLayer(): ILayer | undefined;
26
+ getFeatures(sourceLayer: string | undefined): any;
27
+ /**
28
+ * 在一个 Tile 中可能存在一个相同 ID 的 feature
29
+ * @param id
30
+ * @returns
31
+ */
32
+ getFeatureById(id: number): import("@antv/l7-core").IParseDataItem[];
22
33
  destroy(): void;
23
34
  }
@@ -1,8 +1,9 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
5
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
6
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
8
  import { createLayerContainer } from '@antv/l7-core';
8
9
 
@@ -121,6 +122,68 @@ var Tile = /*#__PURE__*/function () {
121
122
  l.updateLayerConfig(_defineProperty({}, key, value));
122
123
  });
123
124
  }
125
+ /**
126
+ * 一个 Tile 可能有多个 layer,但是在发生拾取、点击事件的时候只有一个生效
127
+ */
128
+
129
+ }, {
130
+ key: "getMainLayer",
131
+ value: function getMainLayer() {
132
+ return this.layers[0];
133
+ }
134
+ }, {
135
+ key: "getFeatures",
136
+ value: function getFeatures(sourceLayer) {
137
+ var _this$sourceTile$data, _this$sourceTile$data2;
138
+
139
+ if (!sourceLayer || !((_this$sourceTile$data = this.sourceTile.data) !== null && _this$sourceTile$data !== void 0 && _this$sourceTile$data.layers[sourceLayer])) {
140
+ return [];
141
+ }
142
+
143
+ var vectorTile = (_this$sourceTile$data2 = this.sourceTile.data) === null || _this$sourceTile$data2 === void 0 ? void 0 : _this$sourceTile$data2.layers[sourceLayer];
144
+
145
+ if (Array.isArray(vectorTile.features)) {
146
+ // 数据不需要被解析 geojson-vt 类型
147
+ return vectorTile.features;
148
+ }
149
+
150
+ var _this$sourceTile = this.sourceTile,
151
+ x = _this$sourceTile.x,
152
+ y = _this$sourceTile.y,
153
+ z = _this$sourceTile.z;
154
+ var features = [];
155
+
156
+ for (var i = 0; i < vectorTile.length; i++) {
157
+ var vectorTileFeature = vectorTile.feature(i);
158
+ var feature = vectorTileFeature.toGeoJSON(x, y, z);
159
+ features.push(_objectSpread(_objectSpread({}, feature), {}, {
160
+ properties: _objectSpread({
161
+ id: feature.id
162
+ }, feature.properties)
163
+ }));
164
+ }
165
+
166
+ return features;
167
+ }
168
+ /**
169
+ * 在一个 Tile 中可能存在一个相同 ID 的 feature
170
+ * @param id
171
+ * @returns
172
+ */
173
+
174
+ }, {
175
+ key: "getFeatureById",
176
+ value: function getFeatureById(id) {
177
+ var layer = this.getMainLayer();
178
+
179
+ if (!layer) {
180
+ return [];
181
+ }
182
+
183
+ return layer.getSource().data.dataArray.filter(function (d) {
184
+ return d._id === id;
185
+ });
186
+ }
124
187
  }, {
125
188
  key: "destroy",
126
189
  value: function destroy() {
@@ -3,7 +3,7 @@ import Tile from './Tile';
3
3
  export default class VectorTile extends Tile {
4
4
  initTileLayer(): Promise<void>;
5
5
  protected beforeInit(): void;
6
- protected getSourceOption(): false | {
6
+ protected getSourceOption(): {
7
7
  data: {
8
8
  type: string;
9
9
  features: any;
@@ -1,10 +1,10 @@
1
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
9
9
 
10
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -118,13 +118,7 @@ var VectorTile = /*#__PURE__*/function (_Tile) {
118
118
  _this$parent$getLayer3 = _this$parent$getLayer.featureId,
119
119
  featureId = _this$parent$getLayer3 === void 0 ? 'id' : _this$parent$getLayer3;
120
120
 
121
- var vectorLayer = this.sourceTile.data.layers[sourceLayer];
122
-
123
- if (!vectorLayer) {
124
- return false;
125
- }
126
-
127
- var features = vectorLayer.features;
121
+ var features = this.getFeatures(sourceLayer);
128
122
  return {
129
123
  data: {
130
124
  type: 'FeatureCollection',
@@ -1,11 +1,11 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -1,11 +1,11 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -1,7 +1,7 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import { TYPES } from '@antv/l7-core';
7
7
  import { TileLayerService } from "../service/TileLayerService";
package/es/utils/blend.js CHANGED
@@ -1,4 +1,4 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
 
3
3
  var _BlendTypes;
4
4
 
@@ -1,7 +1,7 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
5
  // @mapbox/grid-index 并没有类似 hitTest 的单纯获取碰撞检测结果的方法,query 将导致计算大量多余的包围盒结果,因此使用改良版
6
6
  import { mat4, vec4 } from 'gl-matrix';
7
7
  import GridIndex from "./grid-index";
@@ -1,8 +1,8 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
- import _createClass from "@babel/runtime/helpers/createClass";
5
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
4
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
5
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
6
6
  import { aProjectFlat } from '@antv/l7-utils';
7
7
  import { vec2 } from 'gl-matrix';
8
8
  var tmp = vec2.create(); // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -1,6 +1,6 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
4
 
5
5
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
6
 
@@ -1,4 +1,4 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
 
3
3
  /**
4
4
  * 'blurH' -> ['blurH', {}]
@@ -1,4 +1,4 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import { aProjectFlat } from '@antv/l7-utils';
3
3
  import { vec2 } from 'gl-matrix';
4
4
  export function computeMiter(tangent, miter, lineA, lineB, halfThick) {
@@ -1,6 +1,6 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
4
  import { aProjectFlat } from '@antv/l7-utils';
5
5
  import { vec2 } from 'gl-matrix';
6
6
  var lineA = vec2.create();
package/es/wind/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -1,11 +1,11 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
+ import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
8
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
9
9
  import _regeneratorRuntime from "@babel/runtime/regenerator";
10
10
 
11
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -317,6 +317,8 @@ var WindModel = /*#__PURE__*/function (_BaseModel) {
317
317
  var _ref3 = this.layer.getLayerConfig(),
318
318
  opacity = _ref3.opacity;
319
319
 
320
+ this.layerService.beforeRenderData(this.layer);
321
+ this.layer.hooks.beforeRender.call();
320
322
  this.layerService.renderMask(this.layer.masks);
321
323
  (_this$colorModel = this.colorModel) === null || _this$colorModel === void 0 ? void 0 : _this$colorModel.draw({
322
324
  uniforms: {
@@ -324,6 +326,7 @@ var WindModel = /*#__PURE__*/function (_BaseModel) {
324
326
  u_texture: this.texture
325
327
  }
326
328
  });
329
+ this.layer.hooks.afterRender.call();
327
330
  }
328
331
  }]);
329
332
 
@@ -1,6 +1,6 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
+ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/esm/createClass";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
4
  import * as glUtils from "./utils";
5
5
  import { drawFrag, drawVert, fullScreenFrag, fullScreenVert, updateFrag, updateVert } from "./windShader";
6
6
 
@@ -625,6 +625,8 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
625
625
  return this;
626
626
  }
627
627
 
628
+ this.layerService.beforeRenderData(this);
629
+
628
630
  if (this.encodeDataLength <= 0 && !this.forceRender) {
629
631
  return this;
630
632
  } // Tip: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
@@ -645,27 +647,19 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
645
647
  while (1) {
646
648
  switch (_context2.prev = _context2.next) {
647
649
  case 0:
648
- if (!(this.encodeDataLength <= 0 && !this.forceRender)) {
649
- _context2.next = 2;
650
- break;
651
- }
652
-
653
- return _context2.abrupt("return");
654
-
655
- case 2:
656
650
  if (!(this.multiPassRenderer && this.multiPassRenderer.getRenderFlag())) {
657
- _context2.next = 7;
651
+ _context2.next = 5;
658
652
  break;
659
653
  }
660
654
 
661
- _context2.next = 5;
655
+ _context2.next = 3;
662
656
  return this.multiPassRenderer.render();
663
657
 
664
- case 5:
665
- _context2.next = 8;
658
+ case 3:
659
+ _context2.next = 6;
666
660
  break;
667
661
 
668
- case 7:
662
+ case 5:
669
663
  if (this.multiPassRenderer) {
670
664
  // renderPass 触发的渲染
671
665
  this.renderModels();
@@ -673,7 +667,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
673
667
  this.renderModels();
674
668
  }
675
669
 
676
- case 8:
670
+ case 6:
677
671
  case "end":
678
672
  return _context2.stop();
679
673
  }
@@ -1067,7 +1061,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1067
1061
  } // this.layerSource.inited 为 true update 事件不会再触发
1068
1062
 
1069
1063
 
1070
- this.layerSource.on('update', function () {
1064
+ this.layerSource.on('update', function (_ref3) {
1065
+ var type = _ref3.type;
1066
+
1071
1067
  if (_this8.coordCenter === undefined) {
1072
1068
  var _this8$mapService;
1073
1069
 
@@ -1079,7 +1075,10 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1079
1075
  }
1080
1076
  }
1081
1077
 
1082
- _this8.sourceEvent();
1078
+ if (type === 'update') {
1079
+ // source 初始化不需要处理
1080
+ _this8.sourceEvent();
1081
+ }
1083
1082
  });
1084
1083
  } // layer 初始化source
1085
1084
 
@@ -1193,9 +1192,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1193
1192
  }
1194
1193
  }, {
1195
1194
  key: "pick",
1196
- value: function pick(_ref6) {
1197
- var x = _ref6.x,
1198
- y = _ref6.y;
1195
+ value: function pick(_ref7) {
1196
+ var x = _ref7.x,
1197
+ y = _ref7.y;
1199
1198
  this.interactionService.triggerHover({
1200
1199
  x: x,
1201
1200
  y: y
@@ -1228,9 +1227,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1228
1227
  return _context3.abrupt("return", new Promise(function (resolve, reject) {
1229
1228
  // filter supported worker & worker enabled layer
1230
1229
  if (workerOptions && workerOptions.modelType in _l7Utils.WorkerSourceMap && workerEnabled) {
1231
- _this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (_ref7) {
1232
- var attributes = _ref7.attributes,
1233
- elements = _ref7.elements;
1230
+ _this10.styleAttributeService.createAttributesAndIndicesAscy(_this10.encodedData, segmentNumber, workerOptions).then(function (_ref8) {
1231
+ var attributes = _ref8.attributes,
1232
+ elements = _ref8.elements;
1234
1233
  var m = createModel((0, _objectSpread2.default)({
1235
1234
  attributes: attributes,
1236
1235
  uniforms: uniforms,
@@ -1423,17 +1422,8 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1423
1422
  // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
1424
1423
  if (this.encodeDataLength <= 0 && !this.forceRender) {
1425
1424
  return this;
1426
- } // TODO 待评估
1427
- // if (this.layerModelNeedUpdate && this.layerModel) {
1428
- // this.layerModel.buildModels((models: IModel[]) => {
1429
- // this.models = models;
1430
- // this.hooks.beforeRender.call();
1431
- // this.layerModelNeedUpdate = false;
1432
- // });
1433
- // }
1434
-
1425
+ }
1435
1426
 
1436
- this.layerService.beforeRenderData(this);
1437
1427
  this.hooks.beforeRender.call();
1438
1428
  this.models.forEach(function (model) {
1439
1429
  model.draw({
@@ -1454,7 +1444,8 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1454
1444
  }));
1455
1445
  }
1456
1446
 
1457
- if (!this.inited) {
1447
+ if (!this.startInit) {
1448
+ // 开始初始化执行
1458
1449
  this.pendingStyleAttributes.push({
1459
1450
  attributeName: type,
1460
1451
  attributeField: field,