@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
@@ -161,13 +161,9 @@ var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
161
161
  while (1) {
162
162
  switch (_context2.prev = _context2.next) {
163
163
  case 0:
164
- _context2.next = 2;
165
- return this.initModels();
164
+ return _context2.abrupt("return", this.initModels());
166
165
 
167
- case 2:
168
- return _context2.abrupt("return", _context2.sent);
169
-
170
- case 3:
166
+ case 1:
171
167
  case "end":
172
168
  return _context2.stop();
173
169
  }
@@ -238,13 +238,9 @@ var PlaneModel = /*#__PURE__*/function (_BaseModel) {
238
238
  while (1) {
239
239
  switch (_context2.prev = _context2.next) {
240
240
  case 0:
241
- _context2.next = 2;
242
- return this.initModels();
241
+ return _context2.abrupt("return", this.initModels());
243
242
 
244
- case 2:
245
- return _context2.abrupt("return", _context2.sent);
246
-
247
- case 3:
243
+ case 1:
248
244
  case "end":
249
245
  return _context2.stop();
250
246
  }
@@ -262,13 +262,9 @@ var SpriteModel = /*#__PURE__*/function (_BaseModel) {
262
262
  while (1) {
263
263
  switch (_context2.prev = _context2.next) {
264
264
  case 0:
265
- _context2.next = 2;
266
- return this.initModels();
265
+ return _context2.abrupt("return", this.initModels());
267
266
 
268
- case 2:
269
- return _context2.abrupt("return", _context2.sent);
270
-
271
- case 3:
267
+ case 1:
272
268
  case "end":
273
269
  return _context2.stop();
274
270
  }
@@ -104,13 +104,9 @@ var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
104
104
  case 0:
105
105
  this.calCityGeo();
106
106
  this.startModelAnimate();
107
- _context.next = 4;
108
- return this.buildModels();
107
+ return _context.abrupt("return", this.buildModels());
109
108
 
110
- case 4:
111
- return _context.abrupt("return", _context.sent);
112
-
113
- case 5:
109
+ case 3:
114
110
  case "end":
115
111
  return _context.stop();
116
112
  }
@@ -1,5 +1,5 @@
1
1
  import { AsyncSeriesBailHook, AsyncWaterfallHook, SyncBailHook, SyncHook } from '@antv/async-hook';
2
- import { BlendType, IActiveOption, IAnimateOption, IAttributeAndElements, ICameraService, ICoordinateSystemService, IDataState, IEncodeFeature, IFontService, IGlobalConfigService, IIconService, IInteractionService, ILayer, ILayerAttributesOption, ILayerConfig, ILayerModel, ILayerModelInitializationOptions, ILayerPickService, ILayerPlugin, ILayerService, ILegend, IMapService, IModel, IModelInitializationOptions, IMultiPassRenderer, IParseDataItem, IPass, IPickingService, IPostProcessingPass, IRendererService, IScale, IScaleOptions, IShaderModuleService, ISourceCFG, IStyleAttributeService, IStyleAttributeUpdateOptions, ITextureService, LayerEventType, LegendItems, StyleAttributeField, StyleAttributeOption, Triangulation } from '@antv/l7-core';
2
+ import { BlendType, IActiveOption, IAnimateOption, IAttributeAndElements, ICameraService, ICoordinateSystemService, IDataState, IDebugService, IEncodeFeature, IFontService, IGlobalConfigService, IIconService, IInteractionService, ILayer, ILayerAttributesOption, ILayerConfig, ILayerModel, ILayerModelInitializationOptions, ILayerPickService, ILayerPlugin, ILayerService, ILegend, IMapService, IModel, IModelInitializationOptions, IMultiPassRenderer, IParseDataItem, IPass, IPickingService, IPostProcessingPass, IRendererService, IScale, IScaleOptions, IShaderModuleService, ISourceCFG, IStyleAttributeService, IStyleAttributeUpdateOptions, ITextureService, LayerEventType, LegendItems, StyleAttributeField, StyleAttributeOption, Triangulation } from '@antv/l7-core';
3
3
  import Source from '@antv/l7-source';
4
4
  import { EventEmitter } from 'eventemitter3';
5
5
  import { Container } from 'inversify';
@@ -71,6 +71,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
71
71
  protected pickingService: IPickingService;
72
72
  protected rendererService: IRendererService;
73
73
  protected layerService: ILayerService;
74
+ protected debugService: IDebugService;
74
75
  protected interactionService: IInteractionService;
75
76
  protected mapService: IMapService;
76
77
  styleAttributeService: IStyleAttributeService;
@@ -116,6 +117,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
116
117
  getContainer(): Container;
117
118
  addPlugin(plugin: ILayerPlugin): ILayer;
118
119
  init(): Promise<void>;
120
+ log(logType: string, step?: string): void;
119
121
  updateModelData(data: IAttributeAndElements): void;
120
122
  createModelData(data: any, option?: ISourceCFG): any;
121
123
  setLayerPickService(layerPickService: ILayerPickService): void;
@@ -30,7 +30,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
30
30
 
31
31
  // @ts-ignore
32
32
  import { AsyncSeriesBailHook, AsyncWaterfallHook, SyncBailHook, SyncHook } from '@antv/async-hook';
33
- import { BlendType, lazyInject, TYPES } from '@antv/l7-core';
33
+ import { BlendType, IDebugLog, ILayerStage, lazyInject, TYPES } from '@antv/l7-core';
34
34
  import Source from '@antv/l7-source';
35
35
  import { encodePickingColor, WorkerSourceMap } from '@antv/l7-utils';
36
36
  import { EventEmitter } from 'eventemitter3';
@@ -274,6 +274,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
274
274
  this.fontService = this.container.get(TYPES.IFontService);
275
275
  this.rendererService = this.container.get(TYPES.IRendererService);
276
276
  this.layerService = this.container.get(TYPES.ILayerService);
277
+ this.debugService = this.container.get(TYPES.IDebugService);
277
278
  this.interactionService = this.container.get(TYPES.IInteractionService);
278
279
  this.pickingService = this.container.get(TYPES.IPickingService);
279
280
  this.mapService = this.container.get(TYPES.IMapService);
@@ -343,12 +344,14 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
343
344
 
344
345
  this.layerPickService = new LayerPickService(this); // 颜色纹理服务
345
346
 
346
- this.textureService = new TextureService(this); // 触发 init 生命周期插件
347
+ this.textureService = new TextureService(this);
348
+ this.log(IDebugLog.LayerInitStart); // 触发 init 生命周期插件
347
349
 
348
- _context.next = 29;
350
+ _context.next = 31;
349
351
  return this.hooks.init.promise();
350
352
 
351
- case 29:
353
+ case 31:
354
+ this.log(IDebugLog.LayerInitEnd);
352
355
  this.inited = true; // 触发初始化完成事件;
353
356
 
354
357
  this.emit('inited', {
@@ -361,7 +364,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
361
364
  });
362
365
  this.hooks.afterInit.call();
363
366
 
364
- case 33:
367
+ case 36:
365
368
  case "end":
366
369
  return _context.stop();
367
370
  }
@@ -375,6 +378,23 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
375
378
 
376
379
  return init;
377
380
  }()
381
+ }, {
382
+ key: "log",
383
+ value: function log(logType) {
384
+ var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'init';
385
+
386
+ // @ts-ignore 瓦片、瓦片图层目前不参与日志
387
+ if (this.tileLayer || this.isTileLayer) {
388
+ return;
389
+ }
390
+
391
+ var key = "".concat(this.id, ".").concat(step, ".").concat(logType);
392
+ var values = {
393
+ id: this.id,
394
+ type: this.type
395
+ };
396
+ this.debugService.log(key, values);
397
+ }
378
398
  }, {
379
399
  key: "updateModelData",
380
400
  value: function updateModelData(data) {
@@ -534,10 +554,15 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
534
554
  value: function setData(data, options) {
535
555
  var _this4 = this;
536
556
 
557
+ this.log(IDebugLog.SourceInitStart, ILayerStage.UPDATE);
558
+
537
559
  if (this.inited) {
538
560
  this.layerSource.setData(data, options);
561
+ this.log(IDebugLog.SourceInitEnd, ILayerStage.UPDATE);
539
562
  } else {
540
563
  this.on('inited', function () {
564
+ _this4.log(IDebugLog.SourceInitStart, ILayerStage.UPDATE);
565
+
541
566
  var currentSource = _this4.getSource();
542
567
 
543
568
  if (!currentSource) {
@@ -546,6 +571,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
546
571
  } else {
547
572
  _this4.layerSource.setData(data, options);
548
573
  }
574
+
575
+ _this4.layerSource.once('update', function () {
576
+ _this4.log(IDebugLog.SourceInitEnd, ILayerStage.UPDATE);
577
+ });
549
578
  });
550
579
  }
551
580
 
@@ -1008,7 +1037,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
1008
1037
 
1009
1038
  (_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels(refresh);
1010
1039
  (_this$tileLayer = this.tileLayer) === null || _this$tileLayer === void 0 ? void 0 : _this$tileLayer.destroy();
1011
- this.models = [];
1040
+ this.models = []; // 清除图层日志(如果有的话:非瓦片相关)
1041
+
1042
+ this.debugService.removeLog(this.id);
1012
1043
  this.emit('remove', {
1013
1044
  target: this,
1014
1045
  type: 'remove'
@@ -51,13 +51,9 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
51
51
  while (1) {
52
52
  switch (_context.prev = _context.next) {
53
53
  case 0:
54
- _context.next = 2;
55
- return this.buildModels();
54
+ return _context.abrupt("return", this.buildModels());
56
55
 
57
- case 2:
58
- return _context.abrupt("return", _context.sent);
59
-
60
- case 3:
56
+ case 1:
61
57
  case "end":
62
58
  return _context.stop();
63
59
  }
@@ -123,13 +123,9 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
123
123
 
124
124
  _this2.layerService.reRender();
125
125
  });
126
- _context.next = 8;
127
- return this.buildModels();
126
+ return _context.abrupt("return", this.buildModels());
128
127
 
129
- case 8:
130
- return _context.abrupt("return", _context.sent);
131
-
132
- case 9:
128
+ case 7:
133
129
  case "end":
134
130
  return _context.stop();
135
131
  }
@@ -51,13 +51,9 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
51
51
  while (1) {
52
52
  switch (_context.prev = _context.next) {
53
53
  case 0:
54
- _context.next = 2;
55
- return this.buildModels();
54
+ return _context.abrupt("return", this.buildModels());
56
55
 
57
- case 2:
58
- return _context.abrupt("return", _context.sent);
59
-
60
- case 3:
56
+ case 1:
61
57
  case "end":
62
58
  return _context.stop();
63
59
  }
@@ -55,13 +55,9 @@ var GridModel = /*#__PURE__*/function (_BaseModel) {
55
55
  while (1) {
56
56
  switch (_context.prev = _context.next) {
57
57
  case 0:
58
- _context.next = 2;
59
- return this.buildModels();
58
+ return _context.abrupt("return", this.buildModels());
60
59
 
61
- case 2:
62
- return _context.abrupt("return", _context.sent);
63
-
64
- case 3:
60
+ case 1:
65
61
  case "end":
66
62
  return _context.stop();
67
63
  }
@@ -55,13 +55,9 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
55
55
  while (1) {
56
56
  switch (_context.prev = _context.next) {
57
57
  case 0:
58
- _context.next = 2;
59
- return this.buildModels();
58
+ return _context.abrupt("return", this.buildModels());
60
59
 
61
- case 2:
62
- return _context.abrupt("return", _context.sent);
63
-
64
- case 3:
60
+ case 1:
65
61
  case "end":
66
62
  return _context.stop();
67
63
  }
@@ -146,13 +146,9 @@ var HeatMapModel = (_dec = injectable(), _dec(_class = /*#__PURE__*/function (_B
146
146
  while (1) {
147
147
  switch (_context2.prev = _context2.next) {
148
148
  case 0:
149
- _context2.next = 2;
150
- return this.initModels();
149
+ return _context2.abrupt("return", this.initModels());
151
150
 
152
- case 2:
153
- return _context2.abrupt("return", _context2.sent);
154
-
155
- case 3:
151
+ case 1:
156
152
  case "end":
157
153
  return _context2.stop();
158
154
  }
@@ -55,13 +55,9 @@ var HexagonModel = /*#__PURE__*/function (_BaseModel) {
55
55
  while (1) {
56
56
  switch (_context.prev = _context.next) {
57
57
  case 0:
58
- _context.next = 2;
59
- return this.buildModels();
58
+ return _context.abrupt("return", this.buildModels());
60
59
 
61
- case 2:
62
- return _context.abrupt("return", _context.sent);
63
-
64
- case 3:
60
+ case 1:
65
61
  case "end":
66
62
  return _context.stop();
67
63
  }
@@ -152,13 +152,9 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
152
152
  while (1) {
153
153
  switch (_context2.prev = _context2.next) {
154
154
  case 0:
155
- _context2.next = 2;
156
- return this.initModels();
155
+ return _context2.abrupt("return", this.initModels());
157
156
 
158
- case 2:
159
- return _context2.abrupt("return", _context2.sent);
160
-
161
- case 3:
157
+ case 1:
162
158
  case "end":
163
159
  return _context2.stop();
164
160
  }
package/es/index.d.ts CHANGED
@@ -13,5 +13,5 @@ import TileDebugLayer from './tile/tileFactory/layers/TileDebugLayer';
13
13
  import EarthLayer from './earth';
14
14
  import MaskLayer from './mask';
15
15
  import WindLayer from './wind';
16
- export { BaseLayer, BaseModel, PointLayer, PolygonLayer, LineLayer, CityBuildingLayer, GeometryLayer, CanvasLayer, ImageLayer, RasterLayer, HeatmapLayer, EarthLayer, WindLayer, MaskLayer, TileDebugLayer, };
17
16
  export * from './core/interface';
17
+ export { BaseLayer, BaseModel, PointLayer, PolygonLayer, LineLayer, CityBuildingLayer, GeometryLayer, CanvasLayer, ImageLayer, RasterLayer, HeatmapLayer, EarthLayer, WindLayer, MaskLayer, TileDebugLayer, };
package/es/index.js CHANGED
@@ -103,5 +103,5 @@ container.bind(TYPES.ILayerPlugin).to(PixelPickingPlugin).inRequestScope();
103
103
  */
104
104
 
105
105
  container.bind(TYPES.ILayerPlugin).to(LayerModelPlugin).inRequestScope();
106
- export { BaseLayer, BaseModel, PointLayer, PolygonLayer, LineLayer, CityBuildingLayer, GeometryLayer, CanvasLayer, ImageLayer, RasterLayer, HeatmapLayer, EarthLayer, WindLayer, MaskLayer, TileDebugLayer };
107
- export * from "./core/interface";
106
+ export * from "./core/interface";
107
+ export { BaseLayer, BaseModel, PointLayer, PolygonLayer, LineLayer, CityBuildingLayer, GeometryLayer, CanvasLayer, ImageLayer, RasterLayer, HeatmapLayer, EarthLayer, WindLayer, MaskLayer, TileDebugLayer };
@@ -208,13 +208,9 @@ var ArcModel = /*#__PURE__*/function (_BaseModel) {
208
208
  case 0:
209
209
  this.updateTexture();
210
210
  this.iconService.on('imageUpdate', this.updateTexture);
211
- _context.next = 4;
212
- return this.buildModels();
211
+ return _context.abrupt("return", this.buildModels());
213
212
 
214
- case 4:
215
- return _context.abrupt("return", _context.sent);
216
-
217
- case 5:
213
+ case 3:
218
214
  case "end":
219
215
  return _context.stop();
220
216
  }
@@ -199,13 +199,9 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
199
199
  case 0:
200
200
  this.updateTexture();
201
201
  this.iconService.on('imageUpdate', this.updateTexture);
202
- _context.next = 4;
203
- return this.buildModels();
202
+ return _context.abrupt("return", this.buildModels());
204
203
 
205
- case 4:
206
- return _context.abrupt("return", _context.sent);
207
-
208
- case 5:
204
+ case 3:
209
205
  case "end":
210
206
  return _context.stop();
211
207
  }
@@ -199,13 +199,9 @@ var Arc3DModel = /*#__PURE__*/function (_BaseModel) {
199
199
  case 0:
200
200
  this.updateTexture();
201
201
  this.iconService.on('imageUpdate', this.updateTexture);
202
- _context.next = 4;
203
- return this.buildModels();
202
+ return _context.abrupt("return", this.buildModels());
204
203
 
205
- case 4:
206
- return _context.abrupt("return", _context.sent);
207
-
208
- case 5:
204
+ case 3:
209
205
  case "end":
210
206
  return _context.stop();
211
207
  }
@@ -186,13 +186,9 @@ var GreatCircleModel = /*#__PURE__*/function (_BaseModel) {
186
186
  case 0:
187
187
  this.updateTexture();
188
188
  this.iconService.on('imageUpdate', this.updateTexture);
189
- _context.next = 4;
190
- return this.buildModels();
189
+ return _context.abrupt("return", this.buildModels());
191
190
 
192
- case 4:
193
- return _context.abrupt("return", _context.sent);
194
-
195
- case 5:
191
+ case 3:
196
192
  case "end":
197
193
  return _context.stop();
198
194
  }
@@ -117,13 +117,9 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
117
117
  while (1) {
118
118
  switch (_context.prev = _context.next) {
119
119
  case 0:
120
- _context.next = 2;
121
- return this.buildModels();
120
+ return _context.abrupt("return", this.buildModels());
122
121
 
123
- case 2:
124
- return _context.abrupt("return", _context.sent);
125
-
126
- case 3:
122
+ case 1:
127
123
  case "end":
128
124
  return _context.stop();
129
125
  }
@@ -1,6 +1,7 @@
1
1
  import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class LineModel extends BaseModel {
4
+ private textureEventFlag;
4
5
  protected texture: ITexture2D;
5
6
  getUninforms(): IModelUniform;
6
7
  getAnimateUniforms(): IModelUniform;
@@ -54,6 +54,8 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
54
54
 
55
55
  _this = _super.call.apply(_super, [this].concat(args));
56
56
 
57
+ _defineProperty(_assertThisInitialized(_this), "textureEventFlag", false);
58
+
57
59
  _defineProperty(_assertThisInitialized(_this), "texture", _this.createTexture2D({
58
60
  data: [0, 0, 0, 0],
59
61
  mag: gl.NEAREST,
@@ -133,8 +135,8 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
133
135
  dashArray.push(0, 0);
134
136
  }
135
137
 
136
- if (this.rendererService.getDirty()) {
137
- this.texture && this.texture.bind();
138
+ if (this.rendererService.getDirty() && this.texture) {
139
+ this.texture.bind();
138
140
  } // 转化渐变色
139
141
 
140
142
 
@@ -236,13 +238,17 @@ var LineModel = /*#__PURE__*/function (_BaseModel) {
236
238
  while (1) {
237
239
  switch (_context.prev = _context.next) {
238
240
  case 0:
239
- _context.next = 2;
240
- return this.buildModels();
241
+ // this.updateTexture();
242
+ // this.iconService.on('imageUpdate', this.updateTexture);
243
+ if (!this.textureEventFlag) {
244
+ this.textureEventFlag = true;
245
+ this.updateTexture();
246
+ this.iconService.on('imageUpdate', this.updateTexture);
247
+ }
241
248
 
242
- case 2:
243
- return _context.abrupt("return", _context.sent);
249
+ return _context.abrupt("return", this.buildModels());
244
250
 
245
- case 3:
251
+ case 2:
246
252
  case "end":
247
253
  return _context.stop();
248
254
  }
@@ -143,13 +143,9 @@ var LinearLineModel = /*#__PURE__*/function (_BaseModel) {
143
143
  switch (_context.prev = _context.next) {
144
144
  case 0:
145
145
  this.updateTexture();
146
- _context.next = 3;
147
- return this.buildModels();
146
+ return _context.abrupt("return", this.buildModels());
148
147
 
149
- case 3:
150
- return _context.abrupt("return", _context.sent);
151
-
152
- case 4:
148
+ case 2:
153
149
  case "end":
154
150
  return _context.stop();
155
151
  }
@@ -112,13 +112,9 @@ var SimpleLineModel = /*#__PURE__*/function (_BaseModel) {
112
112
  while (1) {
113
113
  switch (_context.prev = _context.next) {
114
114
  case 0:
115
- _context.next = 2;
116
- return this.buildModels();
115
+ return _context.abrupt("return", this.buildModels());
117
116
 
118
- case 2:
119
- return _context.abrupt("return", _context.sent);
120
-
121
- case 3:
117
+ case 1:
122
118
  case "end":
123
119
  return _context.stop();
124
120
  }
@@ -140,13 +140,9 @@ var LineWallModel = /*#__PURE__*/function (_BaseModel) {
140
140
  case 0:
141
141
  this.updateTexture();
142
142
  this.iconService.on('imageUpdate', this.updateTexture);
143
- _context.next = 4;
144
- return this.buildModels();
143
+ return _context.abrupt("return", this.buildModels());
145
144
 
146
- case 4:
147
- return _context.abrupt("return", _context.sent);
148
-
149
- case 5:
145
+ case 3:
150
146
  case "end":
151
147
  return _context.stop();
152
148
  }
@@ -55,13 +55,9 @@ var MaskModel = /*#__PURE__*/function (_BaseModel) {
55
55
  while (1) {
56
56
  switch (_context.prev = _context.next) {
57
57
  case 0:
58
- _context.next = 2;
59
- return this.buildModels();
58
+ return _context.abrupt("return", this.buildModels());
60
59
 
61
- case 2:
62
- return _context.abrupt("return", _context.sent);
63
-
64
- case 3:
60
+ case 1:
65
61
  case "end":
66
62
  return _context.stop();
67
63
  }
@@ -133,7 +129,10 @@ var MaskModel = /*#__PURE__*/function (_BaseModel) {
133
129
  key: "clearModels",
134
130
  value: function clearModels() {
135
131
  var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
136
- refresh && this.layerService.clear();
132
+
133
+ if (refresh) {
134
+ this.layerService.clear();
135
+ }
137
136
  }
138
137
  }, {
139
138
  key: "registerBuiltinAttributes",
@@ -10,7 +10,7 @@ import _initializerWarningHelper from "@babel/runtime/helpers/esm/initializerWar
10
10
  var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
11
11
 
12
12
  import _regeneratorRuntime from "@babel/runtime/regenerator";
13
- import { TYPES } from '@antv/l7-core';
13
+ import { IDebugLog, ILayerStage, TYPES } from '@antv/l7-core';
14
14
  import { Version } from '@antv/l7-maps';
15
15
  import { normalize, rgb2arr } from '@antv/l7-utils';
16
16
  import { inject, injectable } from 'inversify';
@@ -36,12 +36,15 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
36
36
  while (1) {
37
37
  switch (_context.prev = _context.next) {
38
38
  case 0:
39
- // 初始化重新生成 map
39
+ layer.log(IDebugLog.MappingStart, ILayerStage.INIT); // 初始化重新生成 map
40
+
40
41
  _this.generateMaping(layer, {
41
42
  styleAttributeService: styleAttributeService
42
43
  });
43
44
 
44
- case 1:
45
+ layer.log(IDebugLog.MappingEnd, ILayerStage.INIT);
46
+
47
+ case 3:
45
48
  case "end":
46
49
  return _context.stop();
47
50
  }
@@ -50,6 +53,7 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
50
53
  })));
51
54
  layer.hooks.beforeRenderData.tapPromise('DataMappingPlugin', /*#__PURE__*/function () {
52
55
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(flag) {
56
+ var mappingResult;
53
57
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
54
58
  while (1) {
55
59
  switch (_context2.prev = _context2.next) {
@@ -63,11 +67,14 @@ var DataMappingPlugin = (_dec = injectable(), _dec2 = inject(TYPES.IMapService),
63
67
 
64
68
  case 2:
65
69
  layer.dataState.dataMappingNeedUpdate = false;
66
- return _context2.abrupt("return", _this.generateMaping(layer, {
70
+ layer.log(IDebugLog.MappingStart, ILayerStage.UPDATE);
71
+ mappingResult = _this.generateMaping(layer, {
67
72
  styleAttributeService: styleAttributeService
68
- }));
73
+ });
74
+ layer.log(IDebugLog.MappingEnd, ILayerStage.UPDATE);
75
+ return _context2.abrupt("return", mappingResult);
69
76
 
70
- case 4:
77
+ case 7:
71
78
  case "end":
72
79
  return _context2.stop();
73
80
  }