@antv/l7-layers 2.9.27-alpha.3 → 2.9.27-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/es/Geometry/models/billboard.js +2 -5
  2. package/es/Geometry/models/plane.js +3 -3
  3. package/es/Geometry/models/sprite.js +2 -3
  4. package/es/core/BaseLayer.d.ts +5 -6
  5. package/es/core/BaseLayer.js +13 -19
  6. package/es/core/BaseModel.d.ts +1 -1
  7. package/es/core/BaseModel.js +15 -16
  8. package/es/core/interface.d.ts +2 -1
  9. package/es/earth/models/atmosphere.js +4 -7
  10. package/es/earth/models/base.js +10 -14
  11. package/es/earth/models/bloomsphere.js +4 -8
  12. package/es/heatmap/index.d.ts +2 -2
  13. package/es/heatmap/index.js +1 -3
  14. package/es/heatmap/models/grid.js +1 -3
  15. package/es/heatmap/models/grid3d.js +4 -11
  16. package/es/heatmap/models/heatmap.js +3 -6
  17. package/es/heatmap/models/hexagon.js +2 -6
  18. package/es/heatmap/triangulation.js +0 -1
  19. package/es/image/index.d.ts +1 -1
  20. package/es/image/index.js +4 -1
  21. package/es/image/models/dataImage.d.ts +1 -1
  22. package/es/image/models/dataImage.js +12 -34
  23. package/es/image/models/image.js +1 -3
  24. package/es/image/models/index.d.ts +1 -1
  25. package/es/image/models/index.js +3 -1
  26. package/es/image/models/tileDataImage.d.ts +19 -0
  27. package/es/image/models/tileDataImage.js +174 -0
  28. package/es/line/models/arc.js +7 -8
  29. package/es/line/models/arc_3d.js +8 -10
  30. package/es/line/models/earthArc_3d.js +8 -10
  31. package/es/line/models/great_circle.js +7 -7
  32. package/es/line/models/line.js +4 -4
  33. package/es/line/models/linearline.js +3 -4
  34. package/es/line/models/simpleLine.js +3 -3
  35. package/es/line/models/tile.js +1 -1
  36. package/es/line/models/wall.js +3 -3
  37. package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
  38. package/es/line/shaders/line_arc2d_vert.glsl +2 -2
  39. package/es/line/shaders/line_arc_3d_frag.glsl +10 -10
  40. package/es/line/shaders/line_arc_3d_vert.glsl +3 -4
  41. package/es/line/shaders/line_arc_frag.glsl +9 -10
  42. package/es/line/shaders/line_arc_great_circle_frag.glsl +6 -6
  43. package/es/line/shaders/line_arc_great_circle_vert.glsl +2 -3
  44. package/es/line/shaders/line_arc_vert.glsl +2 -2
  45. package/es/line/shaders/line_bezier_vert.glsl +2 -2
  46. package/es/line/shaders/line_frag.glsl +5 -5
  47. package/es/line/shaders/line_vert.glsl +1 -1
  48. package/es/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
  49. package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
  50. package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
  51. package/es/line/shaders/wall/wall_frag.glsl +5 -5
  52. package/es/line/shaders/wall/wall_vert.glsl +2 -2
  53. package/es/plugins/LayerAnimateStylePlugin.js +2 -2
  54. package/es/point/index.js +3 -4
  55. package/es/point/models/earthExtrude.d.ts +1 -1
  56. package/es/point/models/earthExtrude.js +9 -14
  57. package/es/point/models/earthFill.js +2 -2
  58. package/es/point/models/extrude.d.ts +1 -1
  59. package/es/point/models/extrude.js +9 -12
  60. package/es/point/models/fill.d.ts +1 -1
  61. package/es/point/models/fill.js +7 -8
  62. package/es/point/models/fillmage.js +4 -5
  63. package/es/point/models/image.js +2 -2
  64. package/es/point/models/index.d.ts +1 -1
  65. package/es/point/models/index.js +3 -3
  66. package/es/point/models/normal.js +0 -2
  67. package/es/point/models/radar.js +1 -1
  68. package/es/point/models/text.js +1 -3
  69. package/es/point/models/tile.js +2 -3
  70. package/es/point/models/tileText.js +3 -5
  71. package/es/point/shaders/animate/wave_frag.glsl +2 -2
  72. package/es/polygon/models/extrude.js +3 -5
  73. package/es/raster/models/raster.d.ts +1 -1
  74. package/es/raster/models/raster.js +3 -3
  75. package/es/tile/manager/tileLayerManager.js +10 -0
  76. package/lib/Geometry/models/billboard.js +2 -5
  77. package/lib/Geometry/models/plane.js +3 -3
  78. package/lib/Geometry/models/sprite.js +2 -3
  79. package/lib/core/BaseLayer.js +13 -19
  80. package/lib/core/BaseModel.js +15 -16
  81. package/lib/earth/models/atmosphere.js +4 -7
  82. package/lib/earth/models/base.js +10 -14
  83. package/lib/earth/models/bloomsphere.js +4 -8
  84. package/lib/heatmap/index.js +1 -3
  85. package/lib/heatmap/models/grid.js +1 -3
  86. package/lib/heatmap/models/grid3d.js +4 -11
  87. package/lib/heatmap/models/heatmap.js +3 -6
  88. package/lib/heatmap/models/hexagon.js +2 -6
  89. package/lib/heatmap/triangulation.js +0 -1
  90. package/lib/image/index.js +4 -1
  91. package/lib/image/models/dataImage.js +11 -33
  92. package/lib/image/models/image.js +1 -3
  93. package/lib/image/models/index.js +4 -1
  94. package/lib/image/models/tileDataImage.js +188 -0
  95. package/lib/line/models/arc.js +7 -8
  96. package/lib/line/models/arc_3d.js +8 -10
  97. package/lib/line/models/earthArc_3d.js +8 -10
  98. package/lib/line/models/great_circle.js +7 -7
  99. package/lib/line/models/line.js +4 -4
  100. package/lib/line/models/linearline.js +3 -4
  101. package/lib/line/models/simpleLine.js +3 -3
  102. package/lib/line/models/tile.js +1 -1
  103. package/lib/line/models/wall.js +3 -3
  104. package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
  105. package/lib/line/shaders/line_arc2d_vert.glsl +2 -2
  106. package/lib/line/shaders/line_arc_3d_frag.glsl +10 -10
  107. package/lib/line/shaders/line_arc_3d_vert.glsl +3 -4
  108. package/lib/line/shaders/line_arc_frag.glsl +9 -10
  109. package/lib/line/shaders/line_arc_great_circle_frag.glsl +6 -6
  110. package/lib/line/shaders/line_arc_great_circle_vert.glsl +2 -3
  111. package/lib/line/shaders/line_arc_vert.glsl +2 -2
  112. package/lib/line/shaders/line_bezier_vert.glsl +2 -2
  113. package/lib/line/shaders/line_frag.glsl +5 -5
  114. package/lib/line/shaders/line_vert.glsl +1 -1
  115. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
  116. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
  117. package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
  118. package/lib/line/shaders/wall/wall_frag.glsl +5 -5
  119. package/lib/line/shaders/wall/wall_vert.glsl +2 -2
  120. package/lib/plugins/LayerAnimateStylePlugin.js +2 -2
  121. package/lib/point/index.js +3 -4
  122. package/lib/point/models/earthExtrude.js +9 -14
  123. package/lib/point/models/earthFill.js +2 -2
  124. package/lib/point/models/extrude.js +9 -12
  125. package/lib/point/models/fill.js +7 -8
  126. package/lib/point/models/fillmage.js +4 -5
  127. package/lib/point/models/image.js +2 -2
  128. package/lib/point/models/index.js +1 -1
  129. package/lib/point/models/normal.js +0 -2
  130. package/lib/point/models/radar.js +1 -1
  131. package/lib/point/models/text.js +1 -3
  132. package/lib/point/models/tile.js +2 -3
  133. package/lib/point/models/tileText.js +3 -5
  134. package/lib/point/shaders/animate/wave_frag.glsl +2 -2
  135. package/lib/polygon/models/extrude.js +3 -5
  136. package/lib/raster/models/raster.js +3 -3
  137. package/lib/tile/manager/tileLayerManager.js +10 -0
  138. package/package.json +6 -6
@@ -191,7 +191,6 @@ var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
191
191
  descriptor: {
192
192
  name: 'a_Extrude',
193
193
  buffer: {
194
- // give the WebGL driver a hint that this buffer may change
195
194
  usage: gl.DYNAMIC_DRAW,
196
195
  data: [],
197
196
  type: gl.FLOAT
@@ -203,21 +202,19 @@ var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
203
202
  return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
204
203
  }
205
204
  }
206
- }); // point layer size;
207
-
205
+ });
208
206
  this.styleAttributeService.registerStyleAttribute({
209
207
  name: 'uv',
210
208
  type: AttributeType.Attribute,
211
209
  descriptor: {
212
210
  name: 'a_Uv',
213
211
  buffer: {
214
- // give the WebGL driver a hint that this buffer may change
215
212
  usage: gl.DYNAMIC_DRAW,
216
213
  data: [],
217
214
  type: gl.FLOAT
218
215
  },
219
216
  size: 2,
220
- update: function update(feature, featureIdx, vertex, attributeIdx) {
217
+ update: function update(feature, featureIdx, vertex) {
221
218
  return [vertex[2], vertex[3]];
222
219
  }
223
220
  }
@@ -300,10 +300,10 @@ var PlaneModel = /*#__PURE__*/function (_BaseModel) {
300
300
  var gridX1 = gridX + 1;
301
301
  var gridY1 = gridY + 1;
302
302
  var widthStep = imgWidth / gridX;
303
- var heihgtStep = imgHeight / gridY;
303
+ var heightStep = imgHeight / gridY;
304
304
 
305
305
  for (var iy = 0; iy < gridY1; iy++) {
306
- var imgIndexY = Math.floor(iy * heihgtStep);
306
+ var imgIndexY = Math.floor(iy * heightStep);
307
307
  var imgLen = imgIndexY * imgWidth;
308
308
 
309
309
  for (var ix = 0; ix < gridX1; ix++) {
@@ -405,7 +405,7 @@ var PlaneModel = /*#__PURE__*/function (_BaseModel) {
405
405
  type: gl.FLOAT
406
406
  },
407
407
  size: 2,
408
- update: function update(feature, featureIdx, vertex, attributeIdx) {
408
+ update: function update(feature, featureIdx, vertex) {
409
409
  return [vertex[3], vertex[4]];
410
410
  }
411
411
  }
@@ -49,8 +49,7 @@ var SpriteModel = /*#__PURE__*/function (_BaseModel) {
49
49
  _ref$spriteBottom = _ref.spriteBottom,
50
50
  spriteBottom = _ref$spriteBottom === void 0 ? -100000 : _ref$spriteBottom;
51
51
 
52
- var updateZ = _this.spriteUpdate; // const bottomZ = -100000;
53
-
52
+ var updateZ = _this.spriteUpdate;
54
53
  var bottomZ = spriteBottom;
55
54
  var topZ = _this.spriteTop;
56
55
 
@@ -79,7 +78,7 @@ var SpriteModel = /*#__PURE__*/function (_BaseModel) {
79
78
 
80
79
  _defineProperty(_assertThisInitialized(_this), "updateModel", function () {
81
80
  // @ts-ignore
82
- var attributes = _this.layer.createAttrubutes({
81
+ var attributes = _this.layer.createAttributes({
83
82
  triangulation: _this.planeGeometryUpdateTriangulation
84
83
  });
85
84
 
@@ -1,5 +1,5 @@
1
1
  import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
2
- import { BlendType, IActiveOption, IAnimateOption, IAttrubuteAndElements, ICameraService, ICoordinateSystemService, IDataState, IEncodeFeature, IFontService, IGlobalConfigService, IIconService, IInteractionService, ILayer, ILayerConfig, ILayerModel, ILayerModelInitializationOptions, ILayerPlugin, ILayerService, IMapService, IModel, IModelInitializationOptions, IMultiPassRenderer, IPass, IPickingService, IPostProcessingPass, IRendererService, IScale, IScaleOptions, IShaderModuleService, ISourceCFG, IStyleAttributeService, IStyleAttributeUpdateOptions, LayerEventType, LegendItems, StyleAttributeField, StyleAttributeOption, Triangulation } from '@antv/l7-core';
2
+ import { BlendType, IActiveOption, IAnimateOption, IAttributeAndElements, ICameraService, ICoordinateSystemService, IDataState, IEncodeFeature, IFontService, IGlobalConfigService, IIconService, IInteractionService, ILayer, ILayerConfig, ILayerModel, ILayerModelInitializationOptions, ILayerPlugin, ILayerService, IMapService, IModel, IModelInitializationOptions, IMultiPassRenderer, IPass, IPickingService, IPostProcessingPass, IRendererService, IScale, IScaleOptions, IShaderModuleService, ISourceCFG, IStyleAttributeService, IStyleAttributeUpdateOptions, 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';
@@ -79,7 +79,6 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
79
79
  */
80
80
  protected container: Container;
81
81
  private encodedData;
82
- private configSchema;
83
82
  private currentPickId;
84
83
  protected rawConfig: Partial<ILayerConfig & ChildLayerStyleOptions>;
85
84
  private needUpdateConfig;
@@ -95,9 +94,9 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
95
94
  }>;
96
95
  private scaleOptions;
97
96
  private animateStartTime;
98
- private aniamateStatus;
97
+ private animateStatus;
99
98
  private bottomColor;
100
- private isDestroied;
99
+ private isDestroyed;
101
100
  constructor(config?: Partial<ILayerConfig & ChildLayerStyleOptions>);
102
101
  addMaskLayer(maskLayer: ILayer): void;
103
102
  removeMaskLayer(maskLayer: ILayer): void;
@@ -116,7 +115,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
116
115
  getBottomColor(): string;
117
116
  addPlugin(plugin: ILayerPlugin): ILayer;
118
117
  init(): this;
119
- updateModelData(data: IAttrubuteAndElements): void;
118
+ updateModelData(data: IAttributeAndElements): void;
120
119
  createModelData(data: any, option?: ISourceCFG): any;
121
120
  calculateEncodeData(data: any, option?: ISourceCFG): IEncodeFeature[] | null;
122
121
  /**
@@ -194,7 +193,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
194
193
  }): void;
195
194
  boxSelect(box: [number, number, number, number], cb: (...args: any[]) => void): void;
196
195
  buildLayerModel(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): Promise<IModel>;
197
- createAttrubutes(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): any;
196
+ createAttributes(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): any;
198
197
  getTime(): number;
199
198
  setAnimateStartTime(): void;
200
199
  stopAnimate(): void;
@@ -144,11 +144,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
144
144
 
145
145
  _defineProperty(_assertThisInitialized(_this), "scaleOptions", {});
146
146
 
147
- _defineProperty(_assertThisInitialized(_this), "aniamateStatus", false);
147
+ _defineProperty(_assertThisInitialized(_this), "animateStatus", false);
148
148
 
149
149
  _defineProperty(_assertThisInitialized(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
150
150
 
151
- _defineProperty(_assertThisInitialized(_this), "isDestroied", false);
151
+ _defineProperty(_assertThisInitialized(_this), "isDestroyed", false);
152
152
 
153
153
  _defineProperty(_assertThisInitialized(_this), "encodeDataLength", 0);
154
154
 
@@ -251,11 +251,6 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
251
251
  }, {
252
252
  key: "addPlugin",
253
253
  value: function addPlugin(plugin) {
254
- // TODO: 控制插件注册顺序
255
- // @example:
256
- // pointLayer.addPlugin(new MyCustomPlugin(), {
257
- // before: 'L7BuiltinPlugin'
258
- // });
259
254
  this.plugins.push(plugin);
260
255
  return this;
261
256
  }
@@ -418,7 +413,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
418
413
 
419
414
  if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
420
415
  this.layerService.startAnimate();
421
- this.aniamateStatus = true;
416
+ this.animateStatus = true;
422
417
  }
423
418
  }
424
419
  }, {
@@ -497,8 +492,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
497
492
 
498
493
  this.updateLayerConfig({
499
494
  animateOption: rawAnimate
500
- }); // this.animateOptions = options;
501
-
495
+ });
502
496
  return this;
503
497
  }
504
498
  }, {
@@ -961,7 +955,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
961
955
 
962
956
  var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
963
957
 
964
- if (this.isDestroied) {
958
+ if (this.isDestroyed) {
965
959
  return;
966
960
  } // remove child layer
967
961
 
@@ -998,7 +992,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
998
992
  this.removeAllListeners(); // 解绑图层容器中的服务
999
993
  // this.container.unbind(TYPES.IStyleAttributeService);
1000
994
 
1001
- this.isDestroied = true;
995
+ this.isDestroyed = true;
1002
996
  }
1003
997
  }, {
1004
998
  key: "clear",
@@ -1184,7 +1178,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
1184
1178
  elements = _this9$styleAttribute.elements,
1185
1179
  count = _this9$styleAttribute.count;
1186
1180
 
1187
- var modeloptions = _objectSpread({
1181
+ var modelOptions = _objectSpread({
1188
1182
  attributes: attributes,
1189
1183
  uniforms: uniforms,
1190
1184
  fs: fs,
@@ -1194,18 +1188,18 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
1194
1188
  }, rest);
1195
1189
 
1196
1190
  if (count) {
1197
- modeloptions.count = count;
1191
+ modelOptions.count = count;
1198
1192
  }
1199
1193
 
1200
- var m = createModel(modeloptions);
1194
+ var m = createModel(modelOptions);
1201
1195
  resolve(m);
1202
1196
  }
1203
1197
  });
1204
1198
  });
1205
1199
  }
1206
1200
  }, {
1207
- key: "createAttrubutes",
1208
- value: function createAttrubutes(options) {
1201
+ key: "createAttributes",
1202
+ value: function createAttributes(options) {
1209
1203
  var triangulation = options.triangulation; // @ts-ignore
1210
1204
 
1211
1205
  var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
@@ -1226,9 +1220,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
1226
1220
  }, {
1227
1221
  key: "stopAnimate",
1228
1222
  value: function stopAnimate() {
1229
- if (this.aniamateStatus) {
1223
+ if (this.animateStatus) {
1230
1224
  this.layerService.stopAnimate();
1231
- this.aniamateStatus = false;
1225
+ this.animateStatus = false;
1232
1226
  this.updateLayerConfig({
1233
1227
  animateOption: {
1234
1228
  enable: false
@@ -29,7 +29,7 @@ export default class BaseModel<ChildLayerStyleOptions = {}> implements ILayerMod
29
29
  protected cellLength: number;
30
30
  protected cellProperties: ICellProperty[];
31
31
  protected cellTypeLayout: number[];
32
- protected stylePropertyesExist: {
32
+ protected stylePropertiesExist: {
33
33
  hasThetaOffset: number;
34
34
  hasOpacity: number;
35
35
  hasStrokeOpacity: number;
@@ -61,7 +61,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
61
61
  stroke: undefined,
62
62
  offsets: undefined
63
63
  };
64
- this.stylePropertyesExist = {
64
+ this.stylePropertiesExist = {
65
65
  hasThetaOffset: 0,
66
66
  hasOpacity: 0,
67
67
  hasStrokeOpacity: 0,
@@ -97,7 +97,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
97
97
 
98
98
  this.cellLength = 0; // 清空上一次计算的 cell 的长度
99
99
 
100
- this.stylePropertyesExist = {
100
+ this.stylePropertiesExist = {
101
101
  // 全量清空上一次是否需要对 style 属性进行数据映射的判断
102
102
  hasThetaOffset: 0,
103
103
  hasOpacity: 0,
@@ -115,13 +115,13 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
115
115
  this.rowCount, // 数据纹理有几行
116
116
  this.DATA_TEXTURE_WIDTH, // 数据纹理有几列
117
117
  0.0, 0.0, // 1
118
- this.stylePropertyesExist.hasOpacity, // cell 中是否存在 opacity
119
- this.stylePropertyesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
120
- this.stylePropertyesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
121
- this.stylePropertyesExist.hasStroke, // cell 中是否存在 stroke
118
+ this.stylePropertiesExist.hasOpacity, // cell 中是否存在 opacity
119
+ this.stylePropertiesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
120
+ this.stylePropertiesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
121
+ this.stylePropertiesExist.hasStroke, // cell 中是否存在 stroke
122
122
  // 2
123
- this.stylePropertyesExist.hasOffsets, // cell 中是否存在 offsets
124
- this.stylePropertyesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
123
+ this.stylePropertiesExist.hasOffsets, // cell 中是否存在 offsets
124
+ this.stylePropertiesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
125
125
  0.0, 0.0, // 3
126
126
  0.0, 0.0, 0.0, 1.0];
127
127
  } else {
@@ -198,7 +198,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
198
198
  attr: 'opacity',
199
199
  count: 1
200
200
  });
201
- this.stylePropertyesExist.hasOpacity = 1;
201
+ this.stylePropertiesExist.hasOpacity = 1;
202
202
  this.cellLength += 1;
203
203
  }
204
204
 
@@ -208,7 +208,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
208
208
  attr: 'strokeOpacity',
209
209
  count: 1
210
210
  });
211
- this.stylePropertyesExist.hasStrokeOpacity = 1;
211
+ this.stylePropertiesExist.hasStrokeOpacity = 1;
212
212
  this.cellLength += 1;
213
213
  }
214
214
 
@@ -218,7 +218,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
218
218
  attr: 'strokeWidth',
219
219
  count: 1
220
220
  });
221
- this.stylePropertyesExist.hasStrokeWidth = 1;
221
+ this.stylePropertiesExist.hasStrokeWidth = 1;
222
222
  this.cellLength += 1;
223
223
  }
224
224
 
@@ -228,7 +228,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
228
228
  attr: 'stroke',
229
229
  count: 4
230
230
  });
231
- this.stylePropertyesExist.hasStroke = 1;
231
+ this.stylePropertiesExist.hasStroke = 1;
232
232
  this.cellLength += 4;
233
233
  }
234
234
 
@@ -238,7 +238,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
238
238
  attr: 'offsets',
239
239
  count: 2
240
240
  });
241
- this.stylePropertyesExist.hasOffsets = 1;
241
+ this.stylePropertiesExist.hasOffsets = 1;
242
242
  this.cellLength += 2;
243
243
  }
244
244
 
@@ -248,10 +248,9 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
248
248
  attr: 'thetaOffset',
249
249
  count: 1
250
250
  });
251
- this.stylePropertyesExist.hasThetaOffset = 1;
251
+ this.stylePropertiesExist.hasThetaOffset = 1;
252
252
  this.cellLength += 1;
253
- } // console.log('this.cellLength', this.cellLength)
254
-
253
+ }
255
254
  }
256
255
  /**
257
256
  * 判断变量 stroke 是否是常量值
@@ -1,4 +1,4 @@
1
- import { IAnimateOption, IMapService } from '@antv/l7-core';
1
+ import { IAnimateOption, IMapService, ITexture2D } from '@antv/l7-core';
2
2
  import { IColorRamp, IImagedata } from '@antv/l7-utils';
3
3
  import { styleOffset } from '../core/BaseModel';
4
4
  import { anchorType } from '../utils/symbol-layout';
@@ -143,6 +143,7 @@ export interface IImageLayerStyleOptions extends IBaseLayerStyleOptions {
143
143
  clampHigh?: boolean;
144
144
  rampColors?: IColorRamp;
145
145
  rampColorsData?: ImageData | IImagedata;
146
+ colorTexture?: ITexture2D;
146
147
  pixelConstant?: number;
147
148
  pixelConstantR?: number;
148
149
  pixelConstantG?: number;
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
14
14
  import { earthTriangulation } from "../../core/triangulation";
15
15
 
16
16
  /* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
17
- var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // TODO: \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
17
+ var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
18
18
 
19
19
  /* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
20
20
  var atmoSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nvarying float v_CamreaDistance;\n\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\nvarying float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
@@ -57,7 +57,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
57
57
  // TODO: 调整图层的绘制顺序 地球大气层
58
58
  this.layer.zIndex = -997;
59
59
  this.layer.buildLayerModel({
60
- moduleName: 'earthAtmo',
60
+ moduleName: 'earthAtmoSphere',
61
61
  vertexShader: atmoSphereVert,
62
62
  fragmentShader: atmoSphereFrag,
63
63
  triangulation: earthTriangulation,
@@ -82,13 +82,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
82
82
  descriptor: {
83
83
  name: 'a_Size',
84
84
  buffer: {
85
- // give the WebGL driver a hint that this buffer may change
86
85
  usage: gl.DYNAMIC_DRAW,
87
86
  data: [],
88
87
  type: gl.FLOAT
89
88
  },
90
89
  size: 1,
91
- update: function update(feature, featureIdx, vertex, attributeIdx) {
90
+ update: function update(feature) {
92
91
  var _feature$size = feature.size,
93
92
  size = _feature$size === void 0 ? 1 : _feature$size;
94
93
  return Array.isArray(size) ? [size[0]] : [size];
@@ -101,7 +100,6 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
101
100
  descriptor: {
102
101
  name: 'a_Normal',
103
102
  buffer: {
104
- // give the WebGL driver a hint that this buffer may change
105
103
  usage: gl.STATIC_DRAW,
106
104
  data: [],
107
105
  type: gl.FLOAT
@@ -118,13 +116,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
118
116
  descriptor: {
119
117
  name: 'a_Uv',
120
118
  buffer: {
121
- // give the WebGL driver a hint that this buffer may change
122
119
  usage: gl.DYNAMIC_DRAW,
123
120
  data: [],
124
121
  type: gl.FLOAT
125
122
  },
126
123
  size: 2,
127
- update: function update(feature, featureIdx, vertex, attributeIdx) {
124
+ update: function update(feature, featureIdx, vertex) {
128
125
  return [vertex[3], vertex[4]];
129
126
  }
130
127
  }
@@ -54,7 +54,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
54
54
  value: function getUninforms() {
55
55
  var _this$layer$getLayerC = this.layer.getLayerConfig(),
56
56
  animateOption = _this$layer$getLayerC.animateOption,
57
- globelOtions = _this$layer$getLayerC.globelOtions;
57
+ globalOptions = _this$layer$getLayerC.globalOptions;
58
58
 
59
59
  if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
60
60
  // @ts-ignore
@@ -69,13 +69,12 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
69
69
  }
70
70
 
71
71
  return {
72
- u_ambientRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.ambientRatio) || 0.6,
72
+ u_ambientRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.ambientRatio) || 0.6,
73
73
  // 环境光
74
- u_diffuseRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.diffuseRatio) || 0.4,
74
+ u_diffuseRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.diffuseRatio) || 0.4,
75
75
  // 漫反射
76
- u_specularRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.specularRatio) || 0.1,
76
+ u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1,
77
77
  // 高光反射
78
- // u_sunLight: [120, 120, 120],
79
78
  u_sunLight: [this.sunX, this.sunY, this.sunZ],
80
79
  u_texture: this.texture
81
80
  };
@@ -95,10 +94,10 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
95
94
  var _this2 = this;
96
95
 
97
96
  var _this$layer$getLayerC2 = this.layer.getLayerConfig(),
98
- globelOtions = _this$layer$getLayerC2.globelOtions;
97
+ globalOptions = _this$layer$getLayerC2.globalOptions;
99
98
 
100
- if ((globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.earthTime) !== undefined) {
101
- this.setEarthTime(globelOtions.earthTime);
99
+ if ((globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.earthTime) !== undefined) {
100
+ this.setEarthTime(globalOptions.earthTime);
102
101
  }
103
102
 
104
103
  var source = this.layer.getSource();
@@ -126,7 +125,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
126
125
  }, {
127
126
  key: "buildModels",
128
127
  value: function buildModels(callbackModel) {
129
- // TODO: 调整图层的绘制顺序 地球大气层
128
+ // Tip: 调整图层的绘制顺序 地球大气层
130
129
  this.layer.zIndex = -998;
131
130
  this.layer.buildLayerModel({
132
131
  moduleName: 'earthBase',
@@ -147,20 +146,18 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
147
146
  }, {
148
147
  key: "registerBuiltinAttributes",
149
148
  value: function registerBuiltinAttributes() {
150
- // point layer size;
151
149
  this.styleAttributeService.registerStyleAttribute({
152
150
  name: 'size',
153
151
  type: AttributeType.Attribute,
154
152
  descriptor: {
155
153
  name: 'a_Size',
156
154
  buffer: {
157
- // give the WebGL driver a hint that this buffer may change
158
155
  usage: gl.DYNAMIC_DRAW,
159
156
  data: [],
160
157
  type: gl.FLOAT
161
158
  },
162
159
  size: 1,
163
- update: function update(feature, featureIdx, vertex, attributeIdx) {
160
+ update: function update(feature) {
164
161
  var _feature$size = feature.size,
165
162
  size = _feature$size === void 0 ? 1 : _feature$size;
166
163
  return Array.isArray(size) ? [size[0]] : [size];
@@ -173,7 +170,6 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
173
170
  descriptor: {
174
171
  name: 'a_Normal',
175
172
  buffer: {
176
- // give the WebGL driver a hint that this buffer may change
177
173
  usage: gl.STATIC_DRAW,
178
174
  data: [],
179
175
  type: gl.FLOAT
@@ -196,7 +192,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
196
192
  type: gl.FLOAT
197
193
  },
198
194
  size: 2,
199
- update: function update(feature, featureIdx, vertex, attributeIdx) {
195
+ update: function update(feature, featureIdx, vertex) {
200
196
  return [vertex[3], vertex[4]];
201
197
  }
202
198
  }
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
14
14
  import { earthOuterTriangulation } from "../../core/triangulation";
15
15
 
16
16
  /* babel-plugin-inline-import '../shaders/bloomsphere_frag.glsl' */
17
- var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n // TODO: \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
17
+ var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
18
18
 
19
19
  /* babel-plugin-inline-import '../shaders/bloomsphere_vert.glsl' */
20
20
  var bloomSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\n\nvoid main() {\n v_Color = a_Color;\n\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
@@ -54,7 +54,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
54
54
  }, {
55
55
  key: "buildModels",
56
56
  value: function buildModels(callbackModel) {
57
- // TODO: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
57
+ // Tip: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
58
58
  this.layer.zIndex = -999;
59
59
  this.layer.buildLayerModel({
60
60
  moduleName: 'earthBloom',
@@ -75,20 +75,18 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
75
75
  }, {
76
76
  key: "registerBuiltinAttributes",
77
77
  value: function registerBuiltinAttributes() {
78
- // point layer size;
79
78
  this.styleAttributeService.registerStyleAttribute({
80
79
  name: 'size',
81
80
  type: AttributeType.Attribute,
82
81
  descriptor: {
83
82
  name: 'a_Size',
84
83
  buffer: {
85
- // give the WebGL driver a hint that this buffer may change
86
84
  usage: gl.DYNAMIC_DRAW,
87
85
  data: [],
88
86
  type: gl.FLOAT
89
87
  },
90
88
  size: 1,
91
- update: function update(feature, featureIdx, vertex, attributeIdx) {
89
+ update: function update(feature) {
92
90
  var _feature$size = feature.size,
93
91
  size = _feature$size === void 0 ? 1 : _feature$size;
94
92
  return Array.isArray(size) ? [size[0]] : [size];
@@ -101,7 +99,6 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
101
99
  descriptor: {
102
100
  name: 'a_Normal',
103
101
  buffer: {
104
- // give the WebGL driver a hint that this buffer may change
105
102
  usage: gl.STATIC_DRAW,
106
103
  data: [],
107
104
  type: gl.FLOAT
@@ -118,13 +115,12 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
118
115
  descriptor: {
119
116
  name: 'a_Uv',
120
117
  buffer: {
121
- // give the WebGL driver a hint that this buffer may change
122
118
  usage: gl.DYNAMIC_DRAW,
123
119
  data: [],
124
120
  type: gl.FLOAT
125
121
  },
126
122
  size: 2,
127
- update: function update(feature, featureIdx, vertex, attributeIdx) {
123
+ update: function update(feature, featureIdx, vertex) {
128
124
  return [vertex[3], vertex[4]];
129
125
  }
130
126
  }
@@ -1,4 +1,4 @@
1
- import { IAttrubuteAndElements } from '@antv/l7-core';
1
+ import { IAttributeAndElements } from '@antv/l7-core';
2
2
  import BaseLayer from '../core/BaseLayer';
3
3
  import { IHeatMapLayerStyleOptions } from '../core/interface';
4
4
  import { HeatMapModelType } from './models';
@@ -7,7 +7,7 @@ export default class HeatMapLayer extends BaseLayer<IHeatMapLayerStyleOptions> {
7
7
  buildModels(): void;
8
8
  rebuildModels(): void;
9
9
  renderModels(): this;
10
- updateModelData(data: IAttrubuteAndElements): void;
10
+ updateModelData(data: IAttributeAndElements): void;
11
11
  protected getConfigSchema(): {
12
12
  properties: {
13
13
  opacity: {
@@ -78,9 +78,7 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
78
78
  if (this.layerModelNeedUpdate) {
79
79
  this.layerModel.buildModels(function (models) {
80
80
  return _this4.models = models;
81
- }); // @ts-ignore
82
- // this.models = this.layerModel.buildModels();
83
-
81
+ });
84
82
  this.layerModelNeedUpdate = false;
85
83
  }
86
84
 
@@ -86,14 +86,12 @@ var GridModel = /*#__PURE__*/function (_BaseModel) {
86
86
  descriptor: {
87
87
  name: 'a_Pos',
88
88
  buffer: {
89
- // give the WebGL driver a hint that this buffer may change
90
89
  usage: gl.DYNAMIC_DRAW,
91
90
  data: [],
92
91
  type: gl.FLOAT
93
92
  },
94
93
  size: 3,
95
- update: function update(feature, featureIdx) {
96
- // const coordinates = feature.coordinates as number[];
94
+ update: function update(feature) {
97
95
  var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
98
96
  return [coordinates[0], coordinates[1], 0];
99
97
  }
@@ -80,33 +80,29 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
80
80
  }, {
81
81
  key: "registerBuiltinAttributes",
82
82
  value: function registerBuiltinAttributes() {
83
- // point layer size;
84
83
  this.styleAttributeService.registerStyleAttribute({
85
84
  name: 'size',
86
85
  type: AttributeType.Attribute,
87
86
  descriptor: {
88
87
  name: 'a_Size',
89
88
  buffer: {
90
- // give the WebGL driver a hint that this buffer may change
91
89
  usage: gl.DYNAMIC_DRAW,
92
90
  data: [],
93
91
  type: gl.FLOAT
94
92
  },
95
93
  size: 1,
96
- update: function update(feature, featureIdx, vertex, attributeIdx) {
94
+ update: function update(feature) {
97
95
  var size = feature.size;
98
96
  return Array.isArray(size) ? [size[0]] : [size];
99
97
  }
100
98
  }
101
- }); // point layer size;
102
-
99
+ });
103
100
  this.styleAttributeService.registerStyleAttribute({
104
101
  name: 'normal',
105
102
  type: AttributeType.Attribute,
106
103
  descriptor: {
107
104
  name: 'a_Normal',
108
105
  buffer: {
109
- // give the WebGL driver a hint that this buffer may change
110
106
  usage: gl.STATIC_DRAW,
111
107
  data: [],
112
108
  type: gl.FLOAT
@@ -124,16 +120,13 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
124
120
  descriptor: {
125
121
  name: 'a_Pos',
126
122
  buffer: {
127
- // give the WebGL driver a hint that this buffer may change
128
123
  usage: gl.DYNAMIC_DRAW,
129
124
  data: [],
130
125
  type: gl.FLOAT
131
126
  },
132
127
  size: 3,
133
- update: function update(feature, featureIdx) {
134
- var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates; // const coordinates = feature.coordinates as number[];
135
- // const coordinates = feature.originCoordinates as number[];
136
-
128
+ update: function update(feature) {
129
+ var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
137
130
  return [coordinates[0], coordinates[1], 0];
138
131
  }
139
132
  }