@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
@@ -19,7 +19,7 @@ import { GlobelPointFillTriangulation } from "../../core/triangulation";
19
19
  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 if(outer_df > antialiasblur + 0.018) discard;\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";
20
20
 
21
21
  /* babel-plugin-inline-import '../shaders/earth/fill_vert.glsl' */
22
- var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][1] = strokeOpacityAndOffset.r;\n textureOffset = strokeOpacityAndOffset.g;\n\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n\n // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // TODO: billboard\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1, 1.0);\n\n setPickingColor(a_PickingColor);\n}\n";
22
+ var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][1] = strokeOpacityAndOffset.r;\n textureOffset = strokeOpacityAndOffset.g;\n\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n\n // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1, 1.0);\n\n setPickingColor(a_PickingColor);\n}\n";
23
23
  import { mat4, vec3 } from 'gl-matrix';
24
24
 
25
25
  var FillModel = /*#__PURE__*/function (_BaseModel) {
@@ -115,7 +115,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
115
115
  } : _ref2$animateOption;
116
116
 
117
117
  return {
118
- u_aimate: this.animateOption2Array(animateOption),
118
+ u_animate: this.animateOption2Array(animateOption),
119
119
  u_time: this.layer.getLayerAnimateTime()
120
120
  };
121
121
  }
@@ -2,7 +2,7 @@ import { IModel } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class ExtrudeModel extends BaseModel {
4
4
  private raiseCount;
5
- private raiserepeat;
5
+ private raiseRepeat;
6
6
  getUninforms(): {
7
7
  u_pickLight: number;
8
8
  u_heightfixed: number;
@@ -42,7 +42,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
42
42
 
43
43
  _defineProperty(_assertThisInitialized(_this), "raiseCount", 0);
44
44
 
45
- _defineProperty(_assertThisInitialized(_this), "raiserepeat", 0);
45
+ _defineProperty(_assertThisInitialized(_this), "raiseRepeat", 0);
46
46
 
47
47
  return _this;
48
48
  }
@@ -117,18 +117,16 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
117
117
  useLinearColor = 1;
118
118
  }
119
119
 
120
- if (this.raiseCount < 1 && this.raiserepeat > 0) {
120
+ if (this.raiseCount < 1 && this.raiseRepeat > 0) {
121
121
  if (animateOption.enable) {
122
122
  var _animateOption$speed = animateOption.speed,
123
- speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed,
124
- _animateOption$repeat = animateOption.repeat,
125
- repeat = _animateOption$repeat === void 0 ? false : _animateOption$repeat;
123
+ speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed;
126
124
  this.raiseCount += speed;
127
125
 
128
126
  if (this.raiseCount >= 1) {
129
- if (this.raiserepeat > 1) {
127
+ if (this.raiseRepeat > 1) {
130
128
  this.raiseCount = 0;
131
- this.raiserepeat--;
129
+ this.raiseRepeat--;
132
130
  } else {
133
131
  this.raiseCount = 1;
134
132
  }
@@ -141,7 +139,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
141
139
  u_pickLight: Number(pickLight),
142
140
  // 圆柱体是否固定高度
143
141
  u_heightfixed: Number(heightfixed),
144
- u_r: animateOption.enable && this.raiserepeat > 0 ? this.raiseCount : 1.0,
142
+ u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
145
143
  u_dataTexture: this.dataTexture,
146
144
  // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
147
145
  u_cellTypeLayout: this.getCellTypeLayout(),
@@ -174,7 +172,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
174
172
  case 0:
175
173
  // GAODE1.x GAODE2.x MAPBOX
176
174
  _ref2 = this.layer.getLayerConfig(), _ref2$depth = _ref2.depth, depth = _ref2$depth === void 0 ? true : _ref2$depth, _ref2$animateOption$r = _ref2.animateOption.repeat, repeat = _ref2$animateOption$r === void 0 ? 1 : _ref2$animateOption$r;
177
- this.raiserepeat = repeat;
175
+ this.raiseRepeat = repeat;
178
176
  this.layer.buildLayerModel({
179
177
  moduleName: 'pointExtrude',
180
178
  vertexShader: pointExtrudeVert,
@@ -226,13 +224,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
226
224
  descriptor: {
227
225
  name: 'a_Size',
228
226
  buffer: {
229
- // give the WebGL driver a hint that this buffer may change
230
227
  usage: gl.DYNAMIC_DRAW,
231
228
  data: [],
232
229
  type: gl.FLOAT
233
230
  },
234
231
  size: 3,
235
- update: function update(feature, featureIdx, vertex, attributeIdx) {
232
+ update: function update(feature) {
236
233
  var size = feature.size;
237
234
 
238
235
  if (size) {
@@ -283,7 +280,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
283
280
  type: gl.FLOAT
284
281
  },
285
282
  size: 3,
286
- update: function update(feature, featureIdx) {
283
+ update: function update(feature) {
287
284
  var coordinates = calculateCentroid(feature.coordinates);
288
285
  return [coordinates[0], coordinates[1], 0];
289
286
  }
@@ -2,7 +2,7 @@ import { IAnimateOption, IAttribute, IElements, IModel, IModelUniform } from '@a
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class FillModel extends BaseModel {
4
4
  private meter2coord;
5
- private meteryScale;
5
+ private meterYScale;
6
6
  private isMeter;
7
7
  private unit;
8
8
  getUninforms(): IModelUniform;
@@ -19,9 +19,8 @@ import { isNumber } from 'lodash';
19
19
  import BaseModel from "../../core/BaseModel";
20
20
 
21
21
  /* babel-plugin-inline-import '../shaders/animate/wave_frag.glsl' */
22
- // import { PointFillTriangulation } from '../../core/triangulation';
23
22
  // animate pointLayer shader - support animate
24
- 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
23
+ 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
25
24
 
26
25
  /* babel-plugin-inline-import '../shaders/fill_frag.glsl' */
27
26
  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";
@@ -48,7 +47,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
48
47
 
49
48
  _defineProperty(_assertThisInitialized(_this), "meter2coord", 1);
50
49
 
51
- _defineProperty(_assertThisInitialized(_this), "meteryScale", 1);
50
+ _defineProperty(_assertThisInitialized(_this), "meterYScale", 1);
52
51
 
53
52
  _defineProperty(_assertThisInitialized(_this), "isMeter", false);
54
53
 
@@ -128,7 +127,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
128
127
  u_raisingHeight: Number(raisingHeight),
129
128
  u_heightfixed: Number(heightfixed),
130
129
  u_meter2coord: this.meter2coord,
131
- u_meteryScale: this.meteryScale,
130
+ u_meteryScale: this.meterYScale,
132
131
  u_isMeter: Number(this.isMeter),
133
132
  u_blur: blur,
134
133
  u_additive: blend === 'additive' ? 1.0 : 0.0,
@@ -152,7 +151,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
152
151
  } : _ref2$animateOption;
153
152
 
154
153
  return {
155
- u_aimate: this.animateOption2Array(animateOption),
154
+ u_animate: this.animateOption2Array(animateOption),
156
155
  u_time: this.layer.getLayerAnimateTime()
157
156
  };
158
157
  }
@@ -198,7 +197,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
198
197
  var southCoord = new mapboxContext.MercatorCoordinate(coord.x, coord.y - offsetInMercatorCoordinateUnits, coord.z);
199
198
  var southLnglat = southCoord.toLngLat();
200
199
  this.meter2coord = center[0] - westLnglat.lng;
201
- this.meteryScale = (southLnglat.lat - center[1]) / this.meter2coord;
200
+ this.meterYScale = (southLnglat.lat - center[1]) / this.meter2coord;
202
201
  return;
203
202
  }
204
203
 
@@ -344,7 +343,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
344
343
  type: gl.FLOAT
345
344
  },
346
345
  size: 1,
347
- update: function update(feature, featureIdx, vertex, attributeIdx) {
346
+ update: function update(feature) {
348
347
  var _feature$size = feature.size,
349
348
  size = _feature$size === void 0 ? 5 : _feature$size;
350
349
  return Array.isArray(size) ? [size[0]] : [size];
@@ -364,7 +363,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
364
363
  type: gl.FLOAT
365
364
  },
366
365
  size: 1,
367
- update: function update(feature, featureIdx, vertex, attributeIdx) {
366
+ update: function update(feature) {
368
367
  var _feature$shape = feature.shape,
369
368
  shape = _feature$shape === void 0 ? 2 : _feature$shape;
370
369
  var shapeIndex = shape2d.indexOf(shape);
@@ -55,8 +55,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
55
55
  mag: 'linear',
56
56
  min: 'linear mipmap nearest',
57
57
  mipmap: true
58
- }); // this.layer.render();
59
- // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
58
+ }); // 更新完纹理后在更新的图层的时候需要更新所有的图层
60
59
 
61
60
 
62
61
  _this.layerService.throttleRenderLayers();
@@ -284,7 +283,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
284
283
  type: gl.FLOAT
285
284
  },
286
285
  size: 1,
287
- update: function update(feature, featureIdx, vertex, attributeIdx) {
286
+ update: function update(feature) {
288
287
  var _feature$rotate = feature.rotate,
289
288
  rotate = _feature$rotate === void 0 ? 0 : _feature$rotate;
290
289
  return Array.isArray(rotate) ? [rotate[0]] : [rotate];
@@ -303,7 +302,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
303
302
  type: gl.FLOAT
304
303
  },
305
304
  size: 2,
306
- update: function update(feature, featureIdx, vertex, attributeIdx) {
305
+ update: function update(feature) {
307
306
  var iconMap = _this2.iconService.getIconMap();
308
307
 
309
308
  var shape = feature.shape;
@@ -351,7 +350,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
351
350
  type: gl.FLOAT
352
351
  },
353
352
  size: 1,
354
- update: function update(feature, featureIdx, vertex, attributeIdx) {
353
+ update: function update(feature) {
355
354
  var _feature$size = feature.size,
356
355
  size = _feature$size === void 0 ? 5 : _feature$size;
357
356
  return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
@@ -47,7 +47,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
47
47
  mag: 'linear',
48
48
  min: 'linear mipmap nearest',
49
49
  mipmap: true
50
- }); // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
50
+ }); // 更新完纹理后在更新的图层的时候需要更新所有的图层
51
51
 
52
52
 
53
53
  _this.layerService.throttleRenderLayers();
@@ -194,7 +194,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
194
194
  type: gl.FLOAT
195
195
  },
196
196
  size: 1,
197
- update: function update(feature, featureIdx, vertex, attributeIdx) {
197
+ update: function update(feature) {
198
198
  var _feature$size = feature.size,
199
199
  size = _feature$size === void 0 ? 5 : _feature$size;
200
200
  return Array.isArray(size) ? [size[0]] : [size];
@@ -1,4 +1,4 @@
1
- export declare type PointType = 'fillImage' | 'fill' | 'radar' | 'image' | 'normal' | 'simplePoint' | 'extrude' | 'text' | 'vectorpoint' | 'tile' | 'tileText' | 'earthFill' | 'earthExtrude';
1
+ export declare type PointType = 'fillImage' | 'fill' | 'radar' | 'image' | 'normal' | 'simplePoint' | 'extrude' | 'text' | 'vectorPoint' | 'tile' | 'tileText' | 'earthFill' | 'earthExtrude';
2
2
  declare const PointModels: {
3
3
  [key in PointType]: any;
4
4
  };
@@ -8,7 +8,7 @@ import FillImageModel from "./fillmage";
8
8
  import IMageModel from "./image";
9
9
  import NormalModel from "./normal";
10
10
  import Radar from "./radar";
11
- import SimplePopint from "./simplePoint";
11
+ import SimplePoint from "./simplePoint";
12
12
  import TextModel from "./text";
13
13
  import TileTextModel from "./tileText";
14
14
  import TileFillModel from "./tile";
@@ -18,10 +18,10 @@ var PointModels = {
18
18
  radar: Radar,
19
19
  image: IMageModel,
20
20
  normal: NormalModel,
21
- simplePoint: SimplePopint,
21
+ simplePoint: SimplePoint,
22
22
  extrude: ExtrudeModel,
23
23
  text: TextModel,
24
- vectorpoint: PointTileModel,
24
+ vectorPoint: PointTileModel,
25
25
  tile: TileFillModel,
26
26
  tileText: TileTextModel,
27
27
  earthFill: EarthFillModel,
@@ -97,14 +97,12 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
97
97
  }, {
98
98
  key: "registerBuiltinAttributes",
99
99
  value: function registerBuiltinAttributes() {
100
- // point layer size;
101
100
  this.styleAttributeService.registerStyleAttribute({
102
101
  name: 'size',
103
102
  type: AttributeType.Attribute,
104
103
  descriptor: {
105
104
  name: 'a_Size',
106
105
  buffer: {
107
- // give the WebGL driver a hint that this buffer may change
108
106
  usage: gl.DYNAMIC_DRAW,
109
107
  data: [],
110
108
  type: gl.FLOAT
@@ -74,7 +74,7 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
74
74
  } : _ref2$animateOption;
75
75
 
76
76
  return {
77
- u_aimate: this.animateOption2Array(animateOption),
77
+ u_animate: this.animateOption2Array(animateOption),
78
78
  u_time: this.layer.getLayerAnimateTime()
79
79
  };
80
80
  }
@@ -332,15 +332,13 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
332
332
  return Array.isArray(size) ? [size[0]] : [size];
333
333
  }
334
334
  }
335
- }); // point layer size;
336
-
335
+ });
337
336
  this.styleAttributeService.registerStyleAttribute({
338
337
  name: 'textUv',
339
338
  type: AttributeType.Attribute,
340
339
  descriptor: {
341
340
  name: 'a_tex',
342
341
  buffer: {
343
- // give the WebGL driver a hint that this buffer may change
344
342
  usage: gl.DYNAMIC_DRAW,
345
343
  data: [],
346
344
  type: gl.FLOAT
@@ -131,13 +131,12 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
131
131
  descriptor: {
132
132
  name: 'a_Size',
133
133
  buffer: {
134
- // give the WebGL driver a hint that this buffer may change
135
134
  usage: gl.DYNAMIC_DRAW,
136
135
  data: [],
137
136
  type: gl.FLOAT
138
137
  },
139
138
  size: 1,
140
- update: function update(feature, featureIdx, vertex, attributeIdx) {
139
+ update: function update(feature) {
141
140
  var _feature$size = feature.size,
142
141
  size = _feature$size === void 0 ? 5 : _feature$size;
143
142
  return Array.isArray(size) ? [size[0]] : [size];
@@ -156,7 +155,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
156
155
  type: gl.FLOAT
157
156
  },
158
157
  size: 1,
159
- update: function update(feature, featureIdx, vertex, attributeIdx) {
158
+ update: function update(feature) {
160
159
  var _feature$shape = feature.shape,
161
160
  shape = _feature$shape === void 0 ? 2 : _feature$shape;
162
161
 
@@ -240,7 +240,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
240
240
  type: gl.FLOAT
241
241
  },
242
242
  size: 2,
243
- update: function update(feature, featureIdx, vertex, attributeIdx) {
243
+ update: function update(feature, featureIdx, vertex) {
244
244
  return [vertex[5], vertex[6]];
245
245
  }
246
246
  }
@@ -253,13 +253,12 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
253
253
  descriptor: {
254
254
  name: 'a_Size',
255
255
  buffer: {
256
- // give the WebGL driver a hint that this buffer may change
257
256
  usage: gl.DYNAMIC_DRAW,
258
257
  data: [],
259
258
  type: gl.FLOAT
260
259
  },
261
260
  size: 1,
262
- update: function update(feature, featureIdx, vertex, attributeIdx) {
261
+ update: function update(feature) {
263
262
  var _feature$size = feature.size,
264
263
  size = _feature$size === void 0 ? 12 : _feature$size;
265
264
  return Array.isArray(size) ? [size[0]] : [size];
@@ -274,13 +273,12 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
274
273
  descriptor: {
275
274
  name: 'a_tex',
276
275
  buffer: {
277
- // give the WebGL driver a hint that this buffer may change
278
276
  usage: gl.DYNAMIC_DRAW,
279
277
  data: [],
280
278
  type: gl.FLOAT
281
279
  },
282
280
  size: 2,
283
- update: function update(feature, featureIdx, vertex, attributeIdx) {
281
+ update: function update(feature, featureIdx, vertex) {
284
282
  return [vertex[3], vertex[4]];
285
283
  }
286
284
  }
@@ -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) {
@@ -217,14 +217,13 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
217
217
  type: gl.FLOAT
218
218
  },
219
219
  size: 3,
220
- update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
220
+ update: function update(feature, featureIdx, vertex) {
221
221
  var lng = vertex[0];
222
222
  var lat = vertex[1];
223
223
  return [(lng - minLng) / lngLen, (lat - minLat) / latLen, vertex[4]];
224
224
  }
225
225
  }
226
- }); // point layer size;
227
-
226
+ });
228
227
  this.styleAttributeService.registerStyleAttribute({
229
228
  name: 'normal',
230
229
  type: AttributeType.Attribute,
@@ -248,13 +247,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
248
247
  descriptor: {
249
248
  name: 'a_Size',
250
249
  buffer: {
251
- // give the WebGL driver a hint that this buffer may change
252
250
  usage: gl.DYNAMIC_DRAW,
253
251
  data: [],
254
252
  type: gl.FLOAT
255
253
  },
256
254
  size: 1,
257
- update: function update(feature, featureIdx, vertex, attributeIdx) {
255
+ update: function update(feature) {
258
256
  var _feature$size = feature.size,
259
257
  size = _feature$size === void 0 ? 10 : _feature$size;
260
258
  return Array.isArray(size) ? [size[0]] : [size];
@@ -17,5 +17,5 @@ export default class RasterModel extends BaseModel {
17
17
  buildModels(callbackModel: (models: IModel[]) => void): void;
18
18
  clearModels(): void;
19
19
  protected registerBuiltinAttributes(): void;
20
- private updateColorTexure;
20
+ private updateColorTexture;
21
21
  }
@@ -48,7 +48,7 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
48
48
  rampColors = _ref.rampColors;
49
49
 
50
50
  if (!isEqual(this.rampColors, rampColors)) {
51
- this.updateColorTexure();
51
+ this.updateColorTexture();
52
52
  this.rampColors = rampColors;
53
53
  }
54
54
 
@@ -145,8 +145,8 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
145
145
  });
146
146
  }
147
147
  }, {
148
- key: "updateColorTexure",
149
- value: function updateColorTexure() {
148
+ key: "updateColorTexture",
149
+ value: function updateColorTexture() {
150
150
  var createTexture2D = this.rendererService.createTexture2D;
151
151
 
152
152
  var _ref3 = this.layer.getLayerConfig(),
@@ -175,10 +175,19 @@ export var TileLayerManager = /*#__PURE__*/function () {
175
175
 
176
176
  var parentParserType = source.getParserType();
177
177
  var layerShape = getLayerShape(this.parent.type, this.parent);
178
+ var colorTexture = undefined;
178
179
 
179
180
  if (rampColors) {
180
181
  // 构建统一的色带贴图
182
+ var createTexture2D = this.rendererService.createTexture2D;
181
183
  this.rampColorsData = generateColorRamp(rampColors);
184
+ var imageData = generateColorRamp(rampColors);
185
+ colorTexture = createTexture2D({
186
+ data: this.rampColorsData.data,
187
+ width: imageData.width,
188
+ height: imageData.height,
189
+ flipY: false
190
+ });
182
191
  }
183
192
 
184
193
  this.initOptions = {
@@ -202,6 +211,7 @@ export var TileLayerManager = /*#__PURE__*/function () {
202
211
  domain: domain,
203
212
  rampColors: rampColors,
204
213
  rampColorsData: this.rampColorsData,
214
+ colorTexture: colorTexture,
205
215
  // worker
206
216
  workerEnabled: workerEnabled,
207
217
  pixelConstant: pixelConstant,
@@ -206,7 +206,6 @@ var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
206
206
  descriptor: {
207
207
  name: 'a_Extrude',
208
208
  buffer: {
209
- // give the WebGL driver a hint that this buffer may change
210
209
  usage: _l7Core.gl.DYNAMIC_DRAW,
211
210
  data: [],
212
211
  type: _l7Core.gl.FLOAT
@@ -218,21 +217,19 @@ var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
218
217
  return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
219
218
  }
220
219
  }
221
- }); // point layer size;
222
-
220
+ });
223
221
  this.styleAttributeService.registerStyleAttribute({
224
222
  name: 'uv',
225
223
  type: _l7Core.AttributeType.Attribute,
226
224
  descriptor: {
227
225
  name: 'a_Uv',
228
226
  buffer: {
229
- // give the WebGL driver a hint that this buffer may change
230
227
  usage: _l7Core.gl.DYNAMIC_DRAW,
231
228
  data: [],
232
229
  type: _l7Core.gl.FLOAT
233
230
  },
234
231
  size: 2,
235
- update: function update(feature, featureIdx, vertex, attributeIdx) {
232
+ update: function update(feature, featureIdx, vertex) {
236
233
  return [vertex[2], vertex[3]];
237
234
  }
238
235
  }
@@ -316,10 +316,10 @@ var PlaneModel = /*#__PURE__*/function (_BaseModel) {
316
316
  var gridX1 = gridX + 1;
317
317
  var gridY1 = gridY + 1;
318
318
  var widthStep = imgWidth / gridX;
319
- var heihgtStep = imgHeight / gridY;
319
+ var heightStep = imgHeight / gridY;
320
320
 
321
321
  for (var iy = 0; iy < gridY1; iy++) {
322
- var imgIndexY = Math.floor(iy * heihgtStep);
322
+ var imgIndexY = Math.floor(iy * heightStep);
323
323
  var imgLen = imgIndexY * imgWidth;
324
324
 
325
325
  for (var ix = 0; ix < gridX1; ix++) {
@@ -421,7 +421,7 @@ var PlaneModel = /*#__PURE__*/function (_BaseModel) {
421
421
  type: _l7Core.gl.FLOAT
422
422
  },
423
423
  size: 2,
424
- update: function update(feature, featureIdx, vertex, attributeIdx) {
424
+ update: function update(feature, featureIdx, vertex) {
425
425
  return [vertex[3], vertex[4]];
426
426
  }
427
427
  }
@@ -67,8 +67,7 @@ var SpriteModel = /*#__PURE__*/function (_BaseModel) {
67
67
  _ref$spriteBottom = _ref.spriteBottom,
68
68
  spriteBottom = _ref$spriteBottom === void 0 ? -100000 : _ref$spriteBottom;
69
69
 
70
- var updateZ = _this.spriteUpdate; // const bottomZ = -100000;
71
-
70
+ var updateZ = _this.spriteUpdate;
72
71
  var bottomZ = spriteBottom;
73
72
  var topZ = _this.spriteTop;
74
73
 
@@ -96,7 +95,7 @@ var SpriteModel = /*#__PURE__*/function (_BaseModel) {
96
95
  });
97
96
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateModel", function () {
98
97
  // @ts-ignore
99
- var attributes = _this.layer.createAttrubutes({
98
+ var attributes = _this.layer.createAttributes({
100
99
  triangulation: _this.planeGeometryUpdateTriangulation
101
100
  });
102
101