@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
@@ -42,9 +42,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
42
42
  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; } }
43
43
 
44
44
  /* babel-plugin-inline-import '../shaders/animate/wave_frag.glsl' */
45
- // import { PointFillTriangulation } from '../../core/triangulation';
46
45
  // animate pointLayer shader - support animate
47
- var waveFillFrag = "\nuniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_aimate: [ 1., 2., 1.0, 0.2 ];\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n \n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_aimate.z - u_aimate.y * u_time)), 0.0, 1.0);\n \n // \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C\n if(u_additive > 0.0) {\n gl_FragColor *= intensity;\n // \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C \n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n"; // static pointLayer shader - not support animate
46
+ var waveFillFrag = "\nuniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nuniform float u_time;\nuniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n \n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n float PI = 3.14159;\n float N_RINGS = 3.0;\n float FREQ = 1.0;\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n\n float d = length(v_data.xy);\n if(d > 0.5) {\n discard;\n }\n float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);\n \n // \u6839\u636E\u53E0\u52A0\u6A21\u5F0F\u9009\u62E9\u6548\u679C\n if(u_additive > 0.0) {\n gl_FragColor *= intensity;\n // \u4F18\u5316\u6C34\u6CE2\u70B9 blend additive \u6A21\u5F0F\u4E0B\u6709\u7684\u62FE\u53D6\u6548\u679C \n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor = vec4(gl_FragColor.xyz, gl_FragColor.a * intensity);\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n"; // static pointLayer shader - not support animate
48
47
 
49
48
  /* babel-plugin-inline-import '../shaders/fill_frag.glsl' */
50
49
  var pointFillFrag = "uniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n float stroke_opacity = styleMappingMat[0][1];\n float strokeWidth = styleMappingMat[0][2];\n vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + strokeWidth);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(strokeWidth < 0.01) {\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n } else {\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor.a *= opacity_t;\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
@@ -68,7 +67,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
68
67
 
69
68
  _this = _super.call.apply(_super, [this].concat(args));
70
69
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meter2coord", 1);
71
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meteryScale", 1);
70
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meterYScale", 1);
72
71
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isMeter", false);
73
72
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unit", 'l7size');
74
73
  return _this;
@@ -145,7 +144,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
145
144
  u_raisingHeight: Number(raisingHeight),
146
145
  u_heightfixed: Number(heightfixed),
147
146
  u_meter2coord: this.meter2coord,
148
- u_meteryScale: this.meteryScale,
147
+ u_meteryScale: this.meterYScale,
149
148
  u_isMeter: Number(this.isMeter),
150
149
  u_blur: blur,
151
150
  u_additive: blend === 'additive' ? 1.0 : 0.0,
@@ -169,7 +168,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
169
168
  } : _ref2$animateOption;
170
169
 
171
170
  return {
172
- u_aimate: this.animateOption2Array(animateOption),
171
+ u_animate: this.animateOption2Array(animateOption),
173
172
  u_time: this.layer.getLayerAnimateTime()
174
173
  };
175
174
  }
@@ -215,7 +214,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
215
214
  var southCoord = new mapboxContext.MercatorCoordinate(coord.x, coord.y - offsetInMercatorCoordinateUnits, coord.z);
216
215
  var southLnglat = southCoord.toLngLat();
217
216
  this.meter2coord = center[0] - westLnglat.lng;
218
- this.meteryScale = (southLnglat.lat - center[1]) / this.meter2coord;
217
+ this.meterYScale = (southLnglat.lat - center[1]) / this.meter2coord;
219
218
  return;
220
219
  }
221
220
 
@@ -361,7 +360,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
361
360
  type: _l7Core.gl.FLOAT
362
361
  },
363
362
  size: 1,
364
- update: function update(feature, featureIdx, vertex, attributeIdx) {
363
+ update: function update(feature) {
365
364
  var _feature$size = feature.size,
366
365
  size = _feature$size === void 0 ? 5 : _feature$size;
367
366
  return Array.isArray(size) ? [size[0]] : [size];
@@ -381,7 +380,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
381
380
  type: _l7Core.gl.FLOAT
382
381
  },
383
382
  size: 1,
384
- update: function update(feature, featureIdx, vertex, attributeIdx) {
383
+ update: function update(feature) {
385
384
  var _feature$shape = feature.shape,
386
385
  shape = _feature$shape === void 0 ? 2 : _feature$shape;
387
386
  var shapeIndex = shape2d.indexOf(shape);
@@ -73,8 +73,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
73
73
  mag: 'linear',
74
74
  min: 'linear mipmap nearest',
75
75
  mipmap: true
76
- }); // this.layer.render();
77
- // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
76
+ }); // 更新完纹理后在更新的图层的时候需要更新所有的图层
78
77
 
79
78
 
80
79
  _this.layerService.throttleRenderLayers();
@@ -301,7 +300,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
301
300
  type: _l7Core.gl.FLOAT
302
301
  },
303
302
  size: 1,
304
- update: function update(feature, featureIdx, vertex, attributeIdx) {
303
+ update: function update(feature) {
305
304
  var _feature$rotate = feature.rotate,
306
305
  rotate = _feature$rotate === void 0 ? 0 : _feature$rotate;
307
306
  return Array.isArray(rotate) ? [rotate[0]] : [rotate];
@@ -320,7 +319,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
320
319
  type: _l7Core.gl.FLOAT
321
320
  },
322
321
  size: 2,
323
- update: function update(feature, featureIdx, vertex, attributeIdx) {
322
+ update: function update(feature) {
324
323
  var iconMap = _this2.iconService.getIconMap();
325
324
 
326
325
  var shape = feature.shape;
@@ -368,7 +367,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
368
367
  type: _l7Core.gl.FLOAT
369
368
  },
370
369
  size: 1,
371
- update: function update(feature, featureIdx, vertex, attributeIdx) {
370
+ update: function update(feature) {
372
371
  var _feature$size = feature.size,
373
372
  size = _feature$size === void 0 ? 5 : _feature$size;
374
373
  return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
@@ -65,7 +65,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
65
65
  mag: 'linear',
66
66
  min: 'linear mipmap nearest',
67
67
  mipmap: true
68
- }); // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
68
+ }); // 更新完纹理后在更新的图层的时候需要更新所有的图层
69
69
 
70
70
 
71
71
  _this.layerService.throttleRenderLayers();
@@ -211,7 +211,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
211
211
  type: _l7Core.gl.FLOAT
212
212
  },
213
213
  size: 1,
214
- update: function update(feature, featureIdx, vertex, attributeIdx) {
214
+ update: function update(feature) {
215
215
  var _feature$size = feature.size,
216
216
  size = _feature$size === void 0 ? 5 : _feature$size;
217
217
  return Array.isArray(size) ? [size[0]] : [size];
@@ -43,7 +43,7 @@ var PointModels = {
43
43
  simplePoint: _simplePoint.default,
44
44
  extrude: _extrude.default,
45
45
  text: _text.default,
46
- vectorpoint: _tileModel.default,
46
+ vectorPoint: _tileModel.default,
47
47
  tile: _tile.default,
48
48
  tileText: _tileText.default,
49
49
  earthFill: _earthFill.default,
@@ -115,14 +115,12 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
115
115
  }, {
116
116
  key: "registerBuiltinAttributes",
117
117
  value: function registerBuiltinAttributes() {
118
- // point layer size;
119
118
  this.styleAttributeService.registerStyleAttribute({
120
119
  name: 'size',
121
120
  type: _l7Core.AttributeType.Attribute,
122
121
  descriptor: {
123
122
  name: 'a_Size',
124
123
  buffer: {
125
- // give the WebGL driver a hint that this buffer may change
126
124
  usage: _l7Core.gl.DYNAMIC_DRAW,
127
125
  data: [],
128
126
  type: _l7Core.gl.FLOAT
@@ -92,7 +92,7 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
92
92
  } : _ref2$animateOption;
93
93
 
94
94
  return {
95
- u_aimate: this.animateOption2Array(animateOption),
95
+ u_animate: this.animateOption2Array(animateOption),
96
96
  u_time: this.layer.getLayerAnimateTime()
97
97
  };
98
98
  }
@@ -348,15 +348,13 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
348
348
  return Array.isArray(size) ? [size[0]] : [size];
349
349
  }
350
350
  }
351
- }); // point layer size;
352
-
351
+ });
353
352
  this.styleAttributeService.registerStyleAttribute({
354
353
  name: 'textUv',
355
354
  type: _l7Core.AttributeType.Attribute,
356
355
  descriptor: {
357
356
  name: 'a_tex',
358
357
  buffer: {
359
- // give the WebGL driver a hint that this buffer may change
360
358
  usage: _l7Core.gl.DYNAMIC_DRAW,
361
359
  data: [],
362
360
  type: _l7Core.gl.FLOAT
@@ -146,13 +146,12 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
146
146
  descriptor: {
147
147
  name: 'a_Size',
148
148
  buffer: {
149
- // give the WebGL driver a hint that this buffer may change
150
149
  usage: _l7Core.gl.DYNAMIC_DRAW,
151
150
  data: [],
152
151
  type: _l7Core.gl.FLOAT
153
152
  },
154
153
  size: 1,
155
- update: function update(feature, featureIdx, vertex, attributeIdx) {
154
+ update: function update(feature) {
156
155
  var _feature$size = feature.size,
157
156
  size = _feature$size === void 0 ? 5 : _feature$size;
158
157
  return Array.isArray(size) ? [size[0]] : [size];
@@ -171,7 +170,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
171
170
  type: _l7Core.gl.FLOAT
172
171
  },
173
172
  size: 1,
174
- update: function update(feature, featureIdx, vertex, attributeIdx) {
173
+ update: function update(feature) {
175
174
  var _feature$shape = feature.shape,
176
175
  shape = _feature$shape === void 0 ? 2 : _feature$shape;
177
176
 
@@ -256,7 +256,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
256
256
  type: _l7Core.gl.FLOAT
257
257
  },
258
258
  size: 2,
259
- update: function update(feature, featureIdx, vertex, attributeIdx) {
259
+ update: function update(feature, featureIdx, vertex) {
260
260
  return [vertex[5], vertex[6]];
261
261
  }
262
262
  }
@@ -269,13 +269,12 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
269
269
  descriptor: {
270
270
  name: 'a_Size',
271
271
  buffer: {
272
- // give the WebGL driver a hint that this buffer may change
273
272
  usage: _l7Core.gl.DYNAMIC_DRAW,
274
273
  data: [],
275
274
  type: _l7Core.gl.FLOAT
276
275
  },
277
276
  size: 1,
278
- update: function update(feature, featureIdx, vertex, attributeIdx) {
277
+ update: function update(feature) {
279
278
  var _feature$size = feature.size,
280
279
  size = _feature$size === void 0 ? 12 : _feature$size;
281
280
  return Array.isArray(size) ? [size[0]] : [size];
@@ -290,13 +289,12 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
290
289
  descriptor: {
291
290
  name: 'a_tex',
292
291
  buffer: {
293
- // give the WebGL driver a hint that this buffer may change
294
292
  usage: _l7Core.gl.DYNAMIC_DRAW,
295
293
  data: [],
296
294
  type: _l7Core.gl.FLOAT
297
295
  },
298
296
  size: 2,
299
- update: function update(feature, featureIdx, vertex, attributeIdx) {
297
+ update: function update(feature, featureIdx, vertex) {
300
298
  return [vertex[3], vertex[4]];
301
299
  }
302
300
  }
@@ -7,7 +7,7 @@ varying vec4 v_data;
7
7
  varying vec4 v_color;
8
8
  varying float v_radius;
9
9
  uniform float u_time;
10
- uniform vec4 u_aimate: [ 1., 2., 1.0, 0.2 ];
10
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
11
11
 
12
12
  #pragma include "sdf_2d"
13
13
  #pragma include "picking"
@@ -51,7 +51,7 @@ void main() {
51
51
  if(d > 0.5) {
52
52
  discard;
53
53
  }
54
- float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_aimate.z - u_aimate.y * u_time)), 0.0, 1.0);
54
+ float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);
55
55
 
56
56
  // 根据叠加模式选择效果
57
57
  if(u_additive > 0.0) {
@@ -234,14 +234,13 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
234
234
  type: _l7Core.gl.FLOAT
235
235
  },
236
236
  size: 3,
237
- update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
237
+ update: function update(feature, featureIdx, vertex) {
238
238
  var lng = vertex[0];
239
239
  var lat = vertex[1];
240
240
  return [(lng - minLng) / lngLen, (lat - minLat) / latLen, vertex[4]];
241
241
  }
242
242
  }
243
- }); // point layer size;
244
-
243
+ });
245
244
  this.styleAttributeService.registerStyleAttribute({
246
245
  name: 'normal',
247
246
  type: _l7Core.AttributeType.Attribute,
@@ -265,13 +264,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
265
264
  descriptor: {
266
265
  name: 'a_Size',
267
266
  buffer: {
268
- // give the WebGL driver a hint that this buffer may change
269
267
  usage: _l7Core.gl.DYNAMIC_DRAW,
270
268
  data: [],
271
269
  type: _l7Core.gl.FLOAT
272
270
  },
273
271
  size: 1,
274
- update: function update(feature, featureIdx, vertex, attributeIdx) {
272
+ update: function update(feature) {
275
273
  var _feature$size = feature.size,
276
274
  size = _feature$size === void 0 ? 10 : _feature$size;
277
275
  return Array.isArray(size) ? [size[0]] : [size];
@@ -64,7 +64,7 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
64
64
  rampColors = _ref.rampColors;
65
65
 
66
66
  if (!(0, _lodash.isEqual)(this.rampColors, rampColors)) {
67
- this.updateColorTexure();
67
+ this.updateColorTexture();
68
68
  this.rampColors = rampColors;
69
69
  }
70
70
 
@@ -161,8 +161,8 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
161
161
  });
162
162
  }
163
163
  }, {
164
- key: "updateColorTexure",
165
- value: function updateColorTexure() {
164
+ key: "updateColorTexture",
165
+ value: function updateColorTexture() {
166
166
  var createTexture2D = this.rendererService.createTexture2D;
167
167
 
168
168
  var _ref3 = this.layer.getLayerConfig(),
@@ -192,10 +192,19 @@ var TileLayerManager = /*#__PURE__*/function () {
192
192
 
193
193
  var parentParserType = source.getParserType();
194
194
  var layerShape = (0, _utils.getLayerShape)(this.parent.type, this.parent);
195
+ var colorTexture = undefined;
195
196
 
196
197
  if (rampColors) {
197
198
  // 构建统一的色带贴图
199
+ var createTexture2D = this.rendererService.createTexture2D;
198
200
  this.rampColorsData = (0, _l7Utils.generateColorRamp)(rampColors);
201
+ var imageData = (0, _l7Utils.generateColorRamp)(rampColors);
202
+ colorTexture = createTexture2D({
203
+ data: this.rampColorsData.data,
204
+ width: imageData.width,
205
+ height: imageData.height,
206
+ flipY: false
207
+ });
199
208
  }
200
209
 
201
210
  this.initOptions = {
@@ -219,6 +228,7 @@ var TileLayerManager = /*#__PURE__*/function () {
219
228
  domain: domain,
220
229
  rampColors: rampColors,
221
230
  rampColorsData: this.rampColorsData,
231
+ colorTexture: colorTexture,
222
232
  // worker
223
233
  workerEnabled: workerEnabled,
224
234
  pixelConstant: pixelConstant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-layers",
3
- "version": "2.9.27-alpha.3",
3
+ "version": "2.9.27-alpha.4",
4
4
  "description": "L7's collection of built-in layers",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -27,10 +27,10 @@
27
27
  "license": "ISC",
28
28
  "dependencies": {
29
29
  "@antv/async-hook": "^2.2.2",
30
- "@antv/l7-core": "2.9.27-alpha.3",
31
- "@antv/l7-maps": "2.9.27-alpha.3",
32
- "@antv/l7-source": "2.9.27-alpha.3",
33
- "@antv/l7-utils": "2.9.27-alpha.3",
30
+ "@antv/l7-core": "2.9.27-alpha.4",
31
+ "@antv/l7-maps": "2.9.27-alpha.4",
32
+ "@antv/l7-source": "2.9.27-alpha.4",
33
+ "@antv/l7-utils": "2.9.27-alpha.4",
34
34
  "@babel/runtime": "^7.7.7",
35
35
  "@mapbox/martini": "^0.2.0",
36
36
  "@turf/clone": "^6.5.0",
@@ -61,7 +61,7 @@
61
61
  "@types/gl-matrix": "^2.4.5",
62
62
  "@types/lodash": "^4.14.138"
63
63
  },
64
- "gitHead": "395ceeac3d64e838604f6acf8a84668488762ee3",
64
+ "gitHead": "9e77012376360246d49d7b5392eecd16b43b9109",
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  }