@antv/l7-layers 2.20.3 → 2.20.6

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 (450) hide show
  1. package/es/canvas/index.d.ts +3 -3
  2. package/es/citybuliding/models/build.d.ts +7 -12
  3. package/es/citybuliding/models/build.js +22 -11
  4. package/es/citybuliding/shaders/build_frag.glsl +26 -23
  5. package/es/citybuliding/shaders/build_vert.glsl +24 -16
  6. package/es/core/BaseLayer.d.ts +14 -2
  7. package/es/core/BaseLayer.js +56 -10
  8. package/es/core/BaseModel.d.ts +21 -1
  9. package/es/core/BaseModel.js +99 -2
  10. package/es/core/CommonStyleAttribute.d.ts +5 -2
  11. package/es/core/CommonStyleAttribute.js +4 -0
  12. package/es/core/LayerPickService.d.ts +1 -1
  13. package/es/core/TextureService.d.ts +2 -2
  14. package/es/core/interface.d.ts +7 -3
  15. package/es/core/interface.js +0 -1
  16. package/es/core/line_trangluation.d.ts +1 -1
  17. package/es/core/shape/arrow.d.ts +1 -1
  18. package/es/core/shape/extrude.d.ts +1 -1
  19. package/es/core/triangulation.d.ts +1 -1
  20. package/es/core/triangulation.js +13 -7
  21. package/es/core/utils.d.ts +4 -0
  22. package/es/core/utils.js +15 -0
  23. package/es/earth/index.d.ts +1 -1
  24. package/es/earth/models/atmosphere.d.ts +8 -2
  25. package/es/earth/models/atmosphere.js +15 -8
  26. package/es/earth/models/base.d.ts +8 -2
  27. package/es/earth/models/base.js +21 -12
  28. package/es/earth/models/bloomsphere.d.ts +8 -2
  29. package/es/earth/models/bloomsphere.js +15 -8
  30. package/es/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
  31. package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
  32. package/es/earth/shaders/base/base_frag.glsl +11 -0
  33. package/es/earth/shaders/base/base_vert.glsl +52 -0
  34. package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
  35. package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
  36. package/es/geometry/index.d.ts +2 -2
  37. package/es/geometry/models/billboard.d.ts +8 -1
  38. package/es/geometry/models/billboard.js +26 -11
  39. package/es/geometry/models/plane.d.ts +8 -1
  40. package/es/geometry/models/plane.js +23 -6
  41. package/es/geometry/models/sprite.d.ts +12 -2
  42. package/es/geometry/models/sprite.js +44 -18
  43. package/es/geometry/shaders/billboard_frag.glsl +11 -6
  44. package/es/geometry/shaders/billboard_vert.glsl +12 -15
  45. package/es/geometry/shaders/plane_frag.glsl +14 -10
  46. package/es/geometry/shaders/plane_vert.glsl +11 -10
  47. package/es/geometry/shaders/sprite_frag.glsl +11 -7
  48. package/es/geometry/shaders/sprite_vert.glsl +10 -9
  49. package/es/heatmap/index.d.ts +3 -3
  50. package/es/heatmap/models/grid.d.ts +8 -1
  51. package/es/heatmap/models/grid.js +25 -12
  52. package/es/heatmap/models/grid3d.d.ts +8 -1
  53. package/es/heatmap/models/grid3d.js +29 -13
  54. package/es/heatmap/models/heatmap.d.ts +6 -4
  55. package/es/heatmap/models/heatmap.js +123 -75
  56. package/es/heatmap/models/hexagon.d.ts +8 -1
  57. package/es/heatmap/models/hexagon.js +25 -12
  58. package/es/heatmap/shaders/grid/grid_frag.glsl +8 -0
  59. package/es/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
  60. package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
  61. package/{lib/heatmap/shaders/hexagon_3d_vert.glsl → es/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
  62. package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
  63. package/es/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
  64. package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
  65. package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
  66. package/{lib/heatmap/shaders → es/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
  67. package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
  68. package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
  69. package/es/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
  70. package/es/image/index.d.ts +2 -2
  71. package/es/image/models/image.d.ts +9 -2
  72. package/es/image/models/image.js +83 -44
  73. package/es/image/shaders/image_frag.glsl +34 -7
  74. package/es/image/shaders/image_vert.glsl +11 -5
  75. package/es/line/index.d.ts +4 -4
  76. package/es/line/index.js +2 -1
  77. package/es/line/models/arc.d.ts +8 -3
  78. package/es/line/models/arc.js +57 -76
  79. package/es/line/models/arc_3d.d.ts +8 -3
  80. package/es/line/models/arc_3d.js +46 -57
  81. package/es/line/models/flow.d.ts +8 -2
  82. package/es/line/models/flow.js +14 -12
  83. package/es/line/models/great_circle.d.ts +8 -3
  84. package/es/line/models/great_circle.js +51 -36
  85. package/es/line/models/index.d.ts +1 -1
  86. package/es/line/models/index.js +3 -6
  87. package/es/line/models/line.d.ts +8 -3
  88. package/es/line/models/line.js +67 -140
  89. package/es/line/models/{simpleLine.d.ts → simple_line.d.ts} +8 -2
  90. package/es/line/models/simple_line.js +204 -0
  91. package/es/line/models/wall.d.ts +8 -3
  92. package/es/line/models/wall.js +35 -27
  93. package/es/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
  94. package/es/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
  95. package/es/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
  96. package/{lib/line/shaders → es/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
  97. package/es/line/shaders/flow/flow_line_frag.glsl +5 -4
  98. package/es/line/shaders/flow/flow_line_vert.glsl +17 -18
  99. package/es/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
  100. package/{lib/line/shaders → es/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
  101. package/es/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
  102. package/es/line/shaders/line/line_vert.glsl +114 -0
  103. package/es/line/shaders/simple/simpleline_frag.glsl +27 -3
  104. package/es/line/shaders/simple/simpleline_vert.glsl +20 -20
  105. package/es/line/shaders/wall/wall_frag.glsl +31 -26
  106. package/es/line/shaders/wall/wall_vert.glsl +29 -22
  107. package/es/mask/index.d.ts +2 -2
  108. package/es/mask/models/fill.d.ts +1 -1
  109. package/es/plugins/DataMappingPlugin.d.ts +1 -1
  110. package/es/plugins/DataMappingPlugin.js +1 -3
  111. package/es/plugins/DataSourcePlugin.d.ts +1 -1
  112. package/es/plugins/FeatureScalePlugin.d.ts +1 -1
  113. package/es/plugins/FeatureScalePlugin.js +14 -3
  114. package/es/plugins/LayerAnimateStylePlugin.d.ts +1 -1
  115. package/es/plugins/LayerMaskPlugin.d.ts +1 -1
  116. package/es/plugins/LayerModelPlugin.d.ts +1 -1
  117. package/es/plugins/LayerStylePlugin.d.ts +1 -1
  118. package/es/plugins/LightingPlugin.d.ts +1 -1
  119. package/es/plugins/MultiPassRendererPlugin.d.ts +1 -1
  120. package/es/plugins/PixelPickingPlugin.d.ts +6 -2
  121. package/es/plugins/PixelPickingPlugin.js +36 -49
  122. package/es/plugins/RegisterStyleAttributePlugin.d.ts +1 -1
  123. package/es/plugins/ShaderUniformPlugin.d.ts +1 -1
  124. package/es/plugins/ShaderUniformPlugin.js +11 -6
  125. package/es/plugins/UpdateModelPlugin.d.ts +1 -1
  126. package/es/plugins/UpdateStyleAttributePlugin.d.ts +1 -1
  127. package/es/point/index.d.ts +2 -2
  128. package/es/point/index.js +1 -0
  129. package/es/point/models/billboard_point.d.ts +9 -3
  130. package/es/point/models/billboard_point.js +18 -18
  131. package/es/point/models/earthExtrude.d.ts +7 -12
  132. package/es/point/models/earthExtrude.js +21 -13
  133. package/es/point/models/earthFill.d.ts +8 -3
  134. package/es/point/models/earthFill.js +18 -30
  135. package/es/point/models/extrude.d.ts +7 -12
  136. package/es/point/models/extrude.js +18 -13
  137. package/es/point/models/fill.d.ts +8 -2
  138. package/es/point/models/fill.js +33 -84
  139. package/es/point/models/{fillmage.d.ts → fillImage.d.ts} +8 -2
  140. package/es/point/models/{fillmage.js → fillImage.js} +23 -15
  141. package/es/point/models/image.d.ts +8 -1
  142. package/es/point/models/image.js +31 -21
  143. package/es/point/models/index.js +1 -1
  144. package/es/point/models/normal.d.ts +9 -3
  145. package/es/point/models/normal.js +13 -30
  146. package/es/point/models/radar.d.ts +8 -2
  147. package/es/point/models/radar.js +23 -45
  148. package/es/point/models/text.d.ts +9 -2
  149. package/es/point/models/text.js +31 -32
  150. package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
  151. package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
  152. package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
  153. package/{lib/point/shaders/earth/extrude_vert.glsl → es/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
  154. package/{lib/point/shaders/earth/fill_frag.glsl → es/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
  155. package/{lib/point/shaders/earth/fill_vert.glsl → es/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
  156. package/es/point/shaders/extrude/extrude_frag.glsl +19 -7
  157. package/es/point/shaders/extrude/extrude_vert.glsl +23 -30
  158. package/{lib/point/shaders → es/point/shaders/fill}/fill_frag.glsl +18 -1
  159. package/es/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
  160. package/es/point/shaders/fillImage/fillImage_frag.glsl +24 -0
  161. package/{lib/point/shaders/image → es/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
  162. package/es/point/shaders/image/image_frag.glsl +42 -0
  163. package/{lib/point/shaders → es/point/shaders/image}/image_vert.glsl +14 -13
  164. package/es/point/shaders/radar/radar_frag.glsl +19 -14
  165. package/es/point/shaders/radar/radar_vert.glsl +21 -24
  166. package/es/point/shaders/text/text_frag.glsl +44 -0
  167. package/es/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
  168. package/es/point/shape/extrude.d.ts +1 -1
  169. package/es/polygon/index.d.ts +2 -2
  170. package/es/polygon/models/extrude.d.ts +9 -9
  171. package/es/polygon/models/extrude.js +38 -15
  172. package/es/polygon/models/extrusion.d.ts +8 -1
  173. package/es/polygon/models/extrusion.js +24 -7
  174. package/es/polygon/models/fill.d.ts +9 -4
  175. package/es/polygon/models/fill.js +26 -13
  176. package/es/polygon/models/ocean.d.ts +9 -7
  177. package/es/polygon/models/ocean.js +30 -14
  178. package/es/polygon/models/water.d.ts +9 -4
  179. package/es/polygon/models/water.js +26 -10
  180. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
  181. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
  182. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
  183. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
  184. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
  185. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
  186. package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
  187. package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
  188. package/es/polygon/shaders/fill/fill_frag.glsl +7 -0
  189. package/es/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
  190. package/{lib/polygon/shaders/polygon_linear_vert.glsl → es/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
  191. package/es/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
  192. package/es/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
  193. package/es/polygon/shaders/ocean/ocean_vert.glsl +22 -0
  194. package/es/polygon/shaders/water/polygon_water_frag.glsl +14 -12
  195. package/es/polygon/shaders/water/polygon_water_vert.glsl +10 -10
  196. package/es/raster/buffers/triangulation.d.ts +1 -1
  197. package/es/raster/index.d.ts +2 -2
  198. package/es/raster/models/raster.d.ts +9 -8
  199. package/es/raster/models/raster.js +54 -38
  200. package/es/raster/models/rasterRgb.d.ts +9 -7
  201. package/es/raster/models/rasterRgb.js +36 -19
  202. package/es/raster/models/rasterTerrainRgb.d.ts +1 -1
  203. package/es/raster/models/rasterTerrainRgb.js +2 -2
  204. package/es/raster/shaders/raster/raster_2d_frag.glsl +34 -0
  205. package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
  206. package/es/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
  207. package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
  208. package/es/tile/core/BaseLayer.d.ts +2 -2
  209. package/es/tile/core/TileDebugLayer.d.ts +1 -1
  210. package/es/tile/interaction/getRasterData.d.ts +2 -2
  211. package/es/tile/interaction/utils.d.ts +1 -1
  212. package/es/tile/interface.d.ts +2 -2
  213. package/es/tile/service/TileLayerService.d.ts +2 -2
  214. package/es/tile/service/TilePickService.d.ts +2 -2
  215. package/es/tile/service/TileSourceService.d.ts +1 -1
  216. package/es/tile/tile/Tile.d.ts +2 -3
  217. package/es/tile/tile/VectorTile.d.ts +1 -1
  218. package/es/tile/tile/index.d.ts +1 -1
  219. package/es/tile/utils/constants.js +1 -1
  220. package/es/tile/utils/utils.d.ts +1 -1
  221. package/es/utils/blend.d.ts +1 -1
  222. package/es/utils/multiPassRender.d.ts +1 -1
  223. package/es/utils/stencil.d.ts +1 -1
  224. package/es/wind/index.d.ts +3 -3
  225. package/es/wind/models/wind.d.ts +1 -1
  226. package/lib/citybuliding/models/build.js +22 -11
  227. package/lib/citybuliding/shaders/build_frag.glsl +26 -23
  228. package/lib/citybuliding/shaders/build_vert.glsl +24 -16
  229. package/lib/core/BaseLayer.js +56 -10
  230. package/lib/core/BaseModel.js +99 -2
  231. package/lib/core/CommonStyleAttribute.js +4 -0
  232. package/lib/core/triangulation.js +12 -6
  233. package/lib/core/utils.js +22 -0
  234. package/lib/earth/models/atmosphere.js +15 -8
  235. package/lib/earth/models/base.js +21 -12
  236. package/lib/earth/models/bloomsphere.js +15 -8
  237. package/lib/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
  238. package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
  239. package/lib/earth/shaders/base/base_frag.glsl +11 -0
  240. package/lib/earth/shaders/base/base_vert.glsl +52 -0
  241. package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
  242. package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
  243. package/lib/geometry/models/billboard.js +26 -11
  244. package/lib/geometry/models/plane.js +23 -6
  245. package/lib/geometry/models/sprite.js +44 -18
  246. package/lib/geometry/shaders/billboard_frag.glsl +11 -6
  247. package/lib/geometry/shaders/billboard_vert.glsl +12 -15
  248. package/lib/geometry/shaders/plane_frag.glsl +14 -10
  249. package/lib/geometry/shaders/plane_vert.glsl +11 -10
  250. package/lib/geometry/shaders/sprite_frag.glsl +11 -7
  251. package/lib/geometry/shaders/sprite_vert.glsl +10 -9
  252. package/lib/heatmap/models/grid.js +25 -12
  253. package/lib/heatmap/models/grid3d.js +29 -13
  254. package/lib/heatmap/models/heatmap.js +122 -74
  255. package/lib/heatmap/models/hexagon.js +25 -12
  256. package/lib/heatmap/shaders/grid/grid_frag.glsl +8 -0
  257. package/lib/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
  258. package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
  259. package/{es/heatmap/shaders/hexagon_3d_vert.glsl → lib/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
  260. package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
  261. package/lib/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
  262. package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
  263. package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
  264. package/{es/heatmap/shaders → lib/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
  265. package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
  266. package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
  267. package/lib/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
  268. package/lib/image/models/image.js +83 -44
  269. package/lib/image/shaders/image_frag.glsl +34 -7
  270. package/lib/image/shaders/image_vert.glsl +11 -5
  271. package/lib/line/index.js +2 -1
  272. package/lib/line/models/arc.js +57 -76
  273. package/lib/line/models/arc_3d.js +47 -59
  274. package/lib/line/models/flow.js +14 -12
  275. package/lib/line/models/great_circle.js +51 -36
  276. package/lib/line/models/index.js +4 -7
  277. package/lib/line/models/line.js +67 -142
  278. package/lib/line/models/{simpleLine.js → simple_line.js} +84 -74
  279. package/lib/line/models/wall.js +35 -27
  280. package/lib/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
  281. package/lib/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
  282. package/lib/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
  283. package/{es/line/shaders → lib/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
  284. package/lib/line/shaders/flow/flow_line_frag.glsl +5 -4
  285. package/lib/line/shaders/flow/flow_line_vert.glsl +17 -18
  286. package/lib/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
  287. package/{es/line/shaders → lib/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
  288. package/lib/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
  289. package/lib/line/shaders/line/line_vert.glsl +114 -0
  290. package/lib/line/shaders/simple/simpleline_frag.glsl +27 -3
  291. package/lib/line/shaders/simple/simpleline_vert.glsl +20 -20
  292. package/lib/line/shaders/wall/wall_frag.glsl +31 -26
  293. package/lib/line/shaders/wall/wall_vert.glsl +29 -22
  294. package/lib/plugins/DataMappingPlugin.js +1 -3
  295. package/lib/plugins/FeatureScalePlugin.js +14 -3
  296. package/lib/plugins/PixelPickingPlugin.js +35 -48
  297. package/lib/plugins/ShaderUniformPlugin.js +11 -6
  298. package/lib/point/index.js +1 -0
  299. package/lib/point/models/billboard_point.js +18 -18
  300. package/lib/point/models/earthExtrude.js +21 -13
  301. package/lib/point/models/earthFill.js +18 -30
  302. package/lib/point/models/extrude.js +18 -13
  303. package/lib/point/models/fill.js +33 -84
  304. package/lib/point/models/{fillmage.js → fillImage.js} +24 -17
  305. package/lib/point/models/image.js +31 -21
  306. package/lib/point/models/index.js +2 -2
  307. package/lib/point/models/normal.js +13 -30
  308. package/lib/point/models/radar.js +23 -45
  309. package/lib/point/models/text.js +31 -32
  310. package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
  311. package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
  312. package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
  313. package/{es/point/shaders/earth/extrude_vert.glsl → lib/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
  314. package/{es/point/shaders/earth/fill_frag.glsl → lib/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
  315. package/{es/point/shaders/earth/fill_vert.glsl → lib/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
  316. package/lib/point/shaders/extrude/extrude_frag.glsl +19 -7
  317. package/lib/point/shaders/extrude/extrude_vert.glsl +23 -30
  318. package/{es/point/shaders → lib/point/shaders/fill}/fill_frag.glsl +18 -1
  319. package/lib/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
  320. package/lib/point/shaders/fillImage/fillImage_frag.glsl +24 -0
  321. package/{es/point/shaders/image → lib/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
  322. package/lib/point/shaders/image/image_frag.glsl +42 -0
  323. package/{es/point/shaders → lib/point/shaders/image}/image_vert.glsl +14 -13
  324. package/lib/point/shaders/radar/radar_frag.glsl +19 -14
  325. package/lib/point/shaders/radar/radar_vert.glsl +21 -24
  326. package/lib/point/shaders/text/text_frag.glsl +44 -0
  327. package/lib/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
  328. package/lib/polygon/models/extrude.js +38 -15
  329. package/lib/polygon/models/extrusion.js +24 -7
  330. package/lib/polygon/models/fill.js +26 -13
  331. package/lib/polygon/models/ocean.js +30 -14
  332. package/lib/polygon/models/water.js +26 -10
  333. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
  334. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
  335. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
  336. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
  337. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
  338. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
  339. package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
  340. package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
  341. package/lib/polygon/shaders/fill/fill_frag.glsl +7 -0
  342. package/lib/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
  343. package/{es/polygon/shaders/polygon_linear_vert.glsl → lib/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
  344. package/lib/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
  345. package/lib/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
  346. package/lib/polygon/shaders/ocean/ocean_vert.glsl +22 -0
  347. package/lib/polygon/shaders/water/polygon_water_frag.glsl +14 -12
  348. package/lib/polygon/shaders/water/polygon_water_vert.glsl +10 -10
  349. package/lib/raster/models/raster.js +54 -38
  350. package/lib/raster/models/rasterRgb.js +36 -19
  351. package/lib/raster/models/rasterTerrainRgb.js +2 -2
  352. package/lib/raster/shaders/raster/raster_2d_frag.glsl +34 -0
  353. package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
  354. package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
  355. package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
  356. package/lib/tile/utils/constants.js +1 -1
  357. package/package.json +7 -7
  358. package/es/earth/shaders/atmosphere_vert.glsl +0 -26
  359. package/es/earth/shaders/base_frag.glsl +0 -13
  360. package/es/earth/shaders/base_vert.glsl +0 -52
  361. package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
  362. package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
  363. package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
  364. package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
  365. package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
  366. package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
  367. package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
  368. package/es/line/models/earthArc_3d.d.ts +0 -17
  369. package/es/line/models/earthArc_3d.js +0 -285
  370. package/es/line/models/linearline.d.ts +0 -11
  371. package/es/line/models/linearline.js +0 -241
  372. package/es/line/models/simpleLine.js +0 -194
  373. package/es/line/shaders/arc_chunks.vert.glsl +0 -21
  374. package/es/line/shaders/dash/arc_dash_frag.glsl +0 -21
  375. package/es/line/shaders/dash/arc_dash_vert.glsl +0 -102
  376. package/es/line/shaders/dash/line_dash_frag.glsl +0 -27
  377. package/es/line/shaders/dash/line_dash_vert.glsl +0 -82
  378. package/es/line/shaders/line_arc2d_vert.glsl +0 -114
  379. package/es/line/shaders/line_bezier_vert.glsl +0 -85
  380. package/es/line/shaders/line_vert.glsl +0 -165
  381. package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
  382. package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
  383. package/es/line/shaders/linear/arc_linear_frag.glsl +0 -10
  384. package/es/line/shaders/linear/arc_linear_vert.glsl +0 -98
  385. package/es/line/shaders/linear/line_linear_frag.glsl +0 -25
  386. package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -8
  387. package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -93
  388. package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
  389. package/es/point/shaders/animate/wave_frag.glsl +0 -55
  390. package/es/point/shaders/earth/extrude_frag.glsl +0 -32
  391. package/es/point/shaders/image/fillImage_frag.glsl +0 -18
  392. package/es/point/shaders/image_frag.glsl +0 -37
  393. package/es/point/shaders/text_frag.glsl +0 -39
  394. package/es/polygon/shaders/polygon_frag.glsl +0 -7
  395. package/es/polygon/shaders/polygon_linear_frag.glsl +0 -15
  396. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
  397. package/es/raster/shaders/raster_2d_frag.glsl +0 -32
  398. package/es/raster/shaders/raster_2d_vert.glsl +0 -13
  399. package/es/raster/shaders/raster_frag.glsl +0 -11
  400. package/es/raster/shaders/raster_rgb_frag.glsl +0 -20
  401. package/es/raster/shaders/raster_vert.glsl +0 -34
  402. package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
  403. package/lib/earth/shaders/base_frag.glsl +0 -13
  404. package/lib/earth/shaders/base_vert.glsl +0 -52
  405. package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
  406. package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
  407. package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
  408. package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
  409. package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
  410. package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
  411. package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
  412. package/lib/line/models/earthArc_3d.js +0 -291
  413. package/lib/line/models/linearline.js +0 -247
  414. package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
  415. package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -21
  416. package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -102
  417. package/lib/line/shaders/dash/line_dash_frag.glsl +0 -27
  418. package/lib/line/shaders/dash/line_dash_vert.glsl +0 -82
  419. package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
  420. package/lib/line/shaders/line_bezier_vert.glsl +0 -85
  421. package/lib/line/shaders/line_vert.glsl +0 -165
  422. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
  423. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
  424. package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -10
  425. package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -98
  426. package/lib/line/shaders/linear/line_linear_frag.glsl +0 -25
  427. package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -8
  428. package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -93
  429. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
  430. package/lib/point/shaders/animate/wave_frag.glsl +0 -55
  431. package/lib/point/shaders/earth/extrude_frag.glsl +0 -32
  432. package/lib/point/shaders/image/fillImage_frag.glsl +0 -18
  433. package/lib/point/shaders/image_frag.glsl +0 -37
  434. package/lib/point/shaders/text_frag.glsl +0 -39
  435. package/lib/polygon/shaders/polygon_frag.glsl +0 -7
  436. package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -15
  437. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
  438. package/lib/raster/shaders/raster_2d_frag.glsl +0 -32
  439. package/lib/raster/shaders/raster_2d_vert.glsl +0 -13
  440. package/lib/raster/shaders/raster_frag.glsl +0 -11
  441. package/lib/raster/shaders/raster_rgb_frag.glsl +0 -20
  442. package/lib/raster/shaders/raster_vert.glsl +0 -34
  443. /package/es/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
  444. /package/es/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
  445. /package/es/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
  446. /package/es/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
  447. /package/lib/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
  448. /package/lib/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
  449. /package/lib/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
  450. /package/lib/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
@@ -1,3 +1,4 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
4
  import _initializerDefineProperty from "@babel/runtime/helpers/esm/initializerDefineProperty";
@@ -13,13 +14,15 @@ import { rgb2arr } from '@antv/l7-utils';
13
14
  import { BlendTypes } from "../utils/blend";
14
15
  import { getStencil as _getStencil, getStencilMask } from "../utils/stencil";
15
16
  import { DefaultUniformStyleType, DefaultUniformStyleValue } from "./constant";
17
+ import { MultipleOfFourNumber } from "./utils";
16
18
  import { getCommonStyleAttributeOptions, ShaderLocation } from "./CommonStyleAttribute";
17
19
  var shaderLocationMap = {
18
20
  opacity: ShaderLocation.OPACITY,
19
21
  stroke: ShaderLocation.STROKE,
20
22
  offsets: ShaderLocation.OFFSETS,
21
23
  rotation: ShaderLocation.ROTATION,
22
- extrusionBase: ShaderLocation.EXTRUSION_BASE
24
+ extrusionBase: ShaderLocation.EXTRUSION_BASE,
25
+ thetaOffset: 15
23
26
  };
24
27
 
25
28
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -32,6 +35,9 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
32
35
 
33
36
  // @lazyInject(TYPES.IShaderModuleService)
34
37
 
38
+ // 支持数据映射的buffer
39
+ // 不支持数据映射的buffer
40
+
35
41
  // style texture data mapping
36
42
 
37
43
  function BaseModel(layer) {
@@ -109,10 +115,21 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
109
115
  value: function getDefaultStyle() {
110
116
  return {};
111
117
  }
118
+ // public getUninforms(): IModelUniform {
119
+ // throw new Error('Method not implemented.');
120
+ // }
112
121
  }, {
113
122
  key: "getUninforms",
114
123
  value: function getUninforms() {
115
- throw new Error('Method not implemented.');
124
+ var commoninfo = this.getCommonUniformsInfo();
125
+ var attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
126
+ this.updateStyleUnifoms();
127
+ var result = _objectSpread(_objectSpread({}, attributeInfo.uniformsOption), commoninfo.uniformsOption);
128
+ //如果是regl渲染 需要在uniform中带上u_texture 暂时用this.rendererService.device判断
129
+ if (!this.rendererService.hasOwnProperty('device') && this.textures && this.textures.length === 1) {
130
+ result['u_texture'] = this.textures[0];
131
+ }
132
+ return result;
116
133
  }
117
134
  }, {
118
135
  key: "getAnimateUniforms",
@@ -212,6 +229,8 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
212
229
  this.layer.setAnimateStartTime();
213
230
  }
214
231
  }
232
+
233
+ // 动态注入参与数据映射的uniform
215
234
  }, {
216
235
  key: "getInject",
217
236
  value: function getInject() {
@@ -230,6 +249,10 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
230
249
  } else {
231
250
  uniforms.push(" ".concat(DefaultUniformStyleType[key], " u_").concat(key, ";"));
232
251
  }
252
+ var location = shaderLocationMap[key];
253
+ if (!location && key === 'THETA_OFFSET') {
254
+ location = 15;
255
+ }
233
256
  str += "\n #ifdef USE_ATTRIBUTE_".concat(key.toUpperCase(), "\n layout(location = ").concat(shaderLocationMap[key], ") in ").concat(DefaultUniformStyleType[key], " a_").concat(key.charAt(0).toUpperCase() + key.slice(1), ";\n #endif\n\n ");
234
257
  });
235
258
  var attributeUniforms = uniforms.length ? "\nlayout(std140) uniform AttributeUniforms {\n".concat(uniforms.join('\n'), "\n};\n ") : '';
@@ -286,6 +309,80 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
286
309
  value: function updateEncodeAttribute(type, flag) {
287
310
  this.encodeStyleAttribute[type] = flag;
288
311
  }
312
+ }, {
313
+ key: "initUniformsBuffer",
314
+ value: function initUniformsBuffer() {
315
+ var attrUniforms = this.getUniformsBufferInfo(this.getStyleAttribute());
316
+ var commonUniforms = this.getCommonUniformsInfo();
317
+ if (attrUniforms.uniformsLength !== 0) {
318
+ this.attributeUnifoms = this.rendererService.createBuffer({
319
+ data: new Float32Array(MultipleOfFourNumber(attrUniforms.uniformsLength)).fill(0),
320
+ // 长度需要大于等于 4
321
+ isUBO: true
322
+ });
323
+ this.uniformBuffers.push(this.attributeUnifoms);
324
+ }
325
+ if (commonUniforms.uniformsLength !== 0) {
326
+ this.commonUnifoms = this.rendererService.createBuffer({
327
+ data: new Float32Array(MultipleOfFourNumber(commonUniforms.uniformsLength)).fill(0),
328
+ isUBO: true
329
+ });
330
+ this.uniformBuffers.push(this.commonUnifoms);
331
+ }
332
+ }
333
+ // 获取数据映射 uniform 信息
334
+ }, {
335
+ key: "getUniformsBufferInfo",
336
+ value: function getUniformsBufferInfo(uniformsOption) {
337
+ var uniformsLength = 0;
338
+ var uniformsArray = [];
339
+ Object.values(uniformsOption).forEach(function (value) {
340
+ if (Array.isArray(value)) {
341
+ uniformsArray.push.apply(uniformsArray, _toConsumableArray(value));
342
+ uniformsLength += value.length;
343
+ } else if (typeof value === 'number') {
344
+ // 排除纹理
345
+ uniformsArray.push(value);
346
+ uniformsLength += 1;
347
+ } else if (typeof value === 'boolean') {
348
+ uniformsArray.push(Number(value));
349
+ uniformsLength += 1;
350
+ }
351
+ });
352
+ return {
353
+ uniformsOption: uniformsOption,
354
+ uniformsLength: uniformsLength,
355
+ uniformsArray: uniformsArray
356
+ };
357
+ }
358
+ }, {
359
+ key: "getCommonUniformsInfo",
360
+ value: function getCommonUniformsInfo() {
361
+ return {
362
+ uniformsLength: 0,
363
+ uniformsArray: [],
364
+ uniformsOption: {}
365
+ };
366
+ }
367
+
368
+ // 更新支持数据映射的uniform
369
+ }, {
370
+ key: "updateStyleUnifoms",
371
+ value: function updateStyleUnifoms() {
372
+ var _this$attributeUnifom, _this$commonUnifoms;
373
+ var _this$getUniformsBuff = this.getUniformsBufferInfo(this.getStyleAttribute()),
374
+ uniformsArray = _this$getUniformsBuff.uniformsArray;
375
+ var _this$getCommonUnifor = this.getCommonUniformsInfo(),
376
+ commonUniformsArray = _this$getCommonUnifor.uniformsArray;
377
+ (_this$attributeUnifom = this.attributeUnifoms) === null || _this$attributeUnifom === void 0 || _this$attributeUnifom.subData({
378
+ offset: 0,
379
+ data: new Uint8Array(new Float32Array(uniformsArray).buffer)
380
+ });
381
+ (_this$commonUnifoms = this.commonUnifoms) === null || _this$commonUnifoms === void 0 || _this$commonUnifoms.subData({
382
+ offset: 0,
383
+ data: new Uint8Array(new Float32Array(commonUniformsArray).buffer)
384
+ });
385
+ }
289
386
  }]);
290
387
  return BaseModel;
291
388
  }(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "configService", [_dec], {
@@ -1,4 +1,4 @@
1
- import { IStyleAttribute } from '@antv/l7-core';
1
+ import type { IStyleAttribute } from '@antv/l7-core';
2
2
  export declare enum ShaderLocation {
3
3
  POSITION = 0,
4
4
  COLOR = 1,
@@ -12,6 +12,9 @@ export declare enum ShaderLocation {
12
12
  SIZE = 9,
13
13
  SHAPE = 10,
14
14
  EXTRUDE = 11,
15
- MAX = 12
15
+ MAX = 12,
16
+ NORMAL = 13,
17
+ UV = 14,
18
+ LINEAR = 15
16
19
  }
17
20
  export declare function getCommonStyleAttributeOptions(name: string): Partial<IStyleAttribute> | undefined;
@@ -13,6 +13,9 @@ export var ShaderLocation = /*#__PURE__*/function (ShaderLocation) {
13
13
  ShaderLocation[ShaderLocation["SHAPE"] = 10] = "SHAPE";
14
14
  ShaderLocation[ShaderLocation["EXTRUDE"] = 11] = "EXTRUDE";
15
15
  ShaderLocation[ShaderLocation["MAX"] = 12] = "MAX";
16
+ ShaderLocation[ShaderLocation["NORMAL"] = 13] = "NORMAL";
17
+ ShaderLocation[ShaderLocation["UV"] = 14] = "UV";
18
+ ShaderLocation[ShaderLocation["LINEAR"] = 15] = "LINEAR";
16
19
  return ShaderLocation;
17
20
  }({});
18
21
  export function getCommonStyleAttributeOptions(name) {
@@ -127,6 +130,7 @@ export function getCommonStyleAttributeOptions(name) {
127
130
  type: AttributeType.Attribute,
128
131
  descriptor: {
129
132
  name: 'a_ThetaOffset',
133
+ shaderLocation: 15,
130
134
  buffer: {
131
135
  // give the WebGL driver a hint that this buffer may change
132
136
  usage: gl.STATIC_DRAW,
@@ -1,4 +1,4 @@
1
- import { IInteractionTarget, ILayer, ILayerPickService, IMapService } from '@antv/l7-core';
1
+ import type { IInteractionTarget, ILayer, ILayerPickService, IMapService } from '@antv/l7-core';
2
2
  export default class BaseLayerPickService implements ILayerPickService {
3
3
  private layer;
4
4
  constructor(layer: ILayer);
@@ -1,5 +1,5 @@
1
- import { ILayer, ITexture2D, ITextureService } from '@antv/l7-core';
2
- import { IColorRamp } from '@antv/l7-utils';
1
+ import type { ILayer, ITexture2D, ITextureService } from '@antv/l7-core';
2
+ import type { IColorRamp } from '@antv/l7-utils';
3
3
  export default class TextureService implements ITextureService {
4
4
  private layer;
5
5
  private rendererService;
@@ -1,6 +1,6 @@
1
- import { IAnimateOption, IMapService, ITexture2D, StyleAttributeField, StyleAttributeOption } from '@antv/l7-core';
2
- import { IColorRamp } from '@antv/l7-utils';
3
- import { anchorType } from '../utils/symbol-layout';
1
+ import type { IAnimateOption, IMapService, ITexture2D, StyleAttributeField, StyleAttributeOption } from '@antv/l7-core';
2
+ import type { IColorRamp } from '@antv/l7-utils';
3
+ import type { anchorType } from '../utils/symbol-layout';
4
4
  export declare enum lineStyleType {
5
5
  'solid' = 0,
6
6
  'dash' = 1
@@ -147,6 +147,10 @@ export interface IImageLayerStyleOptions extends IBaseLayerStyleOptions {
147
147
  clampHigh?: boolean;
148
148
  rampColors?: IColorRamp;
149
149
  colorTexture?: ITexture2D;
150
+ brightness?: number;
151
+ contrast?: number;
152
+ saturation?: number;
153
+ gamma?: number;
150
154
  }
151
155
  export interface ICityBuildLayerStyleOptions {
152
156
  opacity: number;
@@ -13,7 +13,6 @@ export var TextureBlend = /*#__PURE__*/function (TextureBlend) {
13
13
  TextureBlend["REPLACE"] = "replace";
14
14
  return TextureBlend;
15
15
  }({});
16
-
17
16
  /**
18
17
  * 基础图层类型定义
19
18
  */
@@ -1,4 +1,4 @@
1
- import { IEncodeFeature } from '@antv/l7-core';
1
+ import type { IEncodeFeature } from '@antv/l7-core';
2
2
  export declare function FlowHalfArrowFillTriangulation(feature: IEncodeFeature): {
3
3
  vertices: number[];
4
4
  normals: number[];
@@ -1,4 +1,4 @@
1
- import { ArrowType, IArrowOptions, ILineSymbol } from '../interface';
1
+ import type { ArrowType, IArrowOptions, ILineSymbol } from '../interface';
2
2
  export interface IArrowData {
3
3
  vertices: number[];
4
4
  indices: number[];
@@ -1,4 +1,4 @@
1
- import { IPath } from './Path';
1
+ import type { IPath } from './Path';
2
2
  export interface IExtrudeGeomety {
3
3
  positions: number[];
4
4
  index: number[];
@@ -1,4 +1,4 @@
1
- import { IEncodeFeature } from '@antv/l7-core';
1
+ import type { IEncodeFeature } from '@antv/l7-core';
2
2
  /**
3
3
  * 计算2D 填充点图顶点
4
4
  * @param feature 映射feature
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
- import { calculateCentroid, calculatePointsCenterAndRadius, lngLatToMeters } from '@antv/l7-utils';
3
+ import { calculateCentroid, calculatePointsCenterAndRadius, lngLatToMeters, aProjectFlat } from '@antv/l7-utils';
4
4
  import earcut from 'earcut';
5
5
  // @ts-ignore
6
6
  import { vec3 } from 'gl-matrix';
@@ -162,7 +162,8 @@ export function FlowLineFillTriangulation(feature) {
162
162
  };
163
163
  }
164
164
  export function SimpleLineTriangulation(feature) {
165
- var coordinates = feature.coordinates;
165
+ var coordinates = feature.coordinates,
166
+ originCoordinates = feature.originCoordinates;
166
167
  var pos = [];
167
168
  if (!Array.isArray(coordinates[0])) {
168
169
  return {
@@ -173,7 +174,7 @@ export function SimpleLineTriangulation(feature) {
173
174
  count: 0
174
175
  };
175
176
  }
176
- var _getSimpleLineVertice = getSimpleLineVertices(coordinates),
177
+ var _getSimpleLineVertice = getSimpleLineVertices(coordinates, originCoordinates),
177
178
  results = _getSimpleLineVertice.results,
178
179
  totalDistance = _getSimpleLineVertice.totalDistance;
179
180
  results.map(function (point) {
@@ -224,12 +225,17 @@ function pushDis(point, n) {
224
225
  }
225
226
  return point;
226
227
  }
227
- function getSimpleLineVertices(coordinates) {
228
+ function getSimpleLineVertices(coordinates, originCoordinates) {
228
229
  var points = coordinates;
230
+ //除了amap2.0以外 coordinates就是经纬度数据
231
+ var originPoints = originCoordinates || coordinates;
229
232
  if (Array.isArray(points) && Array.isArray(points[0]) && Array.isArray(points[0][0])) {
230
233
  // @ts-ignore
231
- points = coordinates.flat();
234
+ points = originCoordinates.flat();
235
+ // @ts-ignore
236
+ originPoints = originCoordinates.flat();
232
237
  }
238
+ //修改计算距离的方式,与普通线的计算方式保持一致 edit by huyang 20231214
233
239
  var distance = 0;
234
240
  if (points.length < 2) {
235
241
  return {
@@ -241,13 +247,13 @@ function getSimpleLineVertices(coordinates) {
241
247
  var point = pushDis(points[0], distance);
242
248
  results.push(point);
243
249
  for (var i = 1; i < points.length - 1; i++) {
244
- var subDistance = lineSegmentDistance(points[i - 1], points[i]);
250
+ var subDistance = lineSegmentDistance(aProjectFlat(originPoints[i - 1]), aProjectFlat(originPoints[i]));
245
251
  distance += subDistance;
246
252
  var mulPoint = pushDis(points[i], distance);
247
253
  results.push(mulPoint);
248
254
  results.push(mulPoint);
249
255
  }
250
- var pointDistance = lineSegmentDistance(points[points.length - 2], points[points.length - 1]);
256
+ var pointDistance = lineSegmentDistance(aProjectFlat(originPoints[originPoints.length - 2]), aProjectFlat(originPoints[originPoints.length - 1]));
251
257
  distance += pointDistance;
252
258
  results.push(pushDis(points[points.length - 1], distance));
253
259
  return {
@@ -0,0 +1,4 @@
1
+ export declare function formatUniformsOption2Std140(uniformsOption: {
2
+ [key: string]: any;
3
+ }): string;
4
+ export declare function MultipleOfFourNumber(num: number): number;
@@ -0,0 +1,15 @@
1
+ export function formatUniformsOption2Std140(uniformsOption) {
2
+ var std140_str = '';
3
+ Object.keys(uniformsOption).forEach(function (key) {
4
+ var value = uniformsOption[key];
5
+ if (Array.isArray(value)) {
6
+ std140_str += "vec".concat(value.length, " ").concat(key, ";\n");
7
+ } else {
8
+ std140_str += "flot ".concat(key, ";\n");
9
+ }
10
+ });
11
+ return std140_str;
12
+ }
13
+ export function MultipleOfFourNumber(num) {
14
+ return Math.max(Math.ceil(num / 4) * 4, 4);
15
+ }
@@ -1,4 +1,4 @@
1
- import { ISourceCFG } from '@antv/l7-core';
1
+ import type { ISourceCFG } from '@antv/l7-core';
2
2
  import BaseLayer from '../core/BaseLayer';
3
3
  interface IEarthLayerStyleOptions {
4
4
  opacity: number;
@@ -1,7 +1,13 @@
1
- import { IModel, IModelUniform } from '@antv/l7-core';
1
+ import type { IModel } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class EarthAtomSphereModel extends BaseModel {
4
- getUninforms(): IModelUniform;
4
+ protected getCommonUniformsInfo(): {
5
+ uniformsArray: number[];
6
+ uniformsLength: number;
7
+ uniformsOption: {
8
+ [key: string]: any;
9
+ };
10
+ };
5
11
  initModels(): Promise<IModel[]>;
6
12
  clearModels(): string;
7
13
  buildModels(): Promise<IModel[]>;
@@ -11,10 +11,11 @@ import { AttributeType, gl } from '@antv/l7-core';
11
11
  import { lodashUtil } from '@antv/l7-utils';
12
12
  import BaseModel from "../../core/BaseModel";
13
13
  import { earthTriangulation } from "../../core/triangulation";
14
- /* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
15
- var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
16
- /* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
17
- var atmoSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nvarying float v_CamreaDistance;\n\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\nvarying float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
14
+ /* babel-plugin-inline-import '../shaders/atmosphere/atmosphere_frag.glsl' */
15
+ var atmoSphereFrag = "\nlayout(std140) uniform commonUniforms {\n float u_opacity;\n};\nin vec3 vVertexNormal;\nin float v_offset;\nin vec4 v_Color;\n\n#pragma include \"scene_uniforms\"\nout vec4 outputColor;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n outputColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
16
+ /* babel-plugin-inline-import '../shaders/atmosphere/atmosphere_vert.glsl' */
17
+ var atmoSphereVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 1) vec4 a_Color;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_Uv;\nlayout(std140) uniform commonUniforms {\n float u_opacity;\n};\n#pragma include \"scene_uniforms\"\nout vec3 vVertexNormal;\nout vec4 v_Color;\nout float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
18
+ import { ShaderLocation } from "../../core/CommonStyleAttribute";
18
19
  var isNumber = lodashUtil.isNumber;
19
20
  var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
20
21
  _inherits(EarthAtomSphereModel, _BaseModel);
@@ -24,14 +25,16 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
24
25
  return _super.apply(this, arguments);
25
26
  }
26
27
  _createClass(EarthAtomSphereModel, [{
27
- key: "getUninforms",
28
- value: function getUninforms() {
28
+ key: "getCommonUniformsInfo",
29
+ value: function getCommonUniformsInfo() {
29
30
  var _ref = this.layer.getLayerConfig(),
30
31
  _ref$opacity = _ref.opacity,
31
32
  opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
32
- return {
33
+ var commonOptions = {
33
34
  u_opacity: isNumber(opacity) ? opacity : 1.0
34
35
  };
36
+ var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
37
+ return commonBufferInfo;
35
38
  }
36
39
  }, {
37
40
  key: "initModels",
@@ -40,8 +43,9 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
40
43
  return _regeneratorRuntime.wrap(function _callee$(_context) {
41
44
  while (1) switch (_context.prev = _context.next) {
42
45
  case 0:
46
+ this.initUniformsBuffer();
43
47
  return _context.abrupt("return", this.buildModels());
44
- case 1:
48
+ case 2:
45
49
  case "end":
46
50
  return _context.stop();
47
51
  }
@@ -101,6 +105,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
101
105
  type: AttributeType.Attribute,
102
106
  descriptor: {
103
107
  name: 'a_Size',
108
+ shaderLocation: ShaderLocation.SIZE,
104
109
  buffer: {
105
110
  usage: gl.DYNAMIC_DRAW,
106
111
  data: [],
@@ -119,6 +124,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
119
124
  type: AttributeType.Attribute,
120
125
  descriptor: {
121
126
  name: 'a_Normal',
127
+ shaderLocation: ShaderLocation.NORMAL,
122
128
  buffer: {
123
129
  usage: gl.STATIC_DRAW,
124
130
  data: [],
@@ -135,6 +141,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
135
141
  type: AttributeType.Attribute,
136
142
  descriptor: {
137
143
  name: 'a_Uv',
144
+ shaderLocation: ShaderLocation.UV,
138
145
  buffer: {
139
146
  usage: gl.DYNAMIC_DRAW,
140
147
  data: [],
@@ -1,4 +1,4 @@
1
- import { IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
1
+ import type { IModel, ITexture2D } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class BaseEarthModel extends BaseModel {
4
4
  protected texture: ITexture2D;
@@ -7,7 +7,13 @@ export default class BaseEarthModel extends BaseModel {
7
7
  private sunY;
8
8
  private sunZ;
9
9
  private sunRadius;
10
- getUninforms(): IModelUniform;
10
+ protected getCommonUniformsInfo(): {
11
+ uniformsArray: number[];
12
+ uniformsLength: number;
13
+ uniformsOption: {
14
+ [key: string]: any;
15
+ };
16
+ };
11
17
  setEarthTime(time: number): void;
12
18
  initModels(): Promise<IModel[]>;
13
19
  clearModels(): string;
@@ -12,10 +12,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
12
12
  import { AttributeType, gl } from '@antv/l7-core';
13
13
  import BaseModel from "../../core/BaseModel";
14
14
  import { earthTriangulation } from "../../core/triangulation";
15
- /* babel-plugin-inline-import '../shaders/base_frag.glsl' */
16
- var baseFrag = "\nuniform sampler2D u_texture;\n\nvarying vec2 v_texCoord;\nvarying float v_lightWeight;\n\n\nvoid main() {\n\n vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\n color.xyz = color.xyz * v_lightWeight;\n gl_FragColor = color;\n}\n";
17
- /* babel-plugin-inline-import '../shaders/base_vert.glsl' */
18
- var baseVert = "// attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\n// attribute vec2 a_Extrude;\n// attribute float a_Size;\n// attribute float a_Shape;\n\nuniform vec3 u_CameraPosition;\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform float u_ambientRatio : 0.5;\nuniform float u_diffuseRatio : 0.3;\nuniform float u_specularRatio : 0.2;\nuniform vec3 u_sunLight: [1.0, -10.5, 12.0];\n\n\n\nfloat calc_lighting(vec4 pos) {\n\n vec3 worldPos = vec3(pos * u_ModelMatrix);\n\n vec3 worldNormal = a_Normal;\n\n // cal light weight\n vec3 viewDir = normalize(u_CameraPosition - worldPos);\n\n vec3 lightDir = normalize(u_sunLight);\n\n vec3 halfDir = normalize(viewDir+lightDir);\n // lambert\n float lambert = dot(worldNormal, lightDir);\n // specular\n float specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\n //sum to light weight\n float lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular;\n\n return lightWeight;\n}\n\nvarying float v_lightWeight;\nvoid main() {\n\n v_texCoord = a_Uv;\n\n float lightWeight = calc_lighting(vec4(a_Position, 1.0));\n v_lightWeight = lightWeight;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
15
+ /* babel-plugin-inline-import '../shaders/base/base_frag.glsl' */
16
+ var baseFrag = "uniform sampler2D u_texture;\n\nin vec2 v_texCoord;\nin float v_lightWeight;\nout vec4 outputColor;\n\nvoid main() {\n vec4 color = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y));\n color.xyz = color.xyz * v_lightWeight;\n outputColor = color;\n}\n";
17
+ /* babel-plugin-inline-import '../shaders/base/base_vert.glsl' */
18
+ var baseVert = "// attribute vec4 a_Color;\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_Uv;\n\n// attribute vec2 a_Extrude;\n// attribute float a_Size;\n// attribute float a_Shape;\n\nlayout(std140) uniform commonUniforms {\n\tvec4 u_sunLight: [1.0, -10.5, 12.0,0.0];\n\tfloat u_ambientRatio : 0.5;\n\tfloat u_diffuseRatio : 0.3;\n\tfloat u_specularRatio : 0.2;\n};\n\n#pragma include \"scene_uniforms\"\n\nout vec2 v_texCoord;\nout float v_lightWeight;\n\nfloat calc_lighting(vec4 pos) {\n\n\tvec3 worldPos = vec3(pos * u_ModelMatrix);\n\n\tvec3 worldNormal = a_Normal;\n\n\t// cal light weight\n\tvec3 viewDir = normalize(u_CameraPosition - worldPos);\n\n\tvec3 lightDir = normalize(u_sunLight.xyz);\n\n\tvec3 halfDir = normalize(viewDir+lightDir);\n\t// lambert\n\tfloat lambert = dot(worldNormal, lightDir);\n\t// specular\n\tfloat specular = pow(max(0.0, dot(worldNormal, halfDir)), 32.0);\n\t//sum to light weight\n\tfloat lightWeight = u_ambientRatio + u_diffuseRatio * lambert + u_specularRatio * specular;\n\n\treturn lightWeight;\n}\n\nvoid main() {\n\n\tv_texCoord = a_Uv;\n\n\tfloat lightWeight = calc_lighting(vec4(a_Position, 1.0));\n\tv_lightWeight = lightWeight;\n\n\tgl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
19
+ import { ShaderLocation } from "../../core/CommonStyleAttribute";
19
20
  var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
20
21
  _inherits(BaseEarthModel, _BaseModel);
21
22
  var _super = _createSuper(BaseEarthModel);
@@ -35,8 +36,8 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
35
36
  return _this;
36
37
  }
37
38
  _createClass(BaseEarthModel, [{
38
- key: "getUninforms",
39
- value: function getUninforms() {
39
+ key: "getCommonUniformsInfo",
40
+ value: function getCommonUniformsInfo() {
40
41
  var _this$layer$getLayerC = this.layer.getLayerConfig(),
41
42
  animateOption = _this$layer$getLayerC.animateOption,
42
43
  globalOptions = _this$layer$getLayerC.globalOptions;
@@ -51,16 +52,19 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
51
52
  this.sunX = Math.cos(this.earthTime) * (this.sunRadius - this.sunY);
52
53
  this.sunZ = Math.sin(this.earthTime) * (this.sunRadius - this.sunY);
53
54
  }
54
- return {
55
+ var commonOptions = {
56
+ u_sunLight: [this.sunX, this.sunY, this.sunZ, 0.0],
55
57
  u_ambientRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.ambientRatio) || 0.6,
56
58
  // 环境光
57
59
  u_diffuseRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.diffuseRatio) || 0.4,
58
60
  // 漫反射
59
- u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1,
60
- // 高光反射
61
- u_sunLight: [this.sunX, this.sunY, this.sunZ],
62
- u_texture: this.texture
61
+ u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1 // 高光反射
62
+ // u_texture: this.texture,
63
63
  };
64
+
65
+ this.textures = [this.texture];
66
+ var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
67
+ return commonBufferInfo;
64
68
  }
65
69
  }, {
66
70
  key: "setEarthTime",
@@ -96,10 +100,12 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
96
100
  width: imageData[0].width,
97
101
  height: imageData[0].height
98
102
  });
103
+ _this2.textures = [_this2.texture];
99
104
  _this2.layerService.reRender();
100
105
  });
106
+ this.initUniformsBuffer();
101
107
  return _context.abrupt("return", this.buildModels());
102
- case 7:
108
+ case 8:
103
109
  case "end":
104
110
  return _context.stop();
105
111
  }
@@ -158,6 +164,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
158
164
  type: AttributeType.Attribute,
159
165
  descriptor: {
160
166
  name: 'a_Size',
167
+ shaderLocation: ShaderLocation.SIZE,
161
168
  buffer: {
162
169
  usage: gl.DYNAMIC_DRAW,
163
170
  data: [],
@@ -176,6 +183,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
176
183
  type: AttributeType.Attribute,
177
184
  descriptor: {
178
185
  name: 'a_Normal',
186
+ shaderLocation: ShaderLocation.NORMAL,
179
187
  buffer: {
180
188
  usage: gl.STATIC_DRAW,
181
189
  data: [],
@@ -192,6 +200,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
192
200
  type: AttributeType.Attribute,
193
201
  descriptor: {
194
202
  name: 'a_Uv',
203
+ shaderLocation: ShaderLocation.UV,
195
204
  buffer: {
196
205
  // give the WebGL driver a hint that this buffer may change
197
206
  usage: gl.DYNAMIC_DRAW,
@@ -1,7 +1,13 @@
1
- import { IModel, IModelUniform } from '@antv/l7-core';
1
+ import type { IModel } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class EarthBloomSphereModel extends BaseModel {
4
- getUninforms(): IModelUniform;
4
+ protected getCommonUniformsInfo(): {
5
+ uniformsArray: number[];
6
+ uniformsLength: number;
7
+ uniformsOption: {
8
+ [key: string]: any;
9
+ };
10
+ };
5
11
  initModels(): Promise<IModel[]>;
6
12
  clearModels(): string;
7
13
  buildModels(): Promise<IModel[]>;