@antv/l7-layers 2.21.10 → 2.21.11-beta.1

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 (287) hide show
  1. package/es/citybuliding/models/build.d.ts +16 -0
  2. package/es/citybuliding/models/build.js +18 -20
  3. package/es/citybuliding/shaders/build_frag.glsl +6 -6
  4. package/es/citybuliding/shaders/build_vert.glsl +8 -14
  5. package/es/core/BaseLayer.d.ts +0 -1
  6. package/es/core/BaseLayer.js +9 -19
  7. package/es/core/BaseModel.d.ts +15 -2
  8. package/es/core/BaseModel.js +98 -64
  9. package/es/core/CommonStyleAttribute.d.ts +14 -18
  10. package/es/core/CommonStyleAttribute.js +23 -67
  11. package/es/core/shape/extrude.js +6 -3
  12. package/es/core/triangulation.js +22 -50
  13. package/es/core/utils.d.ts +4 -0
  14. package/es/core/utils.js +33 -0
  15. package/es/earth/models/atmosphere.d.ts +15 -0
  16. package/es/earth/models/atmosphere.js +30 -24
  17. package/es/earth/models/base.d.ts +15 -0
  18. package/es/earth/models/base.js +30 -24
  19. package/es/earth/models/bloomsphere.d.ts +15 -0
  20. package/es/earth/models/bloomsphere.js +30 -24
  21. package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +7 -5
  22. package/es/earth/shaders/base/base_vert.glsl +3 -3
  23. package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +5 -4
  24. package/es/geometry/models/billboard.d.ts +15 -0
  25. package/es/geometry/models/billboard.js +14 -8
  26. package/es/geometry/models/plane.d.ts +14 -0
  27. package/es/geometry/models/plane.js +10 -10
  28. package/es/geometry/models/sprite.js +3 -9
  29. package/es/geometry/shaders/billboard_vert.glsl +28 -25
  30. package/es/geometry/shaders/plane_vert.glsl +6 -6
  31. package/es/geometry/shaders/sprite_vert.glsl +7 -9
  32. package/es/heatmap/models/grid.d.ts +14 -0
  33. package/es/heatmap/models/grid.js +10 -3
  34. package/es/heatmap/models/grid3d.d.ts +16 -0
  35. package/es/heatmap/models/grid3d.js +14 -6
  36. package/es/heatmap/models/heatmap.d.ts +20 -1
  37. package/es/heatmap/models/heatmap.js +96 -83
  38. package/es/heatmap/models/hexagon.d.ts +14 -0
  39. package/es/heatmap/models/hexagon.js +9 -3
  40. package/es/heatmap/shaders/grid/grid_vert.glsl +30 -42
  41. package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +14 -26
  42. package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +19 -16
  43. package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +16 -22
  44. package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -4
  45. package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +13 -23
  46. package/es/image/models/image.d.ts +14 -0
  47. package/es/image/models/image.js +11 -7
  48. package/es/image/shaders/image_vert.glsl +7 -6
  49. package/es/line/models/arc.d.ts +18 -0
  50. package/es/line/models/arc.js +57 -8
  51. package/es/line/models/arc_3d.d.ts +18 -0
  52. package/es/line/models/arc_3d.js +55 -7
  53. package/es/line/models/flow.d.ts +17 -0
  54. package/es/line/models/flow.js +35 -7
  55. package/es/line/models/great_circle.d.ts +17 -0
  56. package/es/line/models/great_circle.js +34 -6
  57. package/es/line/models/line.d.ts +17 -0
  58. package/es/line/models/line.js +17 -8
  59. package/es/line/models/simple_line.d.ts +14 -0
  60. package/es/line/models/simple_line.js +12 -47
  61. package/es/line/models/wall.d.ts +17 -0
  62. package/es/line/models/wall.js +22 -48
  63. package/es/line/shaders/arc/line_arc_vert.glsl +44 -52
  64. package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +15 -20
  65. package/es/line/shaders/flow/flow_line_vert.glsl +30 -48
  66. package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +53 -74
  67. package/es/line/shaders/line/line_vert.glsl +31 -48
  68. package/es/line/shaders/simple/simpleline_vert.glsl +18 -23
  69. package/es/line/shaders/wall/wall_vert.glsl +36 -45
  70. package/es/mask/models/fill.js +2 -1
  71. package/es/mask/shaders/mask_vert.glsl +2 -7
  72. package/es/plugins/DataMappingPlugin.d.ts +0 -1
  73. package/es/plugins/DataMappingPlugin.js +1 -24
  74. package/es/plugins/PixelPickingPlugin.js +2 -2
  75. package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -1
  76. package/es/plugins/RegisterStyleAttributePlugin.js +3 -25
  77. package/es/plugins/ShaderUniformPlugin.d.ts +0 -5
  78. package/es/plugins/ShaderUniformPlugin.js +4 -35
  79. package/es/point/models/billboard_point.d.ts +14 -0
  80. package/es/point/models/billboard_point.js +11 -3
  81. package/es/point/models/earthExtrude.d.ts +16 -0
  82. package/es/point/models/earthExtrude.js +15 -8
  83. package/es/point/models/earthFill.d.ts +16 -0
  84. package/es/point/models/earthFill.js +13 -5
  85. package/es/point/models/extrude.d.ts +16 -0
  86. package/es/point/models/extrude.js +19 -12
  87. package/es/point/models/fill.d.ts +16 -0
  88. package/es/point/models/fill.js +16 -5
  89. package/es/point/models/fillImage.d.ts +16 -0
  90. package/es/point/models/fillImage.js +16 -16
  91. package/es/point/models/image.d.ts +15 -0
  92. package/es/point/models/image.js +14 -4
  93. package/es/point/models/normal.d.ts +14 -0
  94. package/es/point/models/normal.js +11 -3
  95. package/es/point/models/radar.d.ts +15 -0
  96. package/es/point/models/radar.js +13 -4
  97. package/es/point/models/text.d.ts +16 -0
  98. package/es/point/models/text.js +18 -11
  99. package/es/point/shaders/billboard/billboard_point_vert.glsl +10 -13
  100. package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +15 -25
  101. package/es/point/shaders/earthFill/earthFill_vert.glsl +6 -6
  102. package/es/point/shaders/extrude/extrude_vert.glsl +35 -39
  103. package/es/point/shaders/fill/fill_vert.glsl +12 -14
  104. package/es/point/shaders/fillImage/fillImage_vert.glsl +16 -28
  105. package/es/point/shaders/image/image_vert.glsl +15 -12
  106. package/es/point/shaders/normal/normal_vert.glsl +7 -10
  107. package/es/point/shaders/radar/radar_vert.glsl +11 -11
  108. package/es/point/shaders/text/text_vert.glsl +10 -9
  109. package/es/polygon/models/extrude.d.ts +16 -0
  110. package/es/polygon/models/extrude.js +26 -26
  111. package/es/polygon/models/extrusion.d.ts +16 -0
  112. package/es/polygon/models/extrusion.js +34 -4
  113. package/es/polygon/models/fill.d.ts +14 -0
  114. package/es/polygon/models/fill.js +12 -4
  115. package/es/polygon/models/ocean.d.ts +14 -0
  116. package/es/polygon/models/ocean.js +11 -6
  117. package/es/polygon/models/water.d.ts +14 -0
  118. package/es/polygon/models/water.js +11 -6
  119. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +17 -15
  120. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +22 -20
  121. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +17 -17
  122. package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +8 -8
  123. package/es/polygon/shaders/fill/fill_linear_vert.glsl +7 -6
  124. package/es/polygon/shaders/fill/fill_vert.glsl +10 -12
  125. package/es/polygon/shaders/ocean/ocean_vert.glsl +3 -4
  126. package/es/polygon/shaders/water/polygon_water_vert.glsl +5 -5
  127. package/es/raster/index.d.ts +1 -1
  128. package/es/raster/index.js +1 -1
  129. package/es/raster/models/raster.d.ts +14 -0
  130. package/es/raster/models/raster.js +13 -3
  131. package/es/raster/models/rasterRgb.d.ts +14 -0
  132. package/es/raster/models/rasterRgb.js +12 -3
  133. package/es/raster/models/rasterTerrainRgb.d.ts +14 -0
  134. package/es/raster/models/rasterTerrainRgb.js +11 -3
  135. package/es/raster/shaders/raster/raster_2d_vert.glsl +6 -6
  136. package/es/raster/shaders/rgb/raster_rgb_vert.glsl +11 -11
  137. package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +11 -11
  138. package/es/tile/core/BaseLayer.js +0 -16
  139. package/es/utils/extrude_polyline.d.ts +0 -15
  140. package/es/utils/extrude_polyline.js +0 -217
  141. package/es/wind/models/wind.d.ts +14 -0
  142. package/es/wind/models/wind.js +9 -1
  143. package/es/wind/shaders/wind_vert.glsl +6 -5
  144. package/lib/citybuliding/models/build.d.ts +16 -0
  145. package/lib/citybuliding/models/build.js +18 -20
  146. package/lib/citybuliding/shaders/build_frag.glsl +6 -6
  147. package/lib/citybuliding/shaders/build_vert.glsl +8 -14
  148. package/lib/core/BaseLayer.d.ts +0 -1
  149. package/lib/core/BaseLayer.js +9 -19
  150. package/lib/core/BaseModel.d.ts +15 -2
  151. package/lib/core/BaseModel.js +96 -62
  152. package/lib/core/CommonStyleAttribute.d.ts +14 -18
  153. package/lib/core/CommonStyleAttribute.js +23 -68
  154. package/lib/core/shape/extrude.js +6 -3
  155. package/lib/core/triangulation.js +22 -50
  156. package/lib/core/utils.d.ts +4 -0
  157. package/lib/core/utils.js +35 -0
  158. package/lib/earth/models/atmosphere.d.ts +15 -0
  159. package/lib/earth/models/atmosphere.js +30 -24
  160. package/lib/earth/models/base.d.ts +15 -0
  161. package/lib/earth/models/base.js +30 -24
  162. package/lib/earth/models/bloomsphere.d.ts +15 -0
  163. package/lib/earth/models/bloomsphere.js +30 -24
  164. package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +7 -5
  165. package/lib/earth/shaders/base/base_vert.glsl +3 -3
  166. package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +5 -4
  167. package/lib/geometry/models/billboard.d.ts +15 -0
  168. package/lib/geometry/models/billboard.js +14 -8
  169. package/lib/geometry/models/plane.d.ts +14 -0
  170. package/lib/geometry/models/plane.js +10 -10
  171. package/lib/geometry/models/sprite.js +3 -9
  172. package/lib/geometry/shaders/billboard_vert.glsl +28 -25
  173. package/lib/geometry/shaders/plane_vert.glsl +6 -6
  174. package/lib/geometry/shaders/sprite_vert.glsl +7 -9
  175. package/lib/heatmap/models/grid.d.ts +14 -0
  176. package/lib/heatmap/models/grid.js +10 -3
  177. package/lib/heatmap/models/grid3d.d.ts +16 -0
  178. package/lib/heatmap/models/grid3d.js +14 -6
  179. package/lib/heatmap/models/heatmap.d.ts +20 -1
  180. package/lib/heatmap/models/heatmap.js +95 -82
  181. package/lib/heatmap/models/hexagon.d.ts +14 -0
  182. package/lib/heatmap/models/hexagon.js +9 -3
  183. package/lib/heatmap/shaders/grid/grid_vert.glsl +30 -42
  184. package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +14 -26
  185. package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +19 -16
  186. package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +16 -22
  187. package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -4
  188. package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +13 -23
  189. package/lib/image/models/image.d.ts +14 -0
  190. package/lib/image/models/image.js +11 -7
  191. package/lib/image/shaders/image_vert.glsl +7 -6
  192. package/lib/line/models/arc.d.ts +18 -0
  193. package/lib/line/models/arc.js +56 -7
  194. package/lib/line/models/arc_3d.d.ts +18 -0
  195. package/lib/line/models/arc_3d.js +55 -7
  196. package/lib/line/models/flow.d.ts +17 -0
  197. package/lib/line/models/flow.js +35 -7
  198. package/lib/line/models/great_circle.d.ts +17 -0
  199. package/lib/line/models/great_circle.js +33 -5
  200. package/lib/line/models/line.d.ts +17 -0
  201. package/lib/line/models/line.js +17 -8
  202. package/lib/line/models/simple_line.d.ts +14 -0
  203. package/lib/line/models/simple_line.js +12 -47
  204. package/lib/line/models/wall.d.ts +17 -0
  205. package/lib/line/models/wall.js +22 -48
  206. package/lib/line/shaders/arc/line_arc_vert.glsl +44 -52
  207. package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +15 -20
  208. package/lib/line/shaders/flow/flow_line_vert.glsl +30 -48
  209. package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +53 -74
  210. package/lib/line/shaders/line/line_vert.glsl +31 -48
  211. package/lib/line/shaders/simple/simpleline_vert.glsl +18 -23
  212. package/lib/line/shaders/wall/wall_vert.glsl +36 -45
  213. package/lib/mask/models/fill.js +2 -1
  214. package/lib/mask/shaders/mask_vert.glsl +2 -7
  215. package/lib/plugins/DataMappingPlugin.d.ts +0 -1
  216. package/lib/plugins/DataMappingPlugin.js +0 -23
  217. package/lib/plugins/PixelPickingPlugin.js +1 -1
  218. package/lib/plugins/RegisterStyleAttributePlugin.d.ts +0 -1
  219. package/lib/plugins/RegisterStyleAttributePlugin.js +2 -24
  220. package/lib/plugins/ShaderUniformPlugin.d.ts +0 -5
  221. package/lib/plugins/ShaderUniformPlugin.js +4 -35
  222. package/lib/point/models/billboard_point.d.ts +14 -0
  223. package/lib/point/models/billboard_point.js +11 -3
  224. package/lib/point/models/earthExtrude.d.ts +16 -0
  225. package/lib/point/models/earthExtrude.js +14 -7
  226. package/lib/point/models/earthFill.d.ts +16 -0
  227. package/lib/point/models/earthFill.js +13 -5
  228. package/lib/point/models/extrude.d.ts +16 -0
  229. package/lib/point/models/extrude.js +18 -11
  230. package/lib/point/models/fill.d.ts +16 -0
  231. package/lib/point/models/fill.js +16 -5
  232. package/lib/point/models/fillImage.d.ts +16 -0
  233. package/lib/point/models/fillImage.js +16 -16
  234. package/lib/point/models/image.d.ts +15 -0
  235. package/lib/point/models/image.js +14 -4
  236. package/lib/point/models/normal.d.ts +14 -0
  237. package/lib/point/models/normal.js +11 -3
  238. package/lib/point/models/radar.d.ts +15 -0
  239. package/lib/point/models/radar.js +13 -4
  240. package/lib/point/models/text.d.ts +16 -0
  241. package/lib/point/models/text.js +18 -11
  242. package/lib/point/shaders/billboard/billboard_point_vert.glsl +10 -13
  243. package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +15 -25
  244. package/lib/point/shaders/earthFill/earthFill_vert.glsl +6 -6
  245. package/lib/point/shaders/extrude/extrude_vert.glsl +35 -39
  246. package/lib/point/shaders/fill/fill_vert.glsl +12 -14
  247. package/lib/point/shaders/fillImage/fillImage_vert.glsl +16 -28
  248. package/lib/point/shaders/image/image_vert.glsl +15 -12
  249. package/lib/point/shaders/normal/normal_vert.glsl +7 -10
  250. package/lib/point/shaders/radar/radar_vert.glsl +11 -11
  251. package/lib/point/shaders/text/text_vert.glsl +10 -9
  252. package/lib/polygon/models/extrude.d.ts +16 -0
  253. package/lib/polygon/models/extrude.js +25 -25
  254. package/lib/polygon/models/extrusion.d.ts +16 -0
  255. package/lib/polygon/models/extrusion.js +34 -4
  256. package/lib/polygon/models/fill.d.ts +14 -0
  257. package/lib/polygon/models/fill.js +12 -4
  258. package/lib/polygon/models/ocean.d.ts +14 -0
  259. package/lib/polygon/models/ocean.js +11 -6
  260. package/lib/polygon/models/water.d.ts +14 -0
  261. package/lib/polygon/models/water.js +11 -6
  262. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +17 -15
  263. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +22 -20
  264. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +17 -17
  265. package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +8 -8
  266. package/lib/polygon/shaders/fill/fill_linear_vert.glsl +7 -6
  267. package/lib/polygon/shaders/fill/fill_vert.glsl +10 -12
  268. package/lib/polygon/shaders/ocean/ocean_vert.glsl +3 -4
  269. package/lib/polygon/shaders/water/polygon_water_vert.glsl +5 -5
  270. package/lib/raster/index.d.ts +1 -1
  271. package/lib/raster/index.js +2 -2
  272. package/lib/raster/models/raster.d.ts +14 -0
  273. package/lib/raster/models/raster.js +13 -3
  274. package/lib/raster/models/rasterRgb.d.ts +14 -0
  275. package/lib/raster/models/rasterRgb.js +12 -3
  276. package/lib/raster/models/rasterTerrainRgb.d.ts +14 -0
  277. package/lib/raster/models/rasterTerrainRgb.js +11 -3
  278. package/lib/raster/shaders/raster/raster_2d_vert.glsl +6 -6
  279. package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +11 -11
  280. package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +11 -11
  281. package/lib/tile/core/BaseLayer.js +0 -16
  282. package/lib/utils/extrude_polyline.d.ts +0 -15
  283. package/lib/utils/extrude_polyline.js +0 -217
  284. package/lib/wind/models/wind.d.ts +14 -0
  285. package/lib/wind/models/wind.js +9 -1
  286. package/lib/wind/shaders/wind_vert.glsl +6 -5
  287. package/package.json +6 -6
@@ -15,17 +15,20 @@ var _stencil = require("../utils/stencil");
15
15
  var _CommonStyleAttribute = require("./CommonStyleAttribute");
16
16
  var _constant = require("./constant");
17
17
  var _utils = require("./utils");
18
- const shaderLocationMap = {
19
- opacity: _CommonStyleAttribute.ShaderLocation.OPACITY,
20
- stroke: _CommonStyleAttribute.ShaderLocation.STROKE,
21
- offsets: _CommonStyleAttribute.ShaderLocation.OFFSETS,
22
- rotation: _CommonStyleAttribute.ShaderLocation.ROTATION,
23
- extrusionBase: _CommonStyleAttribute.ShaderLocation.EXTRUSION_BASE,
24
- thetaOffset: 15
25
- };
18
+ // 属性索引宏定义前缀,使用命名空间避免 define 名称重复情况
19
+ const DEFINE_ATTRIBUTE_LOCATION_PREFIX = 'ATTRIBUTE_LOCATION_';
26
20
 
27
21
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
22
  class BaseModel {
23
+ /**
24
+ * Attribute Layout Location in Shader
25
+ */
26
+ get attributeLocation() {
27
+ return (0, _objectSpread2.default)({}, _CommonStyleAttribute.COMMON_ATTRIBUTE_LOCATION);
28
+ }
29
+
30
+ // style texture data mapping
31
+
29
32
  // 不支持数据映射的buffer
30
33
 
31
34
  // style texture data mapping
@@ -34,7 +37,6 @@ class BaseModel {
34
37
  (0, _defineProperty2.default)(this, "triangulation", void 0);
35
38
  (0, _defineProperty2.default)(this, "uniformBuffers", []);
36
39
  (0, _defineProperty2.default)(this, "textures", []);
37
- // style texture data mapping
38
40
  (0, _defineProperty2.default)(this, "createTexture2D", void 0);
39
41
  (0, _defineProperty2.default)(this, "preStyleAttribute", {});
40
42
  (0, _defineProperty2.default)(this, "encodeStyleAttribute", {});
@@ -185,55 +187,18 @@ class BaseModel {
185
187
  this.layer.setAnimateStartTime();
186
188
  }
187
189
  }
188
-
189
- // 动态注入参与数据映射的uniform
190
190
  getInject() {
191
- const encodeStyleAttribute = this.layer.encodeStyleAttribute;
192
- let str = '';
193
- // a_Position = 0
194
- // a_Color = 1
195
- // a_PickingColor = 2
196
-
197
- const uniforms = [];
198
- // 支持数据映射的类型
199
- this.layer.enableShaderEncodeStyles.forEach(key => {
200
- if (encodeStyleAttribute[key]) {
201
- // 配置了数据映射的类型
202
- str += `#define USE_ATTRIBUTE_${key.toUpperCase()} 0.0; \n\n`;
203
- } else {
204
- uniforms.push(` ${_constant.DefaultUniformStyleType[key]} u_${key};`);
205
- }
206
- let location = shaderLocationMap[key];
207
- if (!location && key === 'THETA_OFFSET') {
208
- location = 15;
209
- }
210
- str += `
211
- #ifdef USE_ATTRIBUTE_${key.toUpperCase()}
212
- layout(location = ${shaderLocationMap[key]}) in ${_constant.DefaultUniformStyleType[key]} a_${key.charAt(0).toUpperCase() + key.slice(1)};
213
- #endif\n
214
- `;
215
- });
216
- const attributeUniforms = uniforms.length ? `
217
- layout(std140) uniform AttributeUniforms {
218
- ${uniforms.join('\n')}
219
- };
220
- ` : '';
221
- str += attributeUniforms;
222
- let innerStr = '';
223
- this.layer.enableShaderEncodeStyles.forEach(key => {
224
- innerStr += `\n
225
- #ifdef USE_ATTRIBUTE_${key.toUpperCase()}
226
- ${_constant.DefaultUniformStyleType[key]} ${key} = a_${key.charAt(0).toUpperCase() + key.slice(1)};
227
- #else
228
- ${_constant.DefaultUniformStyleType[key]} ${key} = u_${key};
229
- #endif\n
230
- `;
231
- });
232
- return {
233
- 'vs:#decl': str,
234
- 'fs:#decl': attributeUniforms,
235
- 'vs:#main-start': innerStr
236
- };
191
+ const shaderInject = getDynamicStyleInject(this.layer.enableShaderEncodeStyles, this.layer.encodeStyleAttribute);
192
+ return shaderInject;
193
+ }
194
+ getDefines() {
195
+ // define atribute Layout Location
196
+ const atributeLocationDefines = Object.keys(this.attributeLocation).reduce((result, key) => {
197
+ const normalizedKey = DEFINE_ATTRIBUTE_LOCATION_PREFIX + key;
198
+ result[normalizedKey] = this.attributeLocation[key];
199
+ return result;
200
+ }, {});
201
+ return (0, _objectSpread2.default)({}, atributeLocationDefines);
237
202
  }
238
203
 
239
204
  // 获取数据映射样式
@@ -254,14 +219,36 @@ ${uniforms.join('\n')}
254
219
  });
255
220
  return options;
256
221
  }
222
+
257
223
  // 注册数据映射样式
258
224
  registerStyleAttribute() {
259
225
  Object.keys(this.layer.encodeStyleAttribute).forEach(key => {
260
226
  const options = (0, _CommonStyleAttribute.getCommonStyleAttributeOptions)(key);
261
227
  if (options) {
262
228
  this.styleAttributeService.registerStyleAttribute(options);
263
- if (options.descriptor) {
264
- options.descriptor.shaderLocation = shaderLocationMap[key];
229
+ }
230
+ });
231
+ }
232
+
233
+ /**
234
+ * 注册 Position 属性 64 位地位部分,当经纬度数据开启双精度浮点数使用,
235
+ * 避免大于 20层级以上出现数据偏移
236
+ */
237
+ registerPosition64LowAttribute(enable64bitPosition = true) {
238
+ // save low part for enabled double precision POSITION attribute
239
+ this.styleAttributeService.registerStyleAttribute({
240
+ name: 'position64Low',
241
+ type: _l7Core.AttributeType.Attribute,
242
+ descriptor: {
243
+ name: 'a_Position64Low',
244
+ shaderLocation: this.attributeLocation.POSITION_64LOW,
245
+ buffer: {
246
+ data: [],
247
+ type: _l7Core.gl.FLOAT
248
+ },
249
+ size: 2,
250
+ update: (feature, featureIdx, vertex) => {
251
+ return enable64bitPosition ? [(0, _l7Utils.fp64LowPart)(vertex[0]), (0, _l7Utils.fp64LowPart)(vertex[1])] : [0, 0];
265
252
  }
266
253
  }
267
254
  });
@@ -276,14 +263,16 @@ ${uniforms.join('\n')}
276
263
  this.attributeUnifoms = this.rendererService.createBuffer({
277
264
  data: new Float32Array((0, _utils.MultipleOfFourNumber)(attrUniforms.uniformsLength)).fill(0),
278
265
  // 长度需要大于等于 4
279
- isUBO: true
266
+ isUBO: true,
267
+ label: 'layerModelAttributeUnifoms'
280
268
  });
281
269
  this.uniformBuffers.push(this.attributeUnifoms);
282
270
  }
283
271
  if (commonUniforms.uniformsLength !== 0) {
284
272
  this.commonUnifoms = this.rendererService.createBuffer({
285
273
  data: new Float32Array((0, _utils.MultipleOfFourNumber)(commonUniforms.uniformsLength)).fill(0),
286
- isUBO: true
274
+ isUBO: true,
275
+ label: 'layerModelCommonUnifoms'
287
276
  });
288
277
  this.uniformBuffers.push(this.commonUnifoms);
289
278
  }
@@ -338,4 +327,49 @@ ${uniforms.join('\n')}
338
327
  });
339
328
  }
340
329
  }
341
- exports.default = BaseModel;
330
+
331
+ /**
332
+ * 获取动态注入参与数据映射 uniform/attribute
333
+ */
334
+ exports.default = BaseModel;
335
+ function getDynamicStyleInject(shaderEncodeStyles, styleAttribute) {
336
+ const uniforms = [];
337
+ let vsDeclInjection = '';
338
+
339
+ // 支持数据映射的类型
340
+ shaderEncodeStyles.forEach(key => {
341
+ const upperCaseKey = key.replace(/([a-z])([A-Z])/g, '$1_$2').toUpperCase();
342
+ const shaderDefineName = DEFINE_ATTRIBUTE_LOCATION_PREFIX + upperCaseKey;
343
+ if (styleAttribute[key]) {
344
+ // 配置了数据映射的类型
345
+ vsDeclInjection += `#define USE_ATTRIBUTE_${upperCaseKey} 0.0 \n`;
346
+ } else {
347
+ uniforms.push(` ${_constant.DefaultUniformStyleType[key]} u_${key};`);
348
+ }
349
+ vsDeclInjection += `
350
+ #ifdef USE_ATTRIBUTE_${upperCaseKey}
351
+ layout(location = ${shaderDefineName}) in ${_constant.DefaultUniformStyleType[key]} a_${key.charAt(0).toUpperCase() + key.slice(1)};
352
+ #endif \n`;
353
+ });
354
+ const fsDeclInjection = uniforms.length ? `
355
+ layout(std140) uniform AttributeUniforms {
356
+ ${uniforms.join('\n')}
357
+ };\n` : '';
358
+ vsDeclInjection += fsDeclInjection;
359
+ let vsMainInjection = '';
360
+ shaderEncodeStyles.forEach(key => {
361
+ const upperCaseKey = key.replace(/([a-z])([A-Z])/g, '$1_$2').toUpperCase();
362
+ vsMainInjection += `
363
+ #ifdef USE_ATTRIBUTE_${upperCaseKey}
364
+ ${_constant.DefaultUniformStyleType[key]} ${key} = a_${key.charAt(0).toUpperCase() + key.slice(1)};
365
+ #else
366
+ ${_constant.DefaultUniformStyleType[key]} ${key} = u_${key};
367
+ #endif
368
+ `;
369
+ });
370
+ return {
371
+ 'vs:#decl': vsDeclInjection,
372
+ 'fs:#decl': fsDeclInjection,
373
+ 'vs:#main-start': vsMainInjection
374
+ };
375
+ }
@@ -1,20 +1,16 @@
1
1
  import type { IStyleAttribute } from '@antv/l7-core';
2
- export declare enum ShaderLocation {
3
- POSITION = 0,
4
- COLOR = 1,
5
- VERTEX_ID = 2,
6
- PICKING_COLOR = 3,
7
- STROKE = 4,
8
- OPACITY = 5,
9
- OFFSETS = 6,
10
- ROTATION = 7,
11
- EXTRUSION_BASE = 8,
12
- SIZE = 9,
13
- SHAPE = 10,
14
- EXTRUDE = 11,
15
- MAX = 12,
16
- NORMAL = 13,
17
- UV = 14,
18
- LINEAR = 15
19
- }
2
+ /**
3
+ * Attribute Layout Location in Shader
4
+ */
5
+ export declare const COMMON_ATTRIBUTE_LOCATION: {
6
+ readonly POSITION: 0;
7
+ readonly POSITION_64LOW: 1;
8
+ readonly COLOR: 2;
9
+ readonly PICKING_COLOR: 3;
10
+ readonly STROKE: 4;
11
+ readonly OPACITY: 5;
12
+ readonly OFFSETS: 6;
13
+ readonly ROTATION: 7;
14
+ readonly MAX: 8;
15
+ };
20
16
  export declare function getCommonStyleAttributeOptions(name: string): Partial<IStyleAttribute> | undefined;
@@ -3,28 +3,27 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ShaderLocation = void 0;
6
+ exports.COMMON_ATTRIBUTE_LOCATION = void 0;
7
7
  exports.getCommonStyleAttributeOptions = getCommonStyleAttributeOptions;
8
8
  var _l7Core = require("@antv/l7-core");
9
- let ShaderLocation = exports.ShaderLocation = /*#__PURE__*/function (ShaderLocation) {
10
- ShaderLocation[ShaderLocation["POSITION"] = 0] = "POSITION";
11
- ShaderLocation[ShaderLocation["COLOR"] = 1] = "COLOR";
12
- ShaderLocation[ShaderLocation["VERTEX_ID"] = 2] = "VERTEX_ID";
13
- ShaderLocation[ShaderLocation["PICKING_COLOR"] = 3] = "PICKING_COLOR";
14
- ShaderLocation[ShaderLocation["STROKE"] = 4] = "STROKE";
15
- ShaderLocation[ShaderLocation["OPACITY"] = 5] = "OPACITY";
16
- ShaderLocation[ShaderLocation["OFFSETS"] = 6] = "OFFSETS";
17
- ShaderLocation[ShaderLocation["ROTATION"] = 7] = "ROTATION";
18
- ShaderLocation[ShaderLocation["EXTRUSION_BASE"] = 8] = "EXTRUSION_BASE";
19
- ShaderLocation[ShaderLocation["SIZE"] = 9] = "SIZE";
20
- ShaderLocation[ShaderLocation["SHAPE"] = 10] = "SHAPE";
21
- ShaderLocation[ShaderLocation["EXTRUDE"] = 11] = "EXTRUDE";
22
- ShaderLocation[ShaderLocation["MAX"] = 12] = "MAX";
23
- ShaderLocation[ShaderLocation["NORMAL"] = 13] = "NORMAL";
24
- ShaderLocation[ShaderLocation["UV"] = 14] = "UV";
25
- ShaderLocation[ShaderLocation["LINEAR"] = 15] = "LINEAR";
26
- return ShaderLocation;
27
- }({}); // Polygon Linear
9
+ /**
10
+ * Attribute Layout Location in Shader
11
+ */
12
+ const COMMON_ATTRIBUTE_LOCATION = exports.COMMON_ATTRIBUTE_LOCATION = {
13
+ // common attribute in RegisterStyleAttributePlugin
14
+ POSITION: 0,
15
+ // low part for double precision POSITION attribute
16
+ POSITION_64LOW: 1,
17
+ COLOR: 2,
18
+ PICKING_COLOR: 3,
19
+ // common style attribute
20
+ STROKE: 4,
21
+ OPACITY: 5,
22
+ OFFSETS: 6,
23
+ ROTATION: 7,
24
+ // last index
25
+ MAX: 8
26
+ };
28
27
  function getCommonStyleAttributeOptions(name) {
29
28
  switch (name) {
30
29
  // // roate
@@ -34,7 +33,7 @@ function getCommonStyleAttributeOptions(name) {
34
33
  type: _l7Core.AttributeType.Attribute,
35
34
  descriptor: {
36
35
  name: 'a_Rotation',
37
- shaderLocation: ShaderLocation.ROTATION,
36
+ shaderLocation: COMMON_ATTRIBUTE_LOCATION.ROTATION,
38
37
  buffer: {
39
38
  usage: _l7Core.gl.DYNAMIC_DRAW,
40
39
  data: [],
@@ -55,7 +54,7 @@ function getCommonStyleAttributeOptions(name) {
55
54
  type: _l7Core.AttributeType.Attribute,
56
55
  descriptor: {
57
56
  name: 'a_Stroke',
58
- shaderLocation: ShaderLocation.STROKE,
57
+ shaderLocation: COMMON_ATTRIBUTE_LOCATION.STROKE,
59
58
  buffer: {
60
59
  // give the WebGL driver a hint that this buffer may change
61
60
  usage: _l7Core.gl.DYNAMIC_DRAW,
@@ -77,7 +76,7 @@ function getCommonStyleAttributeOptions(name) {
77
76
  type: _l7Core.AttributeType.Attribute,
78
77
  descriptor: {
79
78
  name: 'a_Opacity',
80
- shaderLocation: ShaderLocation.OPACITY,
79
+ shaderLocation: COMMON_ATTRIBUTE_LOCATION.OPACITY,
81
80
  buffer: {
82
81
  // give the WebGL driver a hint that this buffer may change
83
82
  usage: _l7Core.gl.STATIC_DRAW,
@@ -93,35 +92,13 @@ function getCommonStyleAttributeOptions(name) {
93
92
  }
94
93
  }
95
94
  };
96
- case 'extrusionBase':
97
- return {
98
- name: 'extrusionBase',
99
- type: _l7Core.AttributeType.Attribute,
100
- descriptor: {
101
- name: 'a_ExtrusionBase',
102
- shaderLocation: ShaderLocation.EXTRUSION_BASE,
103
- buffer: {
104
- // give the WebGL driver a hint that this buffer may change
105
- usage: _l7Core.gl.STATIC_DRAW,
106
- data: [],
107
- type: _l7Core.gl.FLOAT
108
- },
109
- size: 1,
110
- update: feature => {
111
- const {
112
- extrusionBase: op = 0
113
- } = feature;
114
- return [op];
115
- }
116
- }
117
- };
118
95
  case 'offsets':
119
96
  return {
120
97
  name: 'offsets',
121
98
  type: _l7Core.AttributeType.Attribute,
122
99
  descriptor: {
123
100
  name: 'a_Offsets',
124
- shaderLocation: ShaderLocation.OFFSETS,
101
+ shaderLocation: COMMON_ATTRIBUTE_LOCATION.OFFSETS,
125
102
  buffer: {
126
103
  // give the WebGL driver a hint that this buffer may change
127
104
  usage: _l7Core.gl.STATIC_DRAW,
@@ -137,28 +114,6 @@ function getCommonStyleAttributeOptions(name) {
137
114
  }
138
115
  }
139
116
  };
140
- case 'thetaOffset':
141
- return {
142
- name: 'thetaOffset',
143
- type: _l7Core.AttributeType.Attribute,
144
- descriptor: {
145
- name: 'a_ThetaOffset',
146
- shaderLocation: 15,
147
- buffer: {
148
- // give the WebGL driver a hint that this buffer may change
149
- usage: _l7Core.gl.STATIC_DRAW,
150
- data: [],
151
- type: _l7Core.gl.FLOAT
152
- },
153
- size: 1,
154
- update: feature => {
155
- const {
156
- thetaOffset: op = 1
157
- } = feature;
158
- return [op];
159
- }
160
- }
161
- };
162
117
  default:
163
118
  return undefined;
164
119
  }
@@ -10,6 +10,7 @@ exports.fillPolygon = fillPolygon;
10
10
  var _l7Utils = require("@antv/l7-utils");
11
11
  var _earcut = _interopRequireDefault(require("earcut"));
12
12
  var _glMatrix = require("gl-matrix");
13
+ var _utils = require("../utils");
13
14
  /**
14
15
  * 拉伸多边形顶点,返回拉伸后的顶点信息
15
16
  * @param paths 路径数据组
@@ -73,7 +74,8 @@ function extrude_PolygonNormal(path, needFlat = false // 是否需要转成平
73
74
  const flattengeo = _earcut.default.flatten(path);
74
75
  const {
75
76
  vertices,
76
- dimensions
77
+ dimensions,
78
+ holes
77
79
  } = flattengeo;
78
80
  const positions = [];
79
81
  const indexArray = [];
@@ -92,8 +94,9 @@ function extrude_PolygonNormal(path, needFlat = false // 是否需要转成平
92
94
  );
93
95
  normals.push(0, 0, 1);
94
96
  }
95
- const triangles = (0, _earcut.default)(flattengeo.vertices, flattengeo.holes, flattengeo.dimensions);
96
- indexArray.push(...triangles);
97
+ const indices = (0, _utils.getPolygonSurfaceIndices)(vertices, holes, dimensions, needFlat);
98
+ indexArray.push(...indices);
99
+
97
100
  // 设置侧面
98
101
  for (let i = 0; i < n; i++) {
99
102
  const prePoint = flattengeo.vertices.slice(i * dimensions, (i + 1) * dimensions);
@@ -28,8 +28,9 @@ var _earcut = _interopRequireDefault(require("earcut"));
28
28
  var _glMatrix = require("gl-matrix");
29
29
  var _utils = require("../earth/utils");
30
30
  var _extrude_polyline = _interopRequireDefault(require("../utils/extrude_polyline"));
31
- var _extrude = _interopRequireWildcard(require("./shape/extrude"));
32
31
  var _Path = require("./shape/Path");
32
+ var _extrude = _interopRequireWildcard(require("./shape/extrude"));
33
+ var _utils2 = require("./utils");
33
34
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
34
35
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
35
36
  // @ts-ignore
@@ -103,9 +104,7 @@ function PointImageTriangulation(feature) {
103
104
  */
104
105
  function LineTriangulation(feature) {
105
106
  const {
106
- coordinates,
107
- originCoordinates,
108
- version
107
+ coordinates
109
108
  } = feature;
110
109
  // let path = coordinates as number[][][] | number[][];
111
110
  // if (!Array.isArray(path[0][0])) {
@@ -116,32 +115,13 @@ function LineTriangulation(feature) {
116
115
  dash: true,
117
116
  join: 'bevel'
118
117
  });
119
- if (version === 'GAODE2.x') {
120
- // 处理高德2.0几何体构建
121
- let path1 = coordinates; // 计算位置
122
- if (!Array.isArray(path1[0][0])) {
123
- path1 = [coordinates];
124
- }
125
- let path2 = originCoordinates; // 计算法线
126
- if (!Array.isArray(path2[0][0])) {
127
- path2 = [originCoordinates];
128
- }
129
- for (let i = 0; i < path1.length; i++) {
130
- // 高德2.0在计算线时,需要使用经纬度计算发现,使用 customCoords.lnglatToCoords 计算的数据来计算顶点的位置
131
- const item1 = path1[i];
132
- const item2 = path2[i];
133
- line.extrude_gaode2(item1, item2);
134
- }
135
- } else {
136
- // 处理非高德2.0的几何体构建
137
- let path = coordinates;
138
- if (path[0] && !Array.isArray(path[0][0])) {
139
- path = [coordinates];
140
- }
141
- path.forEach(item => {
142
- line.extrude(item);
143
- });
118
+ let path = coordinates;
119
+ if (path[0] && !Array.isArray(path[0][0])) {
120
+ path = [coordinates];
144
121
  }
122
+ path.forEach(item => {
123
+ line.extrude(item);
124
+ });
145
125
  const linebuffer = line.complex;
146
126
  return {
147
127
  vertices: linebuffer.positions,
@@ -203,8 +183,7 @@ function FlowLineFillTriangulation(feature) {
203
183
  }
204
184
  function SimpleLineTriangulation(feature) {
205
185
  const {
206
- coordinates,
207
- originCoordinates
186
+ coordinates
208
187
  } = feature;
209
188
  const pos = [];
210
189
  if (!Array.isArray(coordinates[0])) {
@@ -219,7 +198,7 @@ function SimpleLineTriangulation(feature) {
219
198
  const {
220
199
  results,
221
200
  totalDistance
222
- } = getSimpleLineVertices(coordinates, originCoordinates);
201
+ } = getSimpleLineVertices(coordinates);
223
202
  results.map(point => {
224
203
  pos.push(point[0], point[1], point[2], point[3], 0, totalDistance);
225
204
  });
@@ -271,15 +250,11 @@ function pushDis(point, n) {
271
250
  }
272
251
  return point;
273
252
  }
274
- function getSimpleLineVertices(coordinates, originCoordinates) {
253
+ function getSimpleLineVertices(coordinates) {
275
254
  let points = coordinates;
276
- //除了amap2.0以外 coordinates就是经纬度数据
277
- let originPoints = originCoordinates || coordinates;
278
255
  if (Array.isArray(points) && Array.isArray(points[0]) && Array.isArray(points[0][0])) {
279
256
  // @ts-ignore
280
- points = originCoordinates.flat();
281
- // @ts-ignore
282
- originPoints = originCoordinates.flat();
257
+ points = coordinates.flat();
283
258
  }
284
259
  //修改计算距离的方式,与普通线的计算方式保持一致 edit by huyang 20231214
285
260
  let distance = 0;
@@ -293,13 +268,13 @@ function getSimpleLineVertices(coordinates, originCoordinates) {
293
268
  const point = pushDis(points[0], distance);
294
269
  results.push(point);
295
270
  for (let i = 1; i < points.length - 1; i++) {
296
- const subDistance = lineSegmentDistance((0, _l7Utils.aProjectFlat)(originPoints[i - 1]), (0, _l7Utils.aProjectFlat)(originPoints[i]));
271
+ const subDistance = lineSegmentDistance((0, _l7Utils.aProjectFlat)(points[i - 1]), (0, _l7Utils.aProjectFlat)(points[i]));
297
272
  distance += subDistance;
298
273
  const mulPoint = pushDis(points[i], distance);
299
274
  results.push(mulPoint);
300
275
  results.push(mulPoint);
301
276
  }
302
- const pointDistance = lineSegmentDistance((0, _l7Utils.aProjectFlat)(originPoints[originPoints.length - 2]), (0, _l7Utils.aProjectFlat)(originPoints[originPoints.length - 1]));
277
+ const pointDistance = lineSegmentDistance((0, _l7Utils.aProjectFlat)(points[points.length - 2]), (0, _l7Utils.aProjectFlat)(points[points.length - 1]));
303
278
  distance += pointDistance;
304
279
  results.push(pushDis(points[points.length - 1], distance));
305
280
  return {
@@ -338,8 +313,9 @@ function polygonTriangulation(feature) {
338
313
  dimensions,
339
314
  holes
340
315
  } = flattengeo;
316
+ const indices = (0, _utils2.getPolygonSurfaceIndices)(vertices, holes, dimensions);
341
317
  return {
342
- indices: (0, _earcut.default)(vertices, holes, dimensions),
318
+ indices,
343
319
  vertices,
344
320
  size: dimensions
345
321
  };
@@ -348,18 +324,14 @@ function polygonTriangulation(feature) {
348
324
  // 构建几何图形(带有中心点和大小)
349
325
  function polygonTriangulationWithCenter(feature) {
350
326
  const {
351
- coordinates
352
- } = feature;
353
- const flattengeo = _earcut.default.flatten(coordinates);
354
- const {
327
+ indices,
355
328
  vertices,
356
- dimensions,
357
- holes
358
- } = flattengeo;
329
+ size
330
+ } = polygonTriangulation(feature);
359
331
  return {
360
- indices: (0, _earcut.default)(vertices, holes, dimensions),
332
+ indices: indices,
361
333
  vertices: getVerticesWithCenter(vertices),
362
- size: dimensions + 4
334
+ size: size + 4
363
335
  };
364
336
  }
365
337
  function getVerticesWithCenter(vertices) {
@@ -1 +1,5 @@
1
1
  export declare function MultipleOfFourNumber(num: number): number;
2
+ /**
3
+ * Get vertex indices for drawing polygon mesh (triangulation)
4
+ */
5
+ export declare function getPolygonSurfaceIndices(positions: number[], holeIndices: number[], positionSize: number, preproject?: boolean): number[];
package/lib/core/utils.js CHANGED
@@ -1,9 +1,44 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.MultipleOfFourNumber = MultipleOfFourNumber;
8
+ exports.getPolygonSurfaceIndices = getPolygonSurfaceIndices;
9
+ var _l7Utils = require("@antv/l7-utils");
10
+ var _earcut = _interopRequireDefault(require("earcut"));
7
11
  function MultipleOfFourNumber(num) {
8
12
  return Math.max(Math.ceil(num / 4) * 4, 4);
13
+ }
14
+
15
+ /**
16
+ * Get vertex indices for drawing polygon mesh (triangulation)
17
+ */
18
+ function getPolygonSurfaceIndices(positions, holeIndices, positionSize, preproject = true) {
19
+ const is3d = positionSize === 3;
20
+ if (preproject) {
21
+ positions = positions.slice();
22
+ const p = [];
23
+ for (let i = 0; i < positions.length; i += positionSize) {
24
+ p[0] = positions[i];
25
+ p[1] = positions[i + 1];
26
+ if (is3d) {
27
+ p[2] = positions[i + 2];
28
+ }
29
+
30
+ // earcut is a 2D triangulation algorithm, and handles 3D data as if it was projected onto the XY plane
31
+ const xy = (0, _l7Utils.lngLatToMeters)(p, true, {
32
+ enable: false,
33
+ decimal: 1
34
+ });
35
+ positions[i] = xy[0];
36
+ positions[i + 1] = xy[1];
37
+ if (is3d) {
38
+ positions[i + 2] = xy[2];
39
+ }
40
+ }
41
+ }
42
+ const indices = (0, _earcut.default)(positions, holeIndices, positionSize);
43
+ return indices;
9
44
  }
@@ -1,6 +1,21 @@
1
1
  import type { IModel } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class EarthAtomSphereModel extends BaseModel {
4
+ protected get attributeLocation(): {
5
+ readonly POSITION: 0;
6
+ readonly POSITION_64LOW: 1;
7
+ readonly COLOR: 2;
8
+ readonly PICKING_COLOR: 3;
9
+ readonly STROKE: 4;
10
+ readonly OPACITY: 5;
11
+ readonly OFFSETS: 6;
12
+ readonly ROTATION: 7;
13
+ readonly MAX: 8;
14
+ } & Record<string, number> & {
15
+ MAX: 8;
16
+ NORMAL: number;
17
+ UV: number;
18
+ };
4
19
  protected getCommonUniformsInfo(): {
5
20
  uniformsArray: number[];
6
21
  uniformsLength: number;