@antv/l7-layers 2.13.5 → 2.13.7

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 (125) hide show
  1. package/es/Geometry/models/billboard.js +2 -6
  2. package/es/Geometry/models/plane.js +2 -6
  3. package/es/Geometry/models/sprite.js +2 -6
  4. package/es/citybuliding/models/build.js +2 -6
  5. package/es/core/BaseLayer.d.ts +3 -1
  6. package/es/core/BaseLayer.js +37 -6
  7. package/es/earth/models/atmosphere.js +2 -6
  8. package/es/earth/models/base.js +2 -6
  9. package/es/earth/models/bloomsphere.js +2 -6
  10. package/es/heatmap/models/grid.js +2 -6
  11. package/es/heatmap/models/grid3d.js +2 -6
  12. package/es/heatmap/models/heatmap.js +2 -6
  13. package/es/heatmap/models/hexagon.js +2 -6
  14. package/es/image/models/image.js +2 -6
  15. package/es/index.d.ts +1 -1
  16. package/es/index.js +2 -2
  17. package/es/line/models/arc.js +2 -6
  18. package/es/line/models/arc_3d.js +2 -6
  19. package/es/line/models/earthArc_3d.js +2 -6
  20. package/es/line/models/great_circle.js +2 -6
  21. package/es/line/models/half.js +2 -6
  22. package/es/line/models/line.d.ts +1 -0
  23. package/es/line/models/line.js +13 -7
  24. package/es/line/models/linearline.js +2 -6
  25. package/es/line/models/simpleLine.js +2 -6
  26. package/es/line/models/wall.js +2 -6
  27. package/es/mask/models/fill.js +6 -7
  28. package/es/plugins/DataMappingPlugin.js +13 -6
  29. package/es/plugins/DataSourcePlugin.js +14 -9
  30. package/es/plugins/FeatureScalePlugin.js +13 -7
  31. package/es/plugins/LayerModelPlugin.d.ts +1 -0
  32. package/es/plugins/LayerModelPlugin.js +68 -40
  33. package/es/point/models/earthExtrude.js +2 -6
  34. package/es/point/models/earthFill.js +2 -6
  35. package/es/point/models/extrude.js +2 -6
  36. package/es/point/models/normal.js +5 -7
  37. package/es/point/models/radar.js +3 -7
  38. package/es/point/models/simplePoint.js +2 -6
  39. package/es/polygon/models/extrude.js +4 -8
  40. package/es/polygon/models/fill.js +2 -6
  41. package/es/polygon/models/ocean.js +2 -6
  42. package/es/polygon/models/water.js +2 -6
  43. package/es/raster/models/raster.js +3 -7
  44. package/es/raster/models/rasterRgb.js +5 -9
  45. package/es/raster/models/rasterTerrainRgb.js +3 -7
  46. package/es/tile/manager/base.d.ts +1 -1
  47. package/es/tile/manager/base.js +16 -4
  48. package/es/tile/service/TileLayerService.d.ts +3 -3
  49. package/es/tile/service/TileLayerService.js +16 -18
  50. package/es/tile/service/TilePickService.d.ts +2 -2
  51. package/es/tile/service/TileSourceService.js +1 -1
  52. package/es/tile/tileFactory/DebugTile.js +3 -3
  53. package/es/tile/tileFactory/ImageTile.js +1 -0
  54. package/es/tile/tileFactory/MaskTile.js +5 -1
  55. package/es/tile/tileFactory/RasterRGBTile.js +1 -0
  56. package/es/tile/tileFactory/RasterTerrainRGBTile.js +1 -0
  57. package/es/tile/tileFactory/RasterTile.js +3 -2
  58. package/es/tile/tileFactory/Tile.d.ts +1 -0
  59. package/es/tile/tileFactory/Tile.js +5 -3
  60. package/es/tile/tileFactory/VectorTile.js +4 -4
  61. package/es/tile/tileFactory/index.d.ts +4 -4
  62. package/es/tile/tileFactory/index.js +4 -4
  63. package/es/tile/tileFactory/layers/TileDebugLayer.js +3 -0
  64. package/es/tile/tileFactory/util.d.ts +1 -1
  65. package/es/tile/tileFactory/util.js +1 -1
  66. package/es/tile/tileLayer/BaseLayer.d.ts +1 -1
  67. package/es/tile/tileLayer/BaseLayer.js +6 -4
  68. package/es/wind/models/wind.js +2 -6
  69. package/lib/Geometry/models/billboard.js +2 -6
  70. package/lib/Geometry/models/plane.js +2 -6
  71. package/lib/Geometry/models/sprite.js +2 -6
  72. package/lib/citybuliding/models/build.js +2 -6
  73. package/lib/core/BaseLayer.js +36 -5
  74. package/lib/earth/models/atmosphere.js +2 -6
  75. package/lib/earth/models/base.js +2 -6
  76. package/lib/earth/models/bloomsphere.js +2 -6
  77. package/lib/heatmap/models/grid.js +2 -6
  78. package/lib/heatmap/models/grid3d.js +2 -6
  79. package/lib/heatmap/models/heatmap.js +2 -6
  80. package/lib/heatmap/models/hexagon.js +2 -6
  81. package/lib/image/models/image.js +2 -6
  82. package/lib/line/models/arc.js +2 -6
  83. package/lib/line/models/arc_3d.js +2 -6
  84. package/lib/line/models/earthArc_3d.js +2 -6
  85. package/lib/line/models/great_circle.js +2 -6
  86. package/lib/line/models/half.js +2 -6
  87. package/lib/line/models/line.js +12 -7
  88. package/lib/line/models/linearline.js +2 -6
  89. package/lib/line/models/simpleLine.js +2 -6
  90. package/lib/line/models/wall.js +2 -6
  91. package/lib/mask/models/fill.js +6 -7
  92. package/lib/plugins/DataMappingPlugin.js +12 -5
  93. package/lib/plugins/DataSourcePlugin.js +13 -8
  94. package/lib/plugins/FeatureScalePlugin.js +12 -6
  95. package/lib/plugins/LayerModelPlugin.js +69 -40
  96. package/lib/point/models/earthExtrude.js +2 -6
  97. package/lib/point/models/earthFill.js +2 -6
  98. package/lib/point/models/extrude.js +2 -6
  99. package/lib/point/models/normal.js +5 -7
  100. package/lib/point/models/radar.js +4 -8
  101. package/lib/point/models/simplePoint.js +2 -6
  102. package/lib/polygon/models/extrude.js +4 -8
  103. package/lib/polygon/models/fill.js +2 -6
  104. package/lib/polygon/models/ocean.js +2 -6
  105. package/lib/polygon/models/water.js +2 -6
  106. package/lib/raster/models/raster.js +2 -6
  107. package/lib/raster/models/rasterRgb.js +5 -9
  108. package/lib/raster/models/rasterTerrainRgb.js +2 -6
  109. package/lib/tile/manager/base.js +16 -4
  110. package/lib/tile/service/TileLayerService.js +16 -18
  111. package/lib/tile/service/TileSourceService.js +1 -1
  112. package/lib/tile/tileFactory/DebugTile.js +3 -3
  113. package/lib/tile/tileFactory/ImageTile.js +1 -0
  114. package/lib/tile/tileFactory/MaskTile.js +5 -1
  115. package/lib/tile/tileFactory/RasterRGBTile.js +1 -0
  116. package/lib/tile/tileFactory/RasterTerrainRGBTile.js +1 -0
  117. package/lib/tile/tileFactory/RasterTile.js +4 -3
  118. package/lib/tile/tileFactory/Tile.js +5 -3
  119. package/lib/tile/tileFactory/VectorTile.js +5 -5
  120. package/lib/tile/tileFactory/index.js +5 -5
  121. package/lib/tile/tileFactory/layers/TileDebugLayer.js +3 -0
  122. package/lib/tile/tileFactory/util.js +2 -2
  123. package/lib/tile/tileLayer/BaseLayer.js +7 -5
  124. package/lib/wind/models/wind.js +2 -6
  125. package/package.json +7 -6
@@ -276,6 +276,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
276
276
  this.fontService = this.container.get(_l7Core.TYPES.IFontService);
277
277
  this.rendererService = this.container.get(_l7Core.TYPES.IRendererService);
278
278
  this.layerService = this.container.get(_l7Core.TYPES.ILayerService);
279
+ this.debugService = this.container.get(_l7Core.TYPES.IDebugService);
279
280
  this.interactionService = this.container.get(_l7Core.TYPES.IInteractionService);
280
281
  this.pickingService = this.container.get(_l7Core.TYPES.IPickingService);
281
282
  this.mapService = this.container.get(_l7Core.TYPES.IMapService);
@@ -345,12 +346,14 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
345
346
 
346
347
  this.layerPickService = new _LayerPickService.default(this); // 颜色纹理服务
347
348
 
348
- this.textureService = new _TextureService.default(this); // 触发 init 生命周期插件
349
+ this.textureService = new _TextureService.default(this);
350
+ this.log(_l7Core.IDebugLog.LayerInitStart); // 触发 init 生命周期插件
349
351
 
350
- _context.next = 29;
352
+ _context.next = 31;
351
353
  return this.hooks.init.promise();
352
354
 
353
- case 29:
355
+ case 31:
356
+ this.log(_l7Core.IDebugLog.LayerInitEnd);
354
357
  this.inited = true; // 触发初始化完成事件;
355
358
 
356
359
  this.emit('inited', {
@@ -363,7 +366,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
363
366
  });
364
367
  this.hooks.afterInit.call();
365
368
 
366
- case 33:
369
+ case 36:
367
370
  case "end":
368
371
  return _context.stop();
369
372
  }
@@ -377,6 +380,23 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
377
380
 
378
381
  return init;
379
382
  }()
383
+ }, {
384
+ key: "log",
385
+ value: function log(logType) {
386
+ var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'init';
387
+
388
+ // @ts-ignore 瓦片、瓦片图层目前不参与日志
389
+ if (this.tileLayer || this.isTileLayer) {
390
+ return;
391
+ }
392
+
393
+ var key = "".concat(this.id, ".").concat(step, ".").concat(logType);
394
+ var values = {
395
+ id: this.id,
396
+ type: this.type
397
+ };
398
+ this.debugService.log(key, values);
399
+ }
380
400
  }, {
381
401
  key: "updateModelData",
382
402
  value: function updateModelData(data) {
@@ -536,10 +556,15 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
536
556
  value: function setData(data, options) {
537
557
  var _this4 = this;
538
558
 
559
+ this.log(_l7Core.IDebugLog.SourceInitStart, _l7Core.ILayerStage.UPDATE);
560
+
539
561
  if (this.inited) {
540
562
  this.layerSource.setData(data, options);
563
+ this.log(_l7Core.IDebugLog.SourceInitEnd, _l7Core.ILayerStage.UPDATE);
541
564
  } else {
542
565
  this.on('inited', function () {
566
+ _this4.log(_l7Core.IDebugLog.SourceInitStart, _l7Core.ILayerStage.UPDATE);
567
+
543
568
  var currentSource = _this4.getSource();
544
569
 
545
570
  if (!currentSource) {
@@ -548,6 +573,10 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
548
573
  } else {
549
574
  _this4.layerSource.setData(data, options);
550
575
  }
576
+
577
+ _this4.layerSource.once('update', function () {
578
+ _this4.log(_l7Core.IDebugLog.SourceInitEnd, _l7Core.ILayerStage.UPDATE);
579
+ });
551
580
  });
552
581
  }
553
582
 
@@ -1009,7 +1038,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1009
1038
 
1010
1039
  (_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels(refresh);
1011
1040
  (_this$tileLayer = this.tileLayer) === null || _this$tileLayer === void 0 ? void 0 : _this$tileLayer.destroy();
1012
- this.models = [];
1041
+ this.models = []; // 清除图层日志(如果有的话:非瓦片相关)
1042
+
1043
+ this.debugService.removeLog(this.id);
1013
1044
  this.emit('remove', {
1014
1045
  target: this,
1015
1046
  type: 'remove'
@@ -68,13 +68,9 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
68
68
  while (1) {
69
69
  switch (_context.prev = _context.next) {
70
70
  case 0:
71
- _context.next = 2;
72
- return this.buildModels();
71
+ return _context.abrupt("return", this.buildModels());
73
72
 
74
- case 2:
75
- return _context.abrupt("return", _context.sent);
76
-
77
- case 3:
73
+ case 1:
78
74
  case "end":
79
75
  return _context.stop();
80
76
  }
@@ -136,13 +136,9 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
136
136
 
137
137
  _this2.layerService.reRender();
138
138
  });
139
- _context.next = 8;
140
- return this.buildModels();
139
+ return _context.abrupt("return", this.buildModels());
141
140
 
142
- case 8:
143
- return _context.abrupt("return", _context.sent);
144
-
145
- case 9:
141
+ case 7:
146
142
  case "end":
147
143
  return _context.stop();
148
144
  }
@@ -68,13 +68,9 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
68
68
  while (1) {
69
69
  switch (_context.prev = _context.next) {
70
70
  case 0:
71
- _context.next = 2;
72
- return this.buildModels();
71
+ return _context.abrupt("return", this.buildModels());
73
72
 
74
- case 2:
75
- return _context.abrupt("return", _context.sent);
76
-
77
- case 3:
73
+ case 1:
78
74
  case "end":
79
75
  return _context.stop();
80
76
  }
@@ -72,13 +72,9 @@ var GridModel = /*#__PURE__*/function (_BaseModel) {
72
72
  while (1) {
73
73
  switch (_context.prev = _context.next) {
74
74
  case 0:
75
- _context.next = 2;
76
- return this.buildModels();
75
+ return _context.abrupt("return", this.buildModels());
77
76
 
78
- case 2:
79
- return _context.abrupt("return", _context.sent);
80
-
81
- case 3:
77
+ case 1:
82
78
  case "end":
83
79
  return _context.stop();
84
80
  }
@@ -72,13 +72,9 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
72
72
  while (1) {
73
73
  switch (_context.prev = _context.next) {
74
74
  case 0:
75
- _context.next = 2;
76
- return this.buildModels();
75
+ return _context.abrupt("return", this.buildModels());
77
76
 
78
- case 2:
79
- return _context.abrupt("return", _context.sent);
80
-
81
- case 3:
77
+ case 1:
82
78
  case "end":
83
79
  return _context.stop();
84
80
  }
@@ -168,13 +168,9 @@ var HeatMapModel = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE
168
168
  while (1) {
169
169
  switch (_context2.prev = _context2.next) {
170
170
  case 0:
171
- _context2.next = 2;
172
- return this.initModels();
171
+ return _context2.abrupt("return", this.initModels());
173
172
 
174
- case 2:
175
- return _context2.abrupt("return", _context2.sent);
176
-
177
- case 3:
173
+ case 1:
178
174
  case "end":
179
175
  return _context2.stop();
180
176
  }
@@ -72,13 +72,9 @@ var HexagonModel = /*#__PURE__*/function (_BaseModel) {
72
72
  while (1) {
73
73
  switch (_context.prev = _context.next) {
74
74
  case 0:
75
- _context.next = 2;
76
- return this.buildModels();
75
+ return _context.abrupt("return", this.buildModels());
77
76
 
78
- case 2:
79
- return _context.abrupt("return", _context.sent);
80
-
81
- case 3:
77
+ case 1:
82
78
  case "end":
83
79
  return _context.stop();
84
80
  }
@@ -169,13 +169,9 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
169
169
  while (1) {
170
170
  switch (_context2.prev = _context2.next) {
171
171
  case 0:
172
- _context2.next = 2;
173
- return this.initModels();
172
+ return _context2.abrupt("return", this.initModels());
174
173
 
175
- case 2:
176
- return _context2.abrupt("return", _context2.sent);
177
-
178
- case 3:
174
+ case 1:
179
175
  case "end":
180
176
  return _context2.stop();
181
177
  }
@@ -228,13 +228,9 @@ var ArcModel = /*#__PURE__*/function (_BaseModel) {
228
228
  case 0:
229
229
  this.updateTexture();
230
230
  this.iconService.on('imageUpdate', this.updateTexture);
231
- _context.next = 4;
232
- return this.buildModels();
231
+ return _context.abrupt("return", this.buildModels());
233
232
 
234
- case 4:
235
- return _context.abrupt("return", _context.sent);
236
-
237
- case 5:
233
+ case 3:
238
234
  case "end":
239
235
  return _context.stop();
240
236
  }
@@ -220,13 +220,9 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
220
220
  case 0:
221
221
  this.updateTexture();
222
222
  this.iconService.on('imageUpdate', this.updateTexture);
223
- _context.next = 4;
224
- return this.buildModels();
223
+ return _context.abrupt("return", this.buildModels());
225
224
 
226
- case 4:
227
- return _context.abrupt("return", _context.sent);
228
-
229
- case 5:
225
+ case 3:
230
226
  case "end":
231
227
  return _context.stop();
232
228
  }
@@ -220,13 +220,9 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
220
220
  case 0:
221
221
  this.updateTexture();
222
222
  this.iconService.on('imageUpdate', this.updateTexture);
223
- _context.next = 4;
224
- return this.buildModels();
223
+ return _context.abrupt("return", this.buildModels());
225
224
 
226
- case 4:
227
- return _context.abrupt("return", _context.sent);
228
-
229
- case 5:
225
+ case 3:
230
226
  case "end":
231
227
  return _context.stop();
232
228
  }
@@ -205,13 +205,9 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
205
205
  case 0:
206
206
  this.updateTexture();
207
207
  this.iconService.on('imageUpdate', this.updateTexture);
208
- _context.next = 4;
209
- return this.buildModels();
208
+ return _context.abrupt("return", this.buildModels());
210
209
 
211
- case 4:
212
- return _context.abrupt("return", _context.sent);
213
-
214
- case 5:
210
+ case 3:
215
211
  case "end":
216
212
  return _context.stop();
217
213
  }
@@ -135,13 +135,9 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
135
135
  while (1) {
136
136
  switch (_context.prev = _context.next) {
137
137
  case 0:
138
- _context.next = 2;
139
- return this.buildModels();
138
+ return _context.abrupt("return", this.buildModels());
140
139
 
141
- case 2:
142
- return _context.abrupt("return", _context.sent);
143
-
144
- case 3:
140
+ case 1:
145
141
  case "end":
146
142
  return _context.stop();
147
143
  }
@@ -75,6 +75,7 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
75
75
  }
76
76
 
77
77
  _this = _super.call.apply(_super, [this].concat(args));
78
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "textureEventFlag", false);
78
79
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "texture", _this.createTexture2D({
79
80
  data: [0, 0, 0, 0],
80
81
  mag: _l7Core.gl.NEAREST,
@@ -152,8 +153,8 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
152
153
  dashArray.push(0, 0);
153
154
  }
154
155
 
155
- if (this.rendererService.getDirty()) {
156
- this.texture && this.texture.bind();
156
+ if (this.rendererService.getDirty() && this.texture) {
157
+ this.texture.bind();
157
158
  } // 转化渐变色
158
159
 
159
160
 
@@ -255,13 +256,17 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
255
256
  while (1) {
256
257
  switch (_context.prev = _context.next) {
257
258
  case 0:
258
- _context.next = 2;
259
- return this.buildModels();
259
+ // this.updateTexture();
260
+ // this.iconService.on('imageUpdate', this.updateTexture);
261
+ if (!this.textureEventFlag) {
262
+ this.textureEventFlag = true;
263
+ this.updateTexture();
264
+ this.iconService.on('imageUpdate', this.updateTexture);
265
+ }
260
266
 
261
- case 2:
262
- return _context.abrupt("return", _context.sent);
267
+ return _context.abrupt("return", this.buildModels());
263
268
 
264
- case 3:
269
+ case 2:
265
270
  case "end":
266
271
  return _context.stop();
267
272
  }
@@ -163,13 +163,9 @@ var LinearLineModel = /*#__PURE__*/function (_BaseModel) {
163
163
  switch (_context.prev = _context.next) {
164
164
  case 0:
165
165
  this.updateTexture();
166
- _context.next = 3;
167
- return this.buildModels();
166
+ return _context.abrupt("return", this.buildModels());
168
167
 
169
- case 3:
170
- return _context.abrupt("return", _context.sent);
171
-
172
- case 4:
168
+ case 2:
173
169
  case "end":
174
170
  return _context.stop();
175
171
  }
@@ -130,13 +130,9 @@ var SimpleLineModel = /*#__PURE__*/function (_BaseModel) {
130
130
  while (1) {
131
131
  switch (_context.prev = _context.next) {
132
132
  case 0:
133
- _context.next = 2;
134
- return this.buildModels();
133
+ return _context.abrupt("return", this.buildModels());
135
134
 
136
- case 2:
137
- return _context.abrupt("return", _context.sent);
138
-
139
- case 3:
135
+ case 1:
140
136
  case "end":
141
137
  return _context.stop();
142
138
  }
@@ -159,13 +159,9 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
159
159
  case 0:
160
160
  this.updateTexture();
161
161
  this.iconService.on('imageUpdate', this.updateTexture);
162
- _context.next = 4;
163
- return this.buildModels();
162
+ return _context.abrupt("return", this.buildModels());
164
163
 
165
- case 4:
166
- return _context.abrupt("return", _context.sent);
167
-
168
- case 5:
164
+ case 3:
169
165
  case "end":
170
166
  return _context.stop();
171
167
  }
@@ -73,13 +73,9 @@ var MaskModel = /*#__PURE__*/function (_BaseModel) {
73
73
  while (1) {
74
74
  switch (_context.prev = _context.next) {
75
75
  case 0:
76
- _context.next = 2;
77
- return this.buildModels();
76
+ return _context.abrupt("return", this.buildModels());
78
77
 
79
- case 2:
80
- return _context.abrupt("return", _context.sent);
81
-
82
- case 3:
78
+ case 1:
83
79
  case "end":
84
80
  return _context.stop();
85
81
  }
@@ -151,7 +147,10 @@ var MaskModel = /*#__PURE__*/function (_BaseModel) {
151
147
  key: "clearModels",
152
148
  value: function clearModels() {
153
149
  var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
154
- refresh && this.layerService.clear();
150
+
151
+ if (refresh) {
152
+ this.layerService.clear();
153
+ }
155
154
  }
156
155
  }, {
157
156
  key: "registerBuiltinAttributes",
@@ -57,12 +57,15 @@ var DataMappingPlugin = (_dec = (0, _inversify.injectable)(), _dec2 = (0, _inver
57
57
  while (1) {
58
58
  switch (_context.prev = _context.next) {
59
59
  case 0:
60
- // 初始化重新生成 map
60
+ layer.log(_l7Core.IDebugLog.MappingStart, _l7Core.ILayerStage.INIT); // 初始化重新生成 map
61
+
61
62
  _this.generateMaping(layer, {
62
63
  styleAttributeService: styleAttributeService
63
64
  });
64
65
 
65
- case 1:
66
+ layer.log(_l7Core.IDebugLog.MappingEnd, _l7Core.ILayerStage.INIT);
67
+
68
+ case 3:
66
69
  case "end":
67
70
  return _context.stop();
68
71
  }
@@ -71,6 +74,7 @@ var DataMappingPlugin = (_dec = (0, _inversify.injectable)(), _dec2 = (0, _inver
71
74
  })));
72
75
  layer.hooks.beforeRenderData.tapPromise('DataMappingPlugin', /*#__PURE__*/function () {
73
76
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(flag) {
77
+ var mappingResult;
74
78
  return _regenerator.default.wrap(function _callee2$(_context2) {
75
79
  while (1) {
76
80
  switch (_context2.prev = _context2.next) {
@@ -84,11 +88,14 @@ var DataMappingPlugin = (_dec = (0, _inversify.injectable)(), _dec2 = (0, _inver
84
88
 
85
89
  case 2:
86
90
  layer.dataState.dataMappingNeedUpdate = false;
87
- return _context2.abrupt("return", _this.generateMaping(layer, {
91
+ layer.log(_l7Core.IDebugLog.MappingStart, _l7Core.ILayerStage.UPDATE);
92
+ mappingResult = _this.generateMaping(layer, {
88
93
  styleAttributeService: styleAttributeService
89
- }));
94
+ });
95
+ layer.log(_l7Core.IDebugLog.MappingEnd, _l7Core.ILayerStage.UPDATE);
96
+ return _context2.abrupt("return", mappingResult);
90
97
 
91
- case 4:
98
+ case 7:
92
99
  case "end":
93
100
  return _context2.stop();
94
101
  }
@@ -43,6 +43,7 @@ var DataSourcePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__
43
43
  while (1) {
44
44
  switch (_context.prev = _context.next) {
45
45
  case 0:
46
+ layer.log(_l7Core.IDebugLog.SourceInitStart, _l7Core.ILayerStage.INIT);
46
47
  source = layer.getSource();
47
48
 
48
49
  if (!source) {
@@ -53,28 +54,31 @@ var DataSourcePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__
53
54
  }
54
55
 
55
56
  if (!source.inited) {
56
- _context.next = 6;
57
+ _context.next = 8;
57
58
  break;
58
59
  }
59
60
 
60
61
  _this.updateClusterData(layer);
61
62
 
62
- _context.next = 8;
63
+ layer.log(_l7Core.IDebugLog.SourceInitEnd, _l7Core.ILayerStage.INIT);
64
+ _context.next = 10;
63
65
  break;
64
66
 
65
- case 6:
66
- _context.next = 8;
67
+ case 8:
68
+ _context.next = 10;
67
69
  return new Promise(function (resolve) {
68
70
  source.on('update', function (e) {
69
71
  if (e.type === 'inited') {
70
72
  _this.updateClusterData(layer);
73
+
74
+ layer.log(_l7Core.IDebugLog.SourceInitEnd, _l7Core.ILayerStage.INIT);
71
75
  }
72
76
 
73
77
  resolve(null);
74
78
  });
75
79
  });
76
80
 
77
- case 8:
81
+ case 10:
78
82
  case "end":
79
83
  return _context.stop();
80
84
  }
@@ -83,7 +87,7 @@ var DataSourcePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__
83
87
  }))); // 检测数据是否需要更新
84
88
 
85
89
  layer.hooks.beforeRenderData.tapPromise('DataSourcePlugin', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
86
- var neeUpdateCluster, dataSourceNeedUpdate;
90
+ var neeUpdateCluster, dataSourceNeedUpdate, needScale;
87
91
  return _regenerator.default.wrap(function _callee2$(_context2) {
88
92
  while (1) {
89
93
  switch (_context2.prev = _context2.next) {
@@ -91,9 +95,10 @@ var DataSourcePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__
91
95
  neeUpdateCluster = _this.updateClusterData(layer);
92
96
  dataSourceNeedUpdate = layer.dataState.dataSourceNeedUpdate;
93
97
  layer.dataState.dataSourceNeedUpdate = false;
94
- return _context2.abrupt("return", neeUpdateCluster || dataSourceNeedUpdate);
98
+ needScale = neeUpdateCluster || dataSourceNeedUpdate;
99
+ return _context2.abrupt("return", needScale);
95
100
 
96
- case 4:
101
+ case 5:
97
102
  case "end":
98
103
  return _context2.stop();
99
104
  }
@@ -69,21 +69,25 @@ var FeatureScalePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#
69
69
  while (1) {
70
70
  switch (_context.prev = _context.next) {
71
71
  case 0:
72
+ layer.log(_l7Core.IDebugLog.ScaleInitStart, _l7Core.ILayerStage.INIT);
72
73
  _this.scaleOptions = layer.getScaleOptions();
73
74
  attributes = styleAttributeService.getLayerStyleAttributes();
74
75
  dataArray = (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 ? void 0 : _layer$getSource.data.dataArray;
75
76
 
76
77
  if (!(Array.isArray(dataArray) && dataArray.length === 0)) {
77
- _context.next = 7;
78
+ _context.next = 8;
78
79
  break;
79
80
  }
80
81
 
81
82
  return _context.abrupt("return");
82
83
 
83
- case 7:
84
+ case 8:
84
85
  _this.caculateScalesForAttributes(attributes || [], dataArray);
85
86
 
86
- case 8:
87
+ case 9:
88
+ layer.log(_l7Core.IDebugLog.ScaleInitEnd, _l7Core.ILayerStage.INIT);
89
+
90
+ case 10:
87
91
  case "end":
88
92
  return _context.stop();
89
93
  }
@@ -106,24 +110,26 @@ var FeatureScalePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#
106
110
  return _context2.abrupt("return", flag);
107
111
 
108
112
  case 2:
113
+ layer.log(_l7Core.IDebugLog.ScaleInitStart, _l7Core.ILayerStage.UPDATE);
109
114
  _this.scaleOptions = layer.getScaleOptions();
110
115
  attributes = styleAttributeService.getLayerStyleAttributes();
111
116
  dataArray = layer.getSource().data.dataArray;
112
117
 
113
118
  if (!(Array.isArray(dataArray) && dataArray.length === 0)) {
114
- _context2.next = 7;
119
+ _context2.next = 8;
115
120
  break;
116
121
  }
117
122
 
118
123
  return _context2.abrupt("return", true);
119
124
 
120
- case 7:
125
+ case 8:
121
126
  _this.caculateScalesForAttributes(attributes || [], dataArray);
122
127
 
128
+ layer.log(_l7Core.IDebugLog.ScaleInitEnd, _l7Core.ILayerStage.UPDATE);
123
129
  layer.layerModelNeedUpdate = true;
124
130
  return _context2.abrupt("return", true);
125
131
 
126
- case 10:
132
+ case 12:
127
133
  case "end":
128
134
  return _context2.stop();
129
135
  }