@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
@@ -149,9 +149,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
149
149
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "currentPickId", null);
150
150
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "pendingStyleAttributes", []);
151
151
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scaleOptions", {});
152
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "aniamateStatus", false);
152
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "animateStatus", false);
153
153
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
154
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isDestroied", false);
154
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isDestroyed", false);
155
155
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "encodeDataLength", 0);
156
156
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sourceEvent", function () {
157
157
  _this.dataState.dataSourceNeedUpdate = true;
@@ -251,11 +251,6 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
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 = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
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 = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
497
492
 
498
493
  this.updateLayerConfig({
499
494
  animateOption: rawAnimate
500
- }); // this.animateOptions = options;
501
-
495
+ });
502
496
  return this;
503
497
  }
504
498
  }, {
@@ -959,7 +953,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
959
953
 
960
954
  var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
961
955
 
962
- if (this.isDestroied) {
956
+ if (this.isDestroyed) {
963
957
  return;
964
958
  } // remove child layer
965
959
 
@@ -996,7 +990,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
996
990
  this.removeAllListeners(); // 解绑图层容器中的服务
997
991
  // this.container.unbind(TYPES.IStyleAttributeService);
998
992
 
999
- this.isDestroied = true;
993
+ this.isDestroyed = true;
1000
994
  }
1001
995
  }, {
1002
996
  key: "clear",
@@ -1181,7 +1175,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1181
1175
  elements = _this9$styleAttribute.elements,
1182
1176
  count = _this9$styleAttribute.count;
1183
1177
 
1184
- var modeloptions = (0, _objectSpread2.default)({
1178
+ var modelOptions = (0, _objectSpread2.default)({
1185
1179
  attributes: attributes,
1186
1180
  uniforms: uniforms,
1187
1181
  fs: fs,
@@ -1191,18 +1185,18 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1191
1185
  }, rest);
1192
1186
 
1193
1187
  if (count) {
1194
- modeloptions.count = count;
1188
+ modelOptions.count = count;
1195
1189
  }
1196
1190
 
1197
- var m = createModel(modeloptions);
1191
+ var m = createModel(modelOptions);
1198
1192
  resolve(m);
1199
1193
  }
1200
1194
  });
1201
1195
  });
1202
1196
  }
1203
1197
  }, {
1204
- key: "createAttrubutes",
1205
- value: function createAttrubutes(options) {
1198
+ key: "createAttributes",
1199
+ value: function createAttributes(options) {
1206
1200
  var triangulation = options.triangulation; // @ts-ignore
1207
1201
 
1208
1202
  var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
@@ -1223,9 +1217,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1223
1217
  }, {
1224
1218
  key: "stopAnimate",
1225
1219
  value: function stopAnimate() {
1226
- if (this.aniamateStatus) {
1220
+ if (this.animateStatus) {
1227
1221
  this.layerService.stopAnimate();
1228
- this.aniamateStatus = false;
1222
+ this.animateStatus = false;
1229
1223
  this.updateLayerConfig({
1230
1224
  animateOption: {
1231
1225
  enable: false
@@ -79,7 +79,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
79
79
  stroke: undefined,
80
80
  offsets: undefined
81
81
  };
82
- this.stylePropertyesExist = {
82
+ this.stylePropertiesExist = {
83
83
  hasThetaOffset: 0,
84
84
  hasOpacity: 0,
85
85
  hasStrokeOpacity: 0,
@@ -115,7 +115,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
115
115
 
116
116
  this.cellLength = 0; // 清空上一次计算的 cell 的长度
117
117
 
118
- this.stylePropertyesExist = {
118
+ this.stylePropertiesExist = {
119
119
  // 全量清空上一次是否需要对 style 属性进行数据映射的判断
120
120
  hasThetaOffset: 0,
121
121
  hasOpacity: 0,
@@ -133,13 +133,13 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
133
133
  this.rowCount, // 数据纹理有几行
134
134
  this.DATA_TEXTURE_WIDTH, // 数据纹理有几列
135
135
  0.0, 0.0, // 1
136
- this.stylePropertyesExist.hasOpacity, // cell 中是否存在 opacity
137
- this.stylePropertyesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
138
- this.stylePropertyesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
139
- this.stylePropertyesExist.hasStroke, // cell 中是否存在 stroke
136
+ this.stylePropertiesExist.hasOpacity, // cell 中是否存在 opacity
137
+ this.stylePropertiesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
138
+ this.stylePropertiesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
139
+ this.stylePropertiesExist.hasStroke, // cell 中是否存在 stroke
140
140
  // 2
141
- this.stylePropertyesExist.hasOffsets, // cell 中是否存在 offsets
142
- this.stylePropertyesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
141
+ this.stylePropertiesExist.hasOffsets, // cell 中是否存在 offsets
142
+ this.stylePropertiesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
143
143
  0.0, 0.0, // 3
144
144
  0.0, 0.0, 0.0, 1.0];
145
145
  } else {
@@ -216,7 +216,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
216
216
  attr: 'opacity',
217
217
  count: 1
218
218
  });
219
- this.stylePropertyesExist.hasOpacity = 1;
219
+ this.stylePropertiesExist.hasOpacity = 1;
220
220
  this.cellLength += 1;
221
221
  }
222
222
 
@@ -226,7 +226,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
226
226
  attr: 'strokeOpacity',
227
227
  count: 1
228
228
  });
229
- this.stylePropertyesExist.hasStrokeOpacity = 1;
229
+ this.stylePropertiesExist.hasStrokeOpacity = 1;
230
230
  this.cellLength += 1;
231
231
  }
232
232
 
@@ -236,7 +236,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
236
236
  attr: 'strokeWidth',
237
237
  count: 1
238
238
  });
239
- this.stylePropertyesExist.hasStrokeWidth = 1;
239
+ this.stylePropertiesExist.hasStrokeWidth = 1;
240
240
  this.cellLength += 1;
241
241
  }
242
242
 
@@ -246,7 +246,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
246
246
  attr: 'stroke',
247
247
  count: 4
248
248
  });
249
- this.stylePropertyesExist.hasStroke = 1;
249
+ this.stylePropertiesExist.hasStroke = 1;
250
250
  this.cellLength += 4;
251
251
  }
252
252
 
@@ -256,7 +256,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
256
256
  attr: 'offsets',
257
257
  count: 2
258
258
  });
259
- this.stylePropertyesExist.hasOffsets = 1;
259
+ this.stylePropertiesExist.hasOffsets = 1;
260
260
  this.cellLength += 2;
261
261
  }
262
262
 
@@ -266,10 +266,9 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
266
266
  attr: 'thetaOffset',
267
267
  count: 1
268
268
  });
269
- this.stylePropertyesExist.hasThetaOffset = 1;
269
+ this.stylePropertiesExist.hasThetaOffset = 1;
270
270
  this.cellLength += 1;
271
- } // console.log('this.cellLength', this.cellLength)
272
-
271
+ }
273
272
  }
274
273
  /**
275
274
  * 判断变量 stroke 是否是常量值
@@ -30,7 +30,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
30
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
31
 
32
32
  /* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
33
- 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";
33
+ 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";
34
34
 
35
35
  /* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
36
36
  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";
@@ -72,7 +72,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
72
72
  // TODO: 调整图层的绘制顺序 地球大气层
73
73
  this.layer.zIndex = -997;
74
74
  this.layer.buildLayerModel({
75
- moduleName: 'earthAtmo',
75
+ moduleName: 'earthAtmoSphere',
76
76
  vertexShader: atmoSphereVert,
77
77
  fragmentShader: atmoSphereFrag,
78
78
  triangulation: _triangulation.earthTriangulation,
@@ -97,13 +97,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
97
97
  descriptor: {
98
98
  name: 'a_Size',
99
99
  buffer: {
100
- // give the WebGL driver a hint that this buffer may change
101
100
  usage: _l7Core.gl.DYNAMIC_DRAW,
102
101
  data: [],
103
102
  type: _l7Core.gl.FLOAT
104
103
  },
105
104
  size: 1,
106
- update: function update(feature, featureIdx, vertex, attributeIdx) {
105
+ update: function update(feature) {
107
106
  var _feature$size = feature.size,
108
107
  size = _feature$size === void 0 ? 1 : _feature$size;
109
108
  return Array.isArray(size) ? [size[0]] : [size];
@@ -116,7 +115,6 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
116
115
  descriptor: {
117
116
  name: 'a_Normal',
118
117
  buffer: {
119
- // give the WebGL driver a hint that this buffer may change
120
118
  usage: _l7Core.gl.STATIC_DRAW,
121
119
  data: [],
122
120
  type: _l7Core.gl.FLOAT
@@ -133,13 +131,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
133
131
  descriptor: {
134
132
  name: 'a_Uv',
135
133
  buffer: {
136
- // give the WebGL driver a hint that this buffer may change
137
134
  usage: _l7Core.gl.DYNAMIC_DRAW,
138
135
  data: [],
139
136
  type: _l7Core.gl.FLOAT
140
137
  },
141
138
  size: 2,
142
- update: function update(feature, featureIdx, vertex, attributeIdx) {
139
+ update: function update(feature, featureIdx, vertex) {
143
140
  return [vertex[3], vertex[4]];
144
141
  }
145
142
  }
@@ -65,7 +65,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
65
65
  value: function getUninforms() {
66
66
  var _this$layer$getLayerC = this.layer.getLayerConfig(),
67
67
  animateOption = _this$layer$getLayerC.animateOption,
68
- globelOtions = _this$layer$getLayerC.globelOtions;
68
+ globalOptions = _this$layer$getLayerC.globalOptions;
69
69
 
70
70
  if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
71
71
  // @ts-ignore
@@ -80,13 +80,12 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
80
80
  }
81
81
 
82
82
  return {
83
- u_ambientRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.ambientRatio) || 0.6,
83
+ u_ambientRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.ambientRatio) || 0.6,
84
84
  // 环境光
85
- u_diffuseRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.diffuseRatio) || 0.4,
85
+ u_diffuseRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.diffuseRatio) || 0.4,
86
86
  // 漫反射
87
- u_specularRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.specularRatio) || 0.1,
87
+ u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1,
88
88
  // 高光反射
89
- // u_sunLight: [120, 120, 120],
90
89
  u_sunLight: [this.sunX, this.sunY, this.sunZ],
91
90
  u_texture: this.texture
92
91
  };
@@ -106,10 +105,10 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
106
105
  var _this2 = this;
107
106
 
108
107
  var _this$layer$getLayerC2 = this.layer.getLayerConfig(),
109
- globelOtions = _this$layer$getLayerC2.globelOtions;
108
+ globalOptions = _this$layer$getLayerC2.globalOptions;
110
109
 
111
- if ((globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.earthTime) !== undefined) {
112
- this.setEarthTime(globelOtions.earthTime);
110
+ if ((globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.earthTime) !== undefined) {
111
+ this.setEarthTime(globalOptions.earthTime);
113
112
  }
114
113
 
115
114
  var source = this.layer.getSource();
@@ -137,7 +136,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
137
136
  }, {
138
137
  key: "buildModels",
139
138
  value: function buildModels(callbackModel) {
140
- // TODO: 调整图层的绘制顺序 地球大气层
139
+ // Tip: 调整图层的绘制顺序 地球大气层
141
140
  this.layer.zIndex = -998;
142
141
  this.layer.buildLayerModel({
143
142
  moduleName: 'earthBase',
@@ -158,20 +157,18 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
158
157
  }, {
159
158
  key: "registerBuiltinAttributes",
160
159
  value: function registerBuiltinAttributes() {
161
- // point layer size;
162
160
  this.styleAttributeService.registerStyleAttribute({
163
161
  name: 'size',
164
162
  type: _l7Core.AttributeType.Attribute,
165
163
  descriptor: {
166
164
  name: 'a_Size',
167
165
  buffer: {
168
- // give the WebGL driver a hint that this buffer may change
169
166
  usage: _l7Core.gl.DYNAMIC_DRAW,
170
167
  data: [],
171
168
  type: _l7Core.gl.FLOAT
172
169
  },
173
170
  size: 1,
174
- update: function update(feature, featureIdx, vertex, attributeIdx) {
171
+ update: function update(feature) {
175
172
  var _feature$size = feature.size,
176
173
  size = _feature$size === void 0 ? 1 : _feature$size;
177
174
  return Array.isArray(size) ? [size[0]] : [size];
@@ -184,7 +181,6 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
184
181
  descriptor: {
185
182
  name: 'a_Normal',
186
183
  buffer: {
187
- // give the WebGL driver a hint that this buffer may change
188
184
  usage: _l7Core.gl.STATIC_DRAW,
189
185
  data: [],
190
186
  type: _l7Core.gl.FLOAT
@@ -207,7 +203,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
207
203
  type: _l7Core.gl.FLOAT
208
204
  },
209
205
  size: 2,
210
- update: function update(feature, featureIdx, vertex, attributeIdx) {
206
+ update: function update(feature, featureIdx, vertex) {
211
207
  return [vertex[3], vertex[4]];
212
208
  }
213
209
  }
@@ -30,7 +30,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
30
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
31
 
32
32
  /* babel-plugin-inline-import '../shaders/bloomsphere_frag.glsl' */
33
- 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";
33
+ 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";
34
34
 
35
35
  /* babel-plugin-inline-import '../shaders/bloomsphere_vert.glsl' */
36
36
  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";
@@ -69,7 +69,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
69
69
  }, {
70
70
  key: "buildModels",
71
71
  value: function buildModels(callbackModel) {
72
- // TODO: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
72
+ // Tip: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
73
73
  this.layer.zIndex = -999;
74
74
  this.layer.buildLayerModel({
75
75
  moduleName: 'earthBloom',
@@ -90,20 +90,18 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
90
90
  }, {
91
91
  key: "registerBuiltinAttributes",
92
92
  value: function registerBuiltinAttributes() {
93
- // point layer size;
94
93
  this.styleAttributeService.registerStyleAttribute({
95
94
  name: 'size',
96
95
  type: _l7Core.AttributeType.Attribute,
97
96
  descriptor: {
98
97
  name: 'a_Size',
99
98
  buffer: {
100
- // give the WebGL driver a hint that this buffer may change
101
99
  usage: _l7Core.gl.DYNAMIC_DRAW,
102
100
  data: [],
103
101
  type: _l7Core.gl.FLOAT
104
102
  },
105
103
  size: 1,
106
- update: function update(feature, featureIdx, vertex, attributeIdx) {
104
+ update: function update(feature) {
107
105
  var _feature$size = feature.size,
108
106
  size = _feature$size === void 0 ? 1 : _feature$size;
109
107
  return Array.isArray(size) ? [size[0]] : [size];
@@ -116,7 +114,6 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
116
114
  descriptor: {
117
115
  name: 'a_Normal',
118
116
  buffer: {
119
- // give the WebGL driver a hint that this buffer may change
120
117
  usage: _l7Core.gl.STATIC_DRAW,
121
118
  data: [],
122
119
  type: _l7Core.gl.FLOAT
@@ -133,13 +130,12 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
133
130
  descriptor: {
134
131
  name: 'a_Uv',
135
132
  buffer: {
136
- // give the WebGL driver a hint that this buffer may change
137
133
  usage: _l7Core.gl.DYNAMIC_DRAW,
138
134
  data: [],
139
135
  type: _l7Core.gl.FLOAT
140
136
  },
141
137
  size: 2,
142
- update: function update(feature, featureIdx, vertex, attributeIdx) {
138
+ update: function update(feature, featureIdx, vertex) {
143
139
  return [vertex[3], vertex[4]];
144
140
  }
145
141
  }
@@ -92,9 +92,7 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
92
92
  if (this.layerModelNeedUpdate) {
93
93
  this.layerModel.buildModels(function (models) {
94
94
  return _this4.models = models;
95
- }); // @ts-ignore
96
- // this.models = this.layerModel.buildModels();
97
-
95
+ });
98
96
  this.layerModelNeedUpdate = false;
99
97
  }
100
98
 
@@ -101,14 +101,12 @@ var GridModel = /*#__PURE__*/function (_BaseModel) {
101
101
  descriptor: {
102
102
  name: 'a_Pos',
103
103
  buffer: {
104
- // give the WebGL driver a hint that this buffer may change
105
104
  usage: _l7Core.gl.DYNAMIC_DRAW,
106
105
  data: [],
107
106
  type: _l7Core.gl.FLOAT
108
107
  },
109
108
  size: 3,
110
- update: function update(feature, featureIdx) {
111
- // const coordinates = feature.coordinates as number[];
109
+ update: function update(feature) {
112
110
  var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
113
111
  return [coordinates[0], coordinates[1], 0];
114
112
  }
@@ -95,33 +95,29 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
95
95
  }, {
96
96
  key: "registerBuiltinAttributes",
97
97
  value: function registerBuiltinAttributes() {
98
- // point layer size;
99
98
  this.styleAttributeService.registerStyleAttribute({
100
99
  name: 'size',
101
100
  type: _l7Core.AttributeType.Attribute,
102
101
  descriptor: {
103
102
  name: 'a_Size',
104
103
  buffer: {
105
- // give the WebGL driver a hint that this buffer may change
106
104
  usage: _l7Core.gl.DYNAMIC_DRAW,
107
105
  data: [],
108
106
  type: _l7Core.gl.FLOAT
109
107
  },
110
108
  size: 1,
111
- update: function update(feature, featureIdx, vertex, attributeIdx) {
109
+ update: function update(feature) {
112
110
  var size = feature.size;
113
111
  return Array.isArray(size) ? [size[0]] : [size];
114
112
  }
115
113
  }
116
- }); // point layer size;
117
-
114
+ });
118
115
  this.styleAttributeService.registerStyleAttribute({
119
116
  name: 'normal',
120
117
  type: _l7Core.AttributeType.Attribute,
121
118
  descriptor: {
122
119
  name: 'a_Normal',
123
120
  buffer: {
124
- // give the WebGL driver a hint that this buffer may change
125
121
  usage: _l7Core.gl.STATIC_DRAW,
126
122
  data: [],
127
123
  type: _l7Core.gl.FLOAT
@@ -139,16 +135,13 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
139
135
  descriptor: {
140
136
  name: 'a_Pos',
141
137
  buffer: {
142
- // give the WebGL driver a hint that this buffer may change
143
138
  usage: _l7Core.gl.DYNAMIC_DRAW,
144
139
  data: [],
145
140
  type: _l7Core.gl.FLOAT
146
141
  },
147
142
  size: 3,
148
- update: function update(feature, featureIdx) {
149
- var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates; // const coordinates = feature.coordinates as number[];
150
- // const coordinates = feature.originCoordinates as number[];
151
-
143
+ update: function update(feature) {
144
+ var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
152
145
  return [coordinates[0], coordinates[1], 0];
153
146
  }
154
147
  }
@@ -174,18 +174,16 @@ var HeatMapModel = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE
174
174
  descriptor: {
175
175
  name: 'a_Dir',
176
176
  buffer: {
177
- // give the WebGL driver a hint that this buffer may change
178
177
  usage: _l7Core.gl.DYNAMIC_DRAW,
179
178
  data: [],
180
179
  type: _l7Core.gl.FLOAT
181
180
  },
182
181
  size: 2,
183
- update: function update(feature, featureIdx, vertex, attributeIdx) {
182
+ update: function update(feature, featureIdx, vertex) {
184
183
  return [vertex[3], vertex[4]];
185
184
  }
186
185
  }
187
- }); // point layer size;
188
-
186
+ });
189
187
  this.styleAttributeService.registerStyleAttribute({
190
188
  name: 'size',
191
189
  type: _l7Core.AttributeType.Attribute,
@@ -198,7 +196,7 @@ var HeatMapModel = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE
198
196
  type: _l7Core.gl.FLOAT
199
197
  },
200
198
  size: 1,
201
- update: function update(feature, featureIdx, vertex, attributeIdx) {
199
+ update: function update(feature) {
202
200
  var _feature$size = feature.size,
203
201
  size = _feature$size === void 0 ? 1 : _feature$size;
204
202
  return [size];
@@ -308,7 +306,6 @@ var HeatMapModel = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE
308
306
  enable: false
309
307
  },
310
308
  blend: this.getBlend(),
311
- // count: 6,
312
309
  elements: createElements({
313
310
  data: [0, 2, 1, 2, 3, 1],
314
311
  type: _l7Core.gl.UNSIGNED_INT,
@@ -102,17 +102,13 @@ var HexagonModel = /*#__PURE__*/function (_BaseModel) {
102
102
  descriptor: {
103
103
  name: 'a_Pos',
104
104
  buffer: {
105
- // give the WebGL driver a hint that this buffer may change
106
105
  usage: _l7Core.gl.DYNAMIC_DRAW,
107
106
  data: [],
108
107
  type: _l7Core.gl.FLOAT
109
108
  },
110
109
  size: 3,
111
- update: function update(feature, featureIdx) {
112
- // const coordinates = (feature.verison==='GAODE2.x'?feature.originoordinates:feature.coordinates) as number[];
113
- var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates; // const coordinates = feature.coordinates as number[];
114
- // const coordinates = feature.originCoordinates as number[];
115
-
110
+ update: function update(feature) {
111
+ var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
116
112
  return [coordinates[0], coordinates[1], 0];
117
113
  }
118
114
  }
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.heatMap3DTriangulation = heatMap3DTriangulation;
7
7
 
8
- // @ts-ignore
9
8
  function heatMap3DTriangulation(width, height) {
10
9
  var indices = [];
11
10
  var vertices = [];
@@ -93,7 +93,8 @@ var ImageLayer = /*#__PURE__*/function (_BaseLayer) {
93
93
  var type = this.getModelType();
94
94
  var defaultConfig = {
95
95
  image: {},
96
- dataImage: {}
96
+ dataImage: {},
97
+ tileDataImage: {}
97
98
  };
98
99
  return defaultConfig[type];
99
100
  }
@@ -109,6 +110,8 @@ var ImageLayer = /*#__PURE__*/function (_BaseLayer) {
109
110
  return 'dataImage';
110
111
  } else if (shape === 'image') {
111
112
  return 'image';
113
+ } else if (shape === 'tileDataImage') {
114
+ return 'tileDataImage';
112
115
  } else {
113
116
  return 'image';
114
117
  }
@@ -73,7 +73,7 @@ var ImageDataModel = /*#__PURE__*/function (_BaseModel) {
73
73
  pixelConstantRGB = _ref$pixelConstantRGB === void 0 ? 0.1 : _ref$pixelConstantRGB;
74
74
 
75
75
  if (!(0, _lodash.isEqual)(this.rampColors, rampColors)) {
76
- this.updateColorTexure();
76
+ this.updateColorTexture();
77
77
  this.rampColors = rampColors;
78
78
  }
79
79
 
@@ -111,35 +111,15 @@ var ImageDataModel = /*#__PURE__*/function (_BaseModel) {
111
111
  height: 0,
112
112
  width: 0
113
113
  });
114
-
115
- if (_l7Utils.isMini) {
116
- // @ts-ignore
117
- var canvas = this.layerService.sceneService.getSceneConfig().canvas;
118
- var img = canvas.createImage();
119
- img.crossOrigin = 'anonymous';
120
- img.src = source.data.originData;
121
-
122
- img.onload = function () {
123
- _this.texture = createTexture2D({
124
- data: img,
125
- width: img.width,
126
- height: img.height
127
- });
128
-
129
- _this.layerService.reRender();
130
- };
131
- } else {
132
- source.data.images.then(function (imageData) {
133
- _this.texture = createTexture2D({
134
- data: imageData[0],
135
- width: imageData[0].width,
136
- height: imageData[0].height
137
- });
138
-
139
- _this.layerService.reRender();
114
+ source.data.images.then(function (imageData) {
115
+ _this.texture = createTexture2D({
116
+ data: imageData[0],
117
+ width: imageData[0].width,
118
+ height: imageData[0].height
140
119
  });
141
- }
142
120
 
121
+ _this.layerService.reRender();
122
+ });
143
123
  var rampImageData = rampColorsData ? rampColorsData : (0, _l7Utils.generateColorRamp)(rampColors);
144
124
  this.colorTexture = createTexture2D({
145
125
  data: rampImageData.data,
@@ -195,28 +175,26 @@ var ImageDataModel = /*#__PURE__*/function (_BaseModel) {
195
175
  }, {
196
176
  key: "registerBuiltinAttributes",
197
177
  value: function registerBuiltinAttributes() {
198
- // point layer size;
199
178
  this.styleAttributeService.registerStyleAttribute({
200
179
  name: 'uv',
201
180
  type: _l7Core.AttributeType.Attribute,
202
181
  descriptor: {
203
182
  name: 'a_Uv',
204
183
  buffer: {
205
- // give the WebGL driver a hint that this buffer may change
206
184
  usage: _l7Core.gl.DYNAMIC_DRAW,
207
185
  data: [],
208
186
  type: _l7Core.gl.FLOAT
209
187
  },
210
188
  size: 2,
211
- update: function update(feature, featureIdx, vertex, attributeIdx) {
189
+ update: function update(feature, featureIdx, vertex) {
212
190
  return [vertex[3], vertex[4]];
213
191
  }
214
192
  }
215
193
  });
216
194
  }
217
195
  }, {
218
- key: "updateColorTexure",
219
- value: function updateColorTexure() {
196
+ key: "updateColorTexture",
197
+ value: function updateColorTexture() {
220
198
  var createTexture2D = this.rendererService.createTexture2D;
221
199
 
222
200
  var _ref3 = this.layer.getLayerConfig(),