@antv/l7-layers 2.20.5 → 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 (447) 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 +53 -9
  8. package/es/core/BaseModel.d.ts +1 -1
  9. package/es/core/BaseModel.js +41 -15
  10. package/es/core/CommonStyleAttribute.d.ts +4 -2
  11. package/es/core/CommonStyleAttribute.js +3 -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.js +1 -1
  22. package/es/earth/index.d.ts +1 -1
  23. package/es/earth/models/atmosphere.d.ts +8 -2
  24. package/es/earth/models/atmosphere.js +15 -8
  25. package/es/earth/models/base.d.ts +8 -2
  26. package/es/earth/models/base.js +21 -12
  27. package/es/earth/models/bloomsphere.d.ts +8 -2
  28. package/es/earth/models/bloomsphere.js +15 -8
  29. package/es/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
  30. package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
  31. package/es/earth/shaders/base/base_frag.glsl +11 -0
  32. package/es/earth/shaders/base/base_vert.glsl +52 -0
  33. package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
  34. package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
  35. package/es/geometry/index.d.ts +2 -2
  36. package/es/geometry/models/billboard.d.ts +8 -1
  37. package/es/geometry/models/billboard.js +26 -11
  38. package/es/geometry/models/plane.d.ts +8 -1
  39. package/es/geometry/models/plane.js +23 -6
  40. package/es/geometry/models/sprite.d.ts +12 -2
  41. package/es/geometry/models/sprite.js +44 -18
  42. package/es/geometry/shaders/billboard_frag.glsl +11 -6
  43. package/es/geometry/shaders/billboard_vert.glsl +12 -15
  44. package/es/geometry/shaders/plane_frag.glsl +14 -10
  45. package/es/geometry/shaders/plane_vert.glsl +11 -10
  46. package/es/geometry/shaders/sprite_frag.glsl +11 -7
  47. package/es/geometry/shaders/sprite_vert.glsl +10 -9
  48. package/es/heatmap/index.d.ts +3 -3
  49. package/es/heatmap/models/grid.d.ts +8 -1
  50. package/es/heatmap/models/grid.js +25 -12
  51. package/es/heatmap/models/grid3d.d.ts +8 -1
  52. package/es/heatmap/models/grid3d.js +29 -13
  53. package/es/heatmap/models/heatmap.d.ts +6 -4
  54. package/es/heatmap/models/heatmap.js +123 -75
  55. package/es/heatmap/models/hexagon.d.ts +8 -1
  56. package/es/heatmap/models/hexagon.js +25 -12
  57. package/es/heatmap/shaders/grid/grid_frag.glsl +8 -0
  58. package/es/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
  59. package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
  60. package/{lib/heatmap/shaders/hexagon_3d_vert.glsl → es/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
  61. package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
  62. package/es/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
  63. package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
  64. package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
  65. package/{lib/heatmap/shaders → es/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
  66. package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
  67. package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
  68. package/es/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
  69. package/es/image/index.d.ts +2 -2
  70. package/es/image/models/image.d.ts +9 -2
  71. package/es/image/models/image.js +83 -44
  72. package/es/image/shaders/image_frag.glsl +34 -7
  73. package/es/image/shaders/image_vert.glsl +11 -5
  74. package/es/line/index.d.ts +4 -4
  75. package/es/line/index.js +2 -1
  76. package/es/line/models/arc.d.ts +8 -3
  77. package/es/line/models/arc.js +57 -76
  78. package/es/line/models/arc_3d.d.ts +8 -3
  79. package/es/line/models/arc_3d.js +46 -57
  80. package/es/line/models/flow.d.ts +8 -2
  81. package/es/line/models/flow.js +14 -12
  82. package/es/line/models/great_circle.d.ts +8 -3
  83. package/es/line/models/great_circle.js +40 -29
  84. package/es/line/models/index.d.ts +1 -1
  85. package/es/line/models/index.js +3 -6
  86. package/es/line/models/line.d.ts +8 -3
  87. package/es/line/models/line.js +67 -140
  88. package/es/line/models/{simpleLine.d.ts → simple_line.d.ts} +8 -2
  89. package/es/line/models/simple_line.js +204 -0
  90. package/es/line/models/wall.d.ts +8 -3
  91. package/es/line/models/wall.js +35 -27
  92. package/es/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
  93. package/es/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
  94. package/es/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
  95. package/{lib/line/shaders → es/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
  96. package/es/line/shaders/flow/flow_line_frag.glsl +5 -4
  97. package/es/line/shaders/flow/flow_line_vert.glsl +17 -18
  98. package/es/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
  99. package/{lib/line/shaders → es/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
  100. package/es/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
  101. package/es/line/shaders/line/line_vert.glsl +114 -0
  102. package/es/line/shaders/simple/simpleline_frag.glsl +27 -3
  103. package/es/line/shaders/simple/simpleline_vert.glsl +20 -20
  104. package/es/line/shaders/wall/wall_frag.glsl +31 -26
  105. package/es/line/shaders/wall/wall_vert.glsl +29 -22
  106. package/es/mask/index.d.ts +2 -2
  107. package/es/mask/models/fill.d.ts +1 -1
  108. package/es/plugins/DataMappingPlugin.d.ts +1 -1
  109. package/es/plugins/DataMappingPlugin.js +1 -3
  110. package/es/plugins/DataSourcePlugin.d.ts +1 -1
  111. package/es/plugins/FeatureScalePlugin.d.ts +1 -1
  112. package/es/plugins/FeatureScalePlugin.js +14 -3
  113. package/es/plugins/LayerAnimateStylePlugin.d.ts +1 -1
  114. package/es/plugins/LayerMaskPlugin.d.ts +1 -1
  115. package/es/plugins/LayerModelPlugin.d.ts +1 -1
  116. package/es/plugins/LayerStylePlugin.d.ts +1 -1
  117. package/es/plugins/LightingPlugin.d.ts +1 -1
  118. package/es/plugins/MultiPassRendererPlugin.d.ts +1 -1
  119. package/es/plugins/PixelPickingPlugin.d.ts +6 -2
  120. package/es/plugins/PixelPickingPlugin.js +36 -49
  121. package/es/plugins/RegisterStyleAttributePlugin.d.ts +1 -1
  122. package/es/plugins/ShaderUniformPlugin.d.ts +1 -1
  123. package/es/plugins/ShaderUniformPlugin.js +11 -6
  124. package/es/plugins/UpdateModelPlugin.d.ts +1 -1
  125. package/es/plugins/UpdateStyleAttributePlugin.d.ts +1 -1
  126. package/es/point/index.d.ts +2 -2
  127. package/es/point/index.js +1 -0
  128. package/es/point/models/billboard_point.d.ts +9 -3
  129. package/es/point/models/billboard_point.js +18 -18
  130. package/es/point/models/earthExtrude.d.ts +7 -12
  131. package/es/point/models/earthExtrude.js +21 -13
  132. package/es/point/models/earthFill.d.ts +8 -3
  133. package/es/point/models/earthFill.js +18 -30
  134. package/es/point/models/extrude.d.ts +1 -4
  135. package/es/point/models/extrude.js +2 -11
  136. package/es/point/models/fill.d.ts +8 -2
  137. package/es/point/models/fill.js +33 -84
  138. package/es/point/models/{fillmage.d.ts → fillImage.d.ts} +8 -2
  139. package/es/point/models/{fillmage.js → fillImage.js} +23 -15
  140. package/es/point/models/image.d.ts +8 -1
  141. package/es/point/models/image.js +31 -17
  142. package/es/point/models/index.js +1 -1
  143. package/es/point/models/normal.d.ts +9 -3
  144. package/es/point/models/normal.js +13 -30
  145. package/es/point/models/radar.d.ts +8 -2
  146. package/es/point/models/radar.js +23 -45
  147. package/es/point/models/text.d.ts +9 -2
  148. package/es/point/models/text.js +31 -32
  149. package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
  150. package/{lib/point/shaders → es/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
  151. package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
  152. package/{lib/point/shaders/earth/extrude_vert.glsl → es/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
  153. package/{lib/point/shaders/earth/fill_frag.glsl → es/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
  154. package/{lib/point/shaders/earth/fill_vert.glsl → es/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
  155. package/es/point/shaders/extrude/extrude_vert.glsl +0 -3
  156. package/{lib/point/shaders → es/point/shaders/fill}/fill_frag.glsl +18 -1
  157. package/es/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
  158. package/es/point/shaders/fillImage/fillImage_frag.glsl +24 -0
  159. package/{lib/point/shaders/image → es/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
  160. package/es/point/shaders/image/image_frag.glsl +42 -0
  161. package/{lib/point/shaders → es/point/shaders/image}/image_vert.glsl +14 -13
  162. package/es/point/shaders/radar/radar_frag.glsl +19 -14
  163. package/es/point/shaders/radar/radar_vert.glsl +21 -24
  164. package/es/point/shaders/text/text_frag.glsl +44 -0
  165. package/es/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
  166. package/es/point/shape/extrude.d.ts +1 -1
  167. package/es/polygon/index.d.ts +2 -2
  168. package/es/polygon/models/extrude.d.ts +9 -9
  169. package/es/polygon/models/extrude.js +38 -15
  170. package/es/polygon/models/extrusion.d.ts +8 -1
  171. package/es/polygon/models/extrusion.js +24 -7
  172. package/es/polygon/models/fill.d.ts +9 -4
  173. package/es/polygon/models/fill.js +26 -13
  174. package/es/polygon/models/ocean.d.ts +9 -7
  175. package/es/polygon/models/ocean.js +30 -14
  176. package/es/polygon/models/water.d.ts +9 -4
  177. package/es/polygon/models/water.js +26 -10
  178. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
  179. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
  180. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
  181. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
  182. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
  183. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
  184. package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
  185. package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
  186. package/es/polygon/shaders/fill/fill_frag.glsl +7 -0
  187. package/es/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
  188. package/{lib/polygon/shaders/polygon_linear_vert.glsl → es/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
  189. package/es/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
  190. package/es/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
  191. package/es/polygon/shaders/ocean/ocean_vert.glsl +22 -0
  192. package/es/polygon/shaders/water/polygon_water_frag.glsl +14 -12
  193. package/es/polygon/shaders/water/polygon_water_vert.glsl +10 -10
  194. package/es/raster/buffers/triangulation.d.ts +1 -1
  195. package/es/raster/index.d.ts +2 -2
  196. package/es/raster/models/raster.d.ts +9 -8
  197. package/es/raster/models/raster.js +54 -38
  198. package/es/raster/models/rasterRgb.d.ts +9 -7
  199. package/es/raster/models/rasterRgb.js +36 -19
  200. package/es/raster/models/rasterTerrainRgb.d.ts +1 -1
  201. package/es/raster/models/rasterTerrainRgb.js +2 -2
  202. package/es/raster/shaders/raster/raster_2d_frag.glsl +34 -0
  203. package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
  204. package/es/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
  205. package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
  206. package/es/tile/core/BaseLayer.d.ts +2 -2
  207. package/es/tile/core/TileDebugLayer.d.ts +1 -1
  208. package/es/tile/interaction/getRasterData.d.ts +2 -2
  209. package/es/tile/interaction/utils.d.ts +1 -1
  210. package/es/tile/interface.d.ts +2 -2
  211. package/es/tile/service/TileLayerService.d.ts +2 -2
  212. package/es/tile/service/TilePickService.d.ts +2 -2
  213. package/es/tile/service/TileSourceService.d.ts +1 -1
  214. package/es/tile/tile/Tile.d.ts +2 -3
  215. package/es/tile/tile/VectorTile.d.ts +1 -1
  216. package/es/tile/tile/index.d.ts +1 -1
  217. package/es/tile/utils/constants.js +1 -1
  218. package/es/tile/utils/utils.d.ts +1 -1
  219. package/es/utils/blend.d.ts +1 -1
  220. package/es/utils/multiPassRender.d.ts +1 -1
  221. package/es/utils/stencil.d.ts +1 -1
  222. package/es/wind/index.d.ts +3 -3
  223. package/es/wind/models/wind.d.ts +1 -1
  224. package/lib/citybuliding/models/build.js +22 -11
  225. package/lib/citybuliding/shaders/build_frag.glsl +26 -23
  226. package/lib/citybuliding/shaders/build_vert.glsl +24 -16
  227. package/lib/core/BaseLayer.js +53 -9
  228. package/lib/core/BaseModel.js +41 -15
  229. package/lib/core/CommonStyleAttribute.js +3 -0
  230. package/lib/core/triangulation.js +12 -6
  231. package/lib/core/utils.js +1 -1
  232. package/lib/earth/models/atmosphere.js +15 -8
  233. package/lib/earth/models/base.js +21 -12
  234. package/lib/earth/models/bloomsphere.js +15 -8
  235. package/lib/earth/shaders/{atmosphere_frag.glsl → atmosphere/atmosphere_frag.glsl} +9 -6
  236. package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +22 -0
  237. package/lib/earth/shaders/base/base_frag.glsl +11 -0
  238. package/lib/earth/shaders/base/base_vert.glsl +52 -0
  239. package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +16 -0
  240. package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +19 -0
  241. package/lib/geometry/models/billboard.js +26 -11
  242. package/lib/geometry/models/plane.js +23 -6
  243. package/lib/geometry/models/sprite.js +44 -18
  244. package/lib/geometry/shaders/billboard_frag.glsl +11 -6
  245. package/lib/geometry/shaders/billboard_vert.glsl +12 -15
  246. package/lib/geometry/shaders/plane_frag.glsl +14 -10
  247. package/lib/geometry/shaders/plane_vert.glsl +11 -10
  248. package/lib/geometry/shaders/sprite_frag.glsl +11 -7
  249. package/lib/geometry/shaders/sprite_vert.glsl +10 -9
  250. package/lib/heatmap/models/grid.js +25 -12
  251. package/lib/heatmap/models/grid3d.js +29 -13
  252. package/lib/heatmap/models/heatmap.js +122 -74
  253. package/lib/heatmap/models/hexagon.js +25 -12
  254. package/lib/heatmap/shaders/grid/grid_frag.glsl +8 -0
  255. package/lib/heatmap/shaders/{grid_vert.glsl → grid/grid_vert.glsl} +15 -15
  256. package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +8 -0
  257. package/{es/heatmap/shaders/hexagon_3d_vert.glsl → lib/heatmap/shaders/grid3d/grid_3d_vert.glsl} +13 -16
  258. package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +24 -0
  259. package/lib/heatmap/shaders/{heatmap_3d_vert.glsl → heatmap/heatmap_3d_vert.glsl} +19 -9
  260. package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +52 -0
  261. package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +16 -0
  262. package/{es/heatmap/shaders → lib/heatmap/shaders/heatmap}/heatmap_framebuffer_vert.glsl +14 -9
  263. package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +19 -0
  264. package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
  265. package/lib/heatmap/shaders/{hexagon_vert.glsl → hexagon/hexagon_vert.glsl} +12 -13
  266. package/lib/image/models/image.js +83 -44
  267. package/lib/image/shaders/image_frag.glsl +34 -7
  268. package/lib/image/shaders/image_vert.glsl +11 -5
  269. package/lib/line/index.js +2 -1
  270. package/lib/line/models/arc.js +57 -76
  271. package/lib/line/models/arc_3d.js +47 -59
  272. package/lib/line/models/flow.js +14 -12
  273. package/lib/line/models/great_circle.js +40 -29
  274. package/lib/line/models/index.js +4 -7
  275. package/lib/line/models/line.js +67 -142
  276. package/lib/line/models/{simpleLine.js → simple_line.js} +84 -74
  277. package/lib/line/models/wall.js +35 -27
  278. package/lib/line/shaders/{line_arc_frag.glsl → arc/line_arc_frag.glsl} +36 -26
  279. package/lib/line/shaders/{line_arc_vert.glsl → arc/line_arc_vert.glsl} +52 -22
  280. package/lib/line/shaders/{line_arc_3d_frag.glsl → arc3d/line_arc_3d_frag.glsl} +32 -24
  281. package/{es/line/shaders → lib/line/shaders/arc3d}/line_arc_3d_vert.glsl +37 -27
  282. package/lib/line/shaders/flow/flow_line_frag.glsl +5 -4
  283. package/lib/line/shaders/flow/flow_line_vert.glsl +17 -18
  284. package/lib/line/shaders/{line_arc_great_circle_frag.glsl → greatCircle/line_arc_great_circle_frag.glsl} +30 -30
  285. package/{es/line/shaders → lib/line/shaders/greatCircle}/line_arc_great_circle_vert.glsl +43 -40
  286. package/lib/line/shaders/{line_frag.glsl → line/line_frag.glsl} +55 -28
  287. package/lib/line/shaders/line/line_vert.glsl +114 -0
  288. package/lib/line/shaders/simple/simpleline_frag.glsl +27 -3
  289. package/lib/line/shaders/simple/simpleline_vert.glsl +20 -20
  290. package/lib/line/shaders/wall/wall_frag.glsl +31 -26
  291. package/lib/line/shaders/wall/wall_vert.glsl +29 -22
  292. package/lib/plugins/DataMappingPlugin.js +1 -3
  293. package/lib/plugins/FeatureScalePlugin.js +14 -3
  294. package/lib/plugins/PixelPickingPlugin.js +35 -48
  295. package/lib/plugins/ShaderUniformPlugin.js +11 -6
  296. package/lib/point/index.js +1 -0
  297. package/lib/point/models/billboard_point.js +18 -18
  298. package/lib/point/models/earthExtrude.js +21 -13
  299. package/lib/point/models/earthFill.js +18 -30
  300. package/lib/point/models/extrude.js +2 -11
  301. package/lib/point/models/fill.js +33 -84
  302. package/lib/point/models/{fillmage.js → fillImage.js} +24 -17
  303. package/lib/point/models/image.js +31 -17
  304. package/lib/point/models/index.js +2 -2
  305. package/lib/point/models/normal.js +13 -30
  306. package/lib/point/models/radar.js +23 -45
  307. package/lib/point/models/text.js +31 -32
  308. package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_frag.glsl +17 -13
  309. package/{es/point/shaders → lib/point/shaders/billboard}/billboard_point_vert.glsl +13 -14
  310. package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
  311. package/{es/point/shaders/earth/extrude_vert.glsl → lib/point/shaders/earthExtrude/earthExtrude_vert.glsl} +25 -22
  312. package/{es/point/shaders/earth/fill_frag.glsl → lib/point/shaders/earthFill/earthFill_frag.glsl} +20 -18
  313. package/{es/point/shaders/earth/fill_vert.glsl → lib/point/shaders/earthFill/earthFill_vert.glsl} +17 -22
  314. package/lib/point/shaders/extrude/extrude_vert.glsl +0 -3
  315. package/{es/point/shaders → lib/point/shaders/fill}/fill_frag.glsl +18 -1
  316. package/lib/point/shaders/{fill_vert.glsl → fill/fill_vert.glsl} +5 -4
  317. package/lib/point/shaders/fillImage/fillImage_frag.glsl +24 -0
  318. package/{es/point/shaders/image → lib/point/shaders/fillImage}/fillImage_vert.glsl +15 -17
  319. package/lib/point/shaders/image/image_frag.glsl +42 -0
  320. package/{es/point/shaders → lib/point/shaders/image}/image_vert.glsl +14 -13
  321. package/lib/point/shaders/radar/radar_frag.glsl +19 -14
  322. package/lib/point/shaders/radar/radar_vert.glsl +21 -24
  323. package/lib/point/shaders/text/text_frag.glsl +44 -0
  324. package/lib/point/shaders/{text_vert.glsl → text/text_vert.glsl} +19 -17
  325. package/lib/polygon/models/extrude.js +38 -15
  326. package/lib/polygon/models/extrusion.js +24 -7
  327. package/lib/polygon/models/fill.js +26 -13
  328. package/lib/polygon/models/ocean.js +30 -14
  329. package/lib/polygon/models/water.js +26 -10
  330. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +14 -14
  331. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +17 -15
  332. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +18 -18
  333. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +18 -24
  334. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +19 -15
  335. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +20 -24
  336. package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +4 -8
  337. package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +7 -16
  338. package/lib/polygon/shaders/fill/fill_frag.glsl +7 -0
  339. package/lib/polygon/shaders/fill/fill_linear_frag.glsl +20 -0
  340. package/{es/polygon/shaders/polygon_linear_vert.glsl → lib/polygon/shaders/fill/fill_linear_vert.glsl} +12 -11
  341. package/lib/polygon/shaders/{polygon_vert.glsl → fill/fill_vert.glsl} +6 -6
  342. package/lib/polygon/shaders/{water/polygon_ocean_frag.glsl → ocean/ocean_frag.glsl} +13 -13
  343. package/lib/polygon/shaders/ocean/ocean_vert.glsl +22 -0
  344. package/lib/polygon/shaders/water/polygon_water_frag.glsl +14 -12
  345. package/lib/polygon/shaders/water/polygon_water_vert.glsl +10 -10
  346. package/lib/raster/models/raster.js +54 -38
  347. package/lib/raster/models/rasterRgb.js +36 -19
  348. package/lib/raster/models/rasterTerrainRgb.js +2 -2
  349. package/lib/raster/shaders/raster/raster_2d_frag.glsl +34 -0
  350. package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
  351. package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +26 -0
  352. package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
  353. package/lib/tile/utils/constants.js +1 -1
  354. package/package.json +7 -7
  355. package/es/earth/shaders/atmosphere_vert.glsl +0 -26
  356. package/es/earth/shaders/base_frag.glsl +0 -13
  357. package/es/earth/shaders/base_vert.glsl +0 -52
  358. package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
  359. package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
  360. package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
  361. package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
  362. package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
  363. package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
  364. package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
  365. package/es/line/models/earthArc_3d.d.ts +0 -17
  366. package/es/line/models/earthArc_3d.js +0 -285
  367. package/es/line/models/linearline.d.ts +0 -11
  368. package/es/line/models/linearline.js +0 -241
  369. package/es/line/models/simpleLine.js +0 -194
  370. package/es/line/shaders/arc_chunks.vert.glsl +0 -21
  371. package/es/line/shaders/dash/arc_dash_frag.glsl +0 -21
  372. package/es/line/shaders/dash/arc_dash_vert.glsl +0 -102
  373. package/es/line/shaders/dash/line_dash_frag.glsl +0 -27
  374. package/es/line/shaders/dash/line_dash_vert.glsl +0 -82
  375. package/es/line/shaders/line_arc2d_vert.glsl +0 -114
  376. package/es/line/shaders/line_bezier_vert.glsl +0 -85
  377. package/es/line/shaders/line_vert.glsl +0 -165
  378. package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
  379. package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
  380. package/es/line/shaders/linear/arc_linear_frag.glsl +0 -10
  381. package/es/line/shaders/linear/arc_linear_vert.glsl +0 -98
  382. package/es/line/shaders/linear/line_linear_frag.glsl +0 -25
  383. package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -8
  384. package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -93
  385. package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
  386. package/es/point/shaders/animate/wave_frag.glsl +0 -55
  387. package/es/point/shaders/earth/extrude_frag.glsl +0 -32
  388. package/es/point/shaders/image/fillImage_frag.glsl +0 -18
  389. package/es/point/shaders/image_frag.glsl +0 -37
  390. package/es/point/shaders/text_frag.glsl +0 -39
  391. package/es/polygon/shaders/polygon_frag.glsl +0 -7
  392. package/es/polygon/shaders/polygon_linear_frag.glsl +0 -15
  393. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
  394. package/es/raster/shaders/raster_2d_frag.glsl +0 -32
  395. package/es/raster/shaders/raster_2d_vert.glsl +0 -13
  396. package/es/raster/shaders/raster_frag.glsl +0 -11
  397. package/es/raster/shaders/raster_rgb_frag.glsl +0 -20
  398. package/es/raster/shaders/raster_vert.glsl +0 -34
  399. package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
  400. package/lib/earth/shaders/base_frag.glsl +0 -13
  401. package/lib/earth/shaders/base_vert.glsl +0 -52
  402. package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
  403. package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
  404. package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
  405. package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
  406. package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
  407. package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
  408. package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
  409. package/lib/line/models/earthArc_3d.js +0 -291
  410. package/lib/line/models/linearline.js +0 -247
  411. package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
  412. package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -21
  413. package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -102
  414. package/lib/line/shaders/dash/line_dash_frag.glsl +0 -27
  415. package/lib/line/shaders/dash/line_dash_vert.glsl +0 -82
  416. package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
  417. package/lib/line/shaders/line_bezier_vert.glsl +0 -85
  418. package/lib/line/shaders/line_vert.glsl +0 -165
  419. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -32
  420. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -161
  421. package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -10
  422. package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -98
  423. package/lib/line/shaders/linear/line_linear_frag.glsl +0 -25
  424. package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -8
  425. package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -93
  426. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -8
  427. package/lib/point/shaders/animate/wave_frag.glsl +0 -55
  428. package/lib/point/shaders/earth/extrude_frag.glsl +0 -32
  429. package/lib/point/shaders/image/fillImage_frag.glsl +0 -18
  430. package/lib/point/shaders/image_frag.glsl +0 -37
  431. package/lib/point/shaders/text_frag.glsl +0 -39
  432. package/lib/polygon/shaders/polygon_frag.glsl +0 -7
  433. package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -15
  434. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -16
  435. package/lib/raster/shaders/raster_2d_frag.glsl +0 -32
  436. package/lib/raster/shaders/raster_2d_vert.glsl +0 -13
  437. package/lib/raster/shaders/raster_frag.glsl +0 -11
  438. package/lib/raster/shaders/raster_rgb_frag.glsl +0 -20
  439. package/lib/raster/shaders/raster_vert.glsl +0 -34
  440. /package/es/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
  441. /package/es/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
  442. /package/es/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
  443. /package/es/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
  444. /package/lib/point/shaders/{normal_frag.glsl → normal/normal_frag.glsl} +0 -0
  445. /package/lib/point/shaders/{normal_vert.glsl → normal/normal_vert.glsl} +0 -0
  446. /package/lib/raster/shaders/{raster_terrain_rgb_frag.glsl → terrain/terrain_rgb_frag.glsl} +0 -0
  447. /package/lib/raster/shaders/{rater_terrain_rgb_vert.glsl → terrain/terrain_rgb_vert.glsl} +0 -0
@@ -22,15 +22,16 @@ var _l7Utils = require("@antv/l7-utils");
22
22
  var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
23
23
  var _collisionIndex = _interopRequireDefault(require("../../utils/collision-index"));
24
24
  var _symbolLayout = require("../../utils/symbol-layout");
25
+ var _CommonStyleAttribute = require("../../core/CommonStyleAttribute");
25
26
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
26
27
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
27
28
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
28
29
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
29
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
30
- /* babel-plugin-inline-import '../shaders/text_frag.glsl' */
31
- var textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\nuniform sampler2D u_sdf_map;\nuniform float u_gamma_scale : 0.5;\nuniform float u_stroke_width : 2.0;\nuniform float u_halo_blur : 0.5;\nuniform float u_DevicePixelRatio;\n\nvarying vec4 v_color;\nvarying vec4 v_stroke_color;\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying float v_fontScale;\n\n\n#pragma include \"picking\"\nvoid main() {\n // get style data mapping\n\n // get sdf from atlas\n float dist = texture2D(u_sdf_map, v_uv).a;\n\n lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));\n\n gl_FragColor.a *= alpha;\n // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20\n if (gl_FragColor.a < 0.01) {\n discard;\n }\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
32
- /* babel-plugin-inline-import '../shaders/text_vert.glsl' */
33
- var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\nattribute vec3 a_Position;\nattribute vec2 a_tex;\nattribute vec2 a_textOffsets;\nattribute vec4 a_Color;\nattribute float a_Size;\n\nuniform vec2 u_sdf_map_size;\nuniform mat4 u_ModelMatrix;\n\nuniform float u_raisingHeight: 0.0;\n\nvarying vec2 v_uv;\nvarying float v_gamma_scale;\nvarying vec4 v_color;\nvarying vec4 v_stroke_color;\nvarying float v_fontScale;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n\n\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n \n v_uv = a_tex / u_sdf_map_size;\n\n\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);\n\n // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n vec2 offset = rotate_matrix(a_textOffsets,rotation);\n \n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n";
31
+ /* babel-plugin-inline-import '../shaders/text/text_frag.glsl' */
32
+ var textFrag = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 48.0\n\nuniform sampler2D u_sdf_map;\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nin vec4 v_color;\nin vec4 v_stroke_color;\nin vec2 v_uv;\nin float v_gamma_scale;\nin float v_fontScale;\nout vec4 outputColor;\n\n#pragma include \"picking\"\nvoid main() {\n // get style data mapping\n\n // get sdf from atlas\n float dist = texture(SAMPLER_2D(u_sdf_map), v_uv).a;\n\n lowp float buff = (6.0 - u_stroke_width / v_fontScale) / SDF_PX;\n highp float gamma = (u_halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (v_fontScale * u_gamma_scale) / 1.0;\n\n highp float gamma_scaled = gamma * v_gamma_scale;\n\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));\n\n outputColor.a *= alpha;\n // \u4F5C\u4E3A mask \u6A21\u677F\u65F6\u9700\u8981\u4E22\u5F03\u900F\u660E\u7684\u50CF\u7D20\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n";
33
+ /* babel-plugin-inline-import '../shaders/text/text_vert.glsl' */
34
+ var textVert = "#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105\n#define FONT_SIZE 24.0\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\nlayout(location = 14) in vec4 a_textUvAndOffsets;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\n vec2 u_sdf_map_size;\n float u_raisingHeight: 0.0;\n float u_stroke_width : 2;\n float u_gamma_scale : 0.5;\n float u_halo_blur : 0.5;\n};\n\nout vec2 v_uv;\nout float v_gamma_scale;\nout vec4 v_color;\nout vec4 v_stroke_color;\nout float v_fontScale;\n\n\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n#pragma include \"rotation_2d\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n \n v_uv = a_textUvAndOffsets.xy / u_sdf_map_size;\n\n\n\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n v_stroke_color = vec4(u_stroke_color.xyz, u_stroke_color.w * opacity);\n\n // \u6587\u672C\u7F29\u653E\u6BD4\u4F8B\n float fontScale = a_Size / FONT_SIZE;\n v_fontScale = fontScale;\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // vec4 projected_position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n\n vec2 offset = rotate_matrix(a_textUvAndOffsets.zw,rotation);\n \n // gl_Position = vec4(projected_position.xy / projected_position.w + rotation_matrix * a_textOffsets * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n vec4 projected_position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz + vec3(0.0, 0.0, raiseHeight), 1.0));\n\n gl_Position = vec4(\n projected_position.xy / projected_position.w + offset * fontScale / u_ViewportSize * 2.0 * u_DevicePixelRatio, 0.0, 1.0);\n v_gamma_scale = gl_Position.w;\n setPickingColor(a_PickingColor);\n\n}\n";
34
35
  var isEqual = _l7Utils.lodashUtil.isEqual;
35
36
  function TextTrianglation(feature) {
36
37
  // @ts-ignore
@@ -93,6 +94,16 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
93
94
  (0, _createClass2.default)(TextModel, [{
94
95
  key: "getUninforms",
95
96
  value: function getUninforms() {
97
+ var commoninfo = this.getCommonUniformsInfo();
98
+ var attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
99
+ this.updateStyleUnifoms();
100
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, commoninfo.uniformsOption), attributeInfo.uniformsOption), {
101
+ u_sdf_map: this.textures[0]
102
+ });
103
+ }
104
+ }, {
105
+ key: "getCommonUniformsInfo",
106
+ value: function getCommonUniformsInfo() {
96
107
  var _ref2 = this.layer.getLayerConfig(),
97
108
  _ref2$stroke = _ref2.stroke,
98
109
  stroke = _ref2$stroke === void 0 ? '#fff' : _ref2$stroke,
@@ -111,15 +122,16 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
111
122
  this.textCount = Object.keys(mapping).length;
112
123
  }
113
124
  this.preTextStyle = this.getTextStyle();
114
- return (0, _objectSpread2.default)({
125
+ var commonOptions = {
126
+ u_stroke_color: (0, _l7Utils.rgb2arr)(stroke),
127
+ u_sdf_map_size: [(canvas === null || canvas === void 0 ? void 0 : canvas.width) || 1, (canvas === null || canvas === void 0 ? void 0 : canvas.height) || 1],
115
128
  u_raisingHeight: Number(raisingHeight),
116
129
  u_stroke_width: strokeWidth,
117
- u_stroke_color: (0, _l7Utils.rgb2arr)(stroke),
118
- u_sdf_map: this.texture,
119
- u_halo_blur: halo,
120
130
  u_gamma_scale: gamma,
121
- u_sdf_map_size: [(canvas === null || canvas === void 0 ? void 0 : canvas.width) || 1, (canvas === null || canvas === void 0 ? void 0 : canvas.height) || 1]
122
- }, this.getStyleAttribute());
131
+ u_halo_blur: halo
132
+ };
133
+ var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
134
+ return commonBufferInfo;
123
135
  }
124
136
  }, {
125
137
  key: "initModels",
@@ -133,8 +145,9 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
133
145
  this.extent = this.textExtent();
134
146
  this.rawEncodeData = this.layer.getEncodedData();
135
147
  this.preTextStyle = this.getTextStyle();
148
+ this.initUniformsBuffer();
136
149
  return _context2.abrupt("return", this.buildModels());
137
- case 5:
150
+ case 6:
138
151
  case "end":
139
152
  return _context2.stop();
140
153
  }
@@ -250,30 +263,31 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
250
263
  key: "registerBuiltinAttributes",
251
264
  value: function registerBuiltinAttributes() {
252
265
  this.styleAttributeService.registerStyleAttribute({
253
- name: 'textOffsets',
266
+ name: 'textUvAndOffsets',
254
267
  type: _l7Core.AttributeType.Attribute,
255
268
  descriptor: {
256
- name: 'a_textOffsets',
269
+ name: 'a_textUvAndOffsets',
257
270
  // 文字偏移量
271
+ shaderLocation: _CommonStyleAttribute.ShaderLocation.UV,
258
272
  buffer: {
259
273
  // give the WebGL driver a hint that this buffer may change
260
274
  usage: _l7Core.gl.STATIC_DRAW,
261
275
  data: [],
262
276
  type: _l7Core.gl.FLOAT
263
277
  },
264
- size: 2,
278
+ size: 4,
265
279
  update: function update(feature, featureIdx, vertex) {
266
- return [vertex[5], vertex[6]];
280
+ return [vertex[3], vertex[4], vertex[5], vertex[6]];
267
281
  }
268
282
  }
269
283
  });
270
-
271
284
  // point layer size;
272
285
  this.styleAttributeService.registerStyleAttribute({
273
286
  name: 'size',
274
287
  type: _l7Core.AttributeType.Attribute,
275
288
  descriptor: {
276
289
  name: 'a_Size',
290
+ shaderLocation: _CommonStyleAttribute.ShaderLocation.SIZE,
277
291
  buffer: {
278
292
  // give the WebGL driver a hint that this buffer may change
279
293
  usage: _l7Core.gl.DYNAMIC_DRAW,
@@ -288,22 +302,6 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
288
302
  }
289
303
  }
290
304
  });
291
- this.styleAttributeService.registerStyleAttribute({
292
- name: 'textUv',
293
- type: _l7Core.AttributeType.Attribute,
294
- descriptor: {
295
- name: 'a_tex',
296
- buffer: {
297
- usage: _l7Core.gl.DYNAMIC_DRAW,
298
- data: [],
299
- type: _l7Core.gl.FLOAT
300
- },
301
- size: 2,
302
- update: function update(feature, featureIdx, vertex) {
303
- return [vertex[3], vertex[4]];
304
- }
305
- }
306
- });
307
305
  }
308
306
  }, {
309
307
  key: "bindEvent",
@@ -577,6 +575,7 @@ var TextModel = exports.default = /*#__PURE__*/function (_BaseModel) {
577
575
  width: canvas.width,
578
576
  height: canvas.height
579
577
  });
578
+ this.textures = [this.texture];
580
579
  }
581
580
  }, {
582
581
  key: "reBuildModel",
@@ -1,12 +1,16 @@
1
1
 
2
- uniform float u_additive;
3
- uniform float u_stroke_opacity : 1;
2
+ layout(std140) uniform commonUniorm {
3
+ vec4 u_stroke_color;
4
+ float u_additive;
5
+ float u_stroke_opacity;
6
+ float u_stroke_width;
7
+ };
4
8
 
5
- uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
9
+ in vec4 v_color;
10
+ in float v_blur;
11
+ in float v_innerRadius;
6
12
 
7
- varying vec4 v_color;
8
- varying float v_blur;
9
- varying float v_innerRadius;
13
+ out vec4 outputColor;
10
14
 
11
15
  #pragma include "picking"
12
16
  void main() {
@@ -23,24 +27,24 @@ void main() {
23
27
  float blurWidth = (1.0 - v_blur)/2.0;
24
28
  vec4 stroke = vec4(u_stroke_color.rgb, u_stroke_opacity);
25
29
  if(fragmengTocenter > v_innerRadius + blurWidth) {
26
- gl_FragColor = stroke;
30
+ outputColor = stroke;
27
31
  } else if(fragmengTocenter > v_innerRadius - blurWidth){
28
32
  float mixR = (fragmengTocenter - (v_innerRadius - blurWidth)) / (blurWidth * 2.0);
29
- gl_FragColor = mix(v_color, stroke, mixR);
33
+ outputColor = mix(v_color, stroke, mixR);
30
34
  } else {
31
- gl_FragColor = v_color;
35
+ outputColor = v_color;
32
36
  }
33
37
  } else {
34
38
  // 当不存在 stroke 或 stroke <= 0.01
35
- gl_FragColor = v_color;
39
+ outputColor = v_color;
36
40
  }
37
41
 
38
- gl_FragColor = filterColor(gl_FragColor);
42
+ outputColor = filterColor(outputColor);
39
43
 
40
44
  if(u_additive > 0.0) {
41
- gl_FragColor *= circleClipOpacity;
45
+ outputColor *= circleClipOpacity;
42
46
  } else {
43
- gl_FragColor.a *= circleClipOpacity;
47
+ outputColor.a *= circleClipOpacity;
44
48
  }
45
49
 
46
50
  }
@@ -1,25 +1,24 @@
1
1
 
2
- attribute vec3 a_Position;
3
- uniform mat4 u_ModelMatrix;
4
-
5
- attribute float a_Size;
6
- attribute vec4 a_Color;
7
- varying vec4 v_color;
8
-
9
- uniform float u_opacity : 1;
10
- uniform vec2 u_offsets;
11
- uniform float u_stroke_width;
12
-
13
- varying float v_blur;
14
- varying float v_innerRadius;
2
+ layout(location = 0) in vec3 a_Position;
3
+ layout(location = 1) in vec4 a_Color;
4
+ layout(location = 9) in float a_Size;
15
5
 
6
+ layout(std140) uniform commonUniorm {
7
+ vec4 u_stroke_color;
8
+ float u_additive;
9
+ float u_stroke_opacity;
10
+ float u_stroke_width;
11
+ };
16
12
 
13
+ out vec4 v_color;
14
+ out float v_blur;
15
+ out float v_innerRadius;
17
16
 
18
17
  #pragma include "projection"
19
18
  #pragma include "picking"
20
19
  #pragma include "project"
21
20
  void main() {
22
- v_color = vec4(a_Color.xyz, a_Color.w * u_opacity);
21
+ v_color = vec4(a_Color.xyz, a_Color.w * opacity);
23
22
  v_blur = 1.0 - max(2.0/a_Size, 0.05);
24
23
  v_innerRadius = max((a_Size - u_stroke_width) / a_Size, 0.0);
25
24
 
@@ -0,0 +1,36 @@
1
+ precision highp float;
2
+ in vec4 v_color;
3
+
4
+ #pragma include "picking"
5
+
6
+ layout(std140) uniform commonUniform {
7
+ vec4 u_sourceColor;
8
+ vec4 u_targetColor;
9
+ float u_linearColor: 0;
10
+ float u_heightfixed: 0.0; // 默认不固定
11
+ float u_globel;
12
+ float u_r;
13
+ float u_pickLight: 0.0;
14
+ float u_opacitylinear: 0.0;
15
+ float u_opacitylinear_dir: 1.0;
16
+ float u_lightEnable: 1.0;
17
+ };
18
+ in float v_lightWeight;
19
+ in float v_barLinearZ;
20
+ out vec4 outputColor;
21
+ void main() {
22
+
23
+ outputColor = v_color;
24
+
25
+ // 开启透明度渐变
26
+ if(u_opacitylinear > 0.0) {
27
+ outputColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - v_barLinearZ): v_barLinearZ;
28
+ }
29
+
30
+ // picking
31
+ if(u_pickLight > 0.0) {
32
+ outputColor = filterColorAlpha(outputColor, v_lightWeight);
33
+ } else {
34
+ outputColor = filterColor(outputColor);
35
+ }
36
+ }
@@ -5,23 +5,30 @@ precision highp float;
5
5
  #define diffuseRatio 0.3
6
6
  #define specularRatio 0.2
7
7
 
8
- attribute vec3 a_Position;
9
- attribute vec3 a_Pos;
10
- attribute vec4 a_Color;
11
- attribute vec3 a_Size;
12
- attribute vec3 a_Normal;
13
-
14
- uniform float u_heightfixed: 0.0; // 默认不固定
15
- uniform float u_globel;
16
- uniform float u_r;
17
- uniform mat4 u_ModelMatrix;
18
-
19
- varying vec4 v_color;
20
-
21
- uniform float u_opacity : 1;
22
- uniform float u_lightEnable: 1;
23
- varying float v_lightWeight;
24
- varying float v_barLinearZ;
8
+
9
+ layout(location = 0) in vec3 a_Position;
10
+ layout(location = 1) in vec4 a_Color;
11
+ layout(location = 9) in vec3 a_Size;
12
+ layout(location = 11) in vec3 a_Pos;
13
+ layout(location = 13) in vec3 a_Normal;
14
+
15
+
16
+ layout(std140) uniform commonUniform {
17
+ vec4 u_sourceColor;
18
+ vec4 u_targetColor;
19
+ float u_linearColor: 0;
20
+ float u_heightfixed: 0.0; // 默认不固定
21
+ float u_globel;
22
+ float u_r;
23
+ float u_pickLight: 0.0;
24
+ float u_opacitylinear: 0.0;
25
+ float u_opacitylinear_dir: 1.0;
26
+ float u_lightEnable: 1.0;
27
+ };
28
+
29
+ out vec4 v_color;
30
+ out float v_lightWeight;
31
+ out float v_barLinearZ;
25
32
  // 用于将在顶点着色器中计算好的样式值传递给片元
26
33
 
27
34
 
@@ -47,10 +54,6 @@ float getXRadian(float y, float r) {
47
54
 
48
55
  void main() {
49
56
 
50
-
51
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
52
-
53
- textureOffset = opacityAndOffset.g;
54
57
  // cal style mapping - 数据纹理映射部分的计算
55
58
  vec3 size = a_Size * a_Position;
56
59
 
@@ -88,7 +91,7 @@ void main() {
88
91
  v_lightWeight = lightWeight;
89
92
  // 设置圆柱的底色
90
93
  if(u_linearColor == 1.0) { // 使用渐变颜色
91
- v_color = mix(u_sourceColor, u_targetColor, barLinearZ);
94
+ v_color = mix(u_sourceColor, u_targetColor, v_barLinearZ);
92
95
  v_color.rgb *= lightWeight;
93
96
  } else { // 使用 color 方法传入的颜色
94
97
  v_color = a_Color;
@@ -1,23 +1,25 @@
1
- uniform float u_additive;
2
- uniform float u_opacity : 1;
3
- uniform float u_stroke_opacity : 1;
4
- uniform float u_stroke_width : 2;
5
-
6
- varying vec4 v_data;
7
- varying vec4 v_color;
8
- varying float v_radius;
1
+ in vec4 v_data;
2
+ in vec4 v_color;
3
+ in float v_radius;
9
4
 
5
+ layout(std140) uniform commonUniform {
6
+ float u_additive;
7
+ float u_stroke_opacity : 1;
8
+ float u_stroke_width : 2;
9
+ float u_blur : 0.0;
10
+ };
10
11
  #pragma include "sdf_2d"
11
12
  #pragma include "picking"
12
13
 
14
+ out vec4 outputColor;
13
15
 
14
16
  void main() {
15
17
  int shape = int(floor(v_data.w + 0.5));
16
18
 
17
- vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;
19
+ vec4 strokeColor = u_stroke == vec4(0.0) ? v_color : u_stroke;
18
20
 
19
21
  lowp float antialiasblur = v_data.z;
20
- float r = v_radius / (v_radius + strokeWidth);
22
+ float r = v_radius / (v_radius + u_stroke_width);
21
23
 
22
24
  float outer_df;
23
25
  float inner_df;
@@ -55,23 +57,23 @@ void main() {
55
57
 
56
58
  float opacity_t = smoothstep(0.0, antialiasblur, outer_df);
57
59
 
58
- float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(
60
+ float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(
59
61
  antialiasblur,
60
62
  0.0,
61
63
  inner_df
62
64
  );
63
65
 
64
- if(strokeWidth < 0.01) {
65
- gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);
66
+ if(u_stroke_width < 0.01) {
67
+ outputColor = vec4(v_color.rgb, v_color.a * u_opacity);
66
68
  } else {
67
- gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), u_stroke_color * u_stroke_opacity, color_t);
69
+ outputColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);
68
70
  }
69
71
 
70
72
  if(u_additive > 0.0) {
71
- gl_FragColor *= opacity_t;
72
- gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);
73
+ outputColor *= opacity_t;
74
+ outputColor = filterColorAlpha(outputColor, outputColor.a);
73
75
  } else {
74
- gl_FragColor.a *= opacity_t;
75
- gl_FragColor = filterColor(gl_FragColor);
76
+ outputColor.a *= opacity_t;
77
+ outputColor = filterColor(outputColor);
76
78
  }
77
79
  }
@@ -1,22 +1,18 @@
1
- attribute vec4 a_Color;
2
- attribute vec3 a_Position;
3
- attribute vec3 a_Extrude;
4
- attribute float a_Size;
5
- attribute float a_Shape;
6
- uniform mat4 u_ModelMatrix;
7
-
8
-
9
- varying vec4 v_data;
10
- varying vec4 v_color;
11
- varying float v_radius;
12
-
13
- uniform float u_opacity : 1;
14
- uniform float u_stroke_opacity : 1;
15
- uniform float u_stroke_width : 2;
16
- uniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];
17
- uniform vec2 u_offsets;
18
-
19
- uniform float u_blur : 0.0;
1
+ layout(location = 0) in vec3 a_Position;
2
+ layout(location = 1) in vec4 a_Color;
3
+ layout(location = 9) in float a_Size;
4
+ layout(location = 10) in float a_Shape;
5
+ layout(location = 11) in vec3 a_Extrude;
6
+
7
+ layout(std140) uniform commonUniform {
8
+ float u_additive;
9
+ float u_stroke_opacity : 1;
10
+ float u_stroke_width : 2;
11
+ float u_blur : 0.0;
12
+ };
13
+ out vec4 v_data;
14
+ out vec4 v_color;
15
+ out float v_radius;
20
16
 
21
17
  #pragma include "projection"
22
18
  #pragma include "picking"
@@ -44,8 +40,7 @@ void main() {
44
40
  // TODP: /abs(extrude.x) 是为了兼容地球模式
45
41
  v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);
46
42
 
47
-
48
- gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + u_offsets, 1.0);
43
+ gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1 + vec3(u_offsets,0.0), 1.0);
49
44
 
50
45
  setPickingColor(a_PickingColor);
51
- }
46
+ }
@@ -1,7 +1,4 @@
1
1
  #define pi 3.1415926535
2
- #define ambientRatio 0.5
3
- #define diffuseRatio 0.3
4
- #define specularRatio 0.2
5
2
 
6
3
  layout(location = 0) in vec3 a_Position;
7
4
  layout(location = 1) in vec4 a_Color;
@@ -1,12 +1,14 @@
1
-
2
1
  layout(std140) uniform commonUniforms {
3
2
  vec3 u_blur_height_fixed;
4
3
  float u_stroke_width;
5
4
  float u_additive;
6
5
  float u_stroke_opacity;
7
6
  float u_size_unit;
7
+ float u_time;
8
+ vec4 u_animate;
8
9
  };
9
10
 
11
+
10
12
  in vec4 v_color;
11
13
  in vec4 v_stroke;
12
14
  in vec4 v_data;
@@ -63,17 +65,32 @@ void main() {
63
65
  inner_df
64
66
  );
65
67
 
68
+ float PI = 3.14159;
69
+ float N_RINGS = 3.0;
70
+ float FREQ = 1.0;
71
+
66
72
  if(u_stroke_width < 0.01) {
67
73
  outputColor = v_color;
68
74
  } else {
69
75
  outputColor = mix(v_color, v_stroke * u_stroke_opacity, color_t);
70
76
  }
77
+ float intensity = 1.0;
78
+ if(u_time!=-1.0){
79
+ //wave相关逻辑
80
+ float d = length(v_data.xy);
81
+ if(d > 0.5) {
82
+ discard;
83
+ }
84
+ intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_animate.z - u_animate.y * u_time)), 0.0, 1.0);
85
+ }
71
86
 
72
87
  if(u_additive > 0.0) {
73
88
  outputColor *= opacity_t;
89
+ outputColor *= intensity;//wave
74
90
  outputColor = filterColorAlpha(outputColor, outputColor.a);
75
91
  } else {
76
92
  outputColor.a *= opacity_t;
93
+ outputColor.a *= intensity;//wave
77
94
  outputColor = filterColor(outputColor);
78
95
  }
79
96
  // 作为 mask 模板时需要丢弃透明的像素
@@ -1,8 +1,7 @@
1
1
  layout(location = 0) in vec3 a_Position;
2
2
  layout(location = 1) in vec4 a_Color;
3
- layout(location = 9) in float a_Size;
3
+ layout(location = 9) in vec2 a_SizeAndShape;
4
4
  layout(location = 11) in vec3 a_Extrude;
5
- layout(location = 10) in float a_Shape;
6
5
 
7
6
  layout(std140) uniform commonUniforms {
8
7
  vec3 u_blur_height_fixed;
@@ -10,6 +9,8 @@ layout(std140) uniform commonUniforms {
10
9
  float u_additive;
11
10
  float u_stroke_opacity;
12
11
  float u_size_unit;
12
+ float u_time;
13
+ vec4 u_animate;
13
14
  };
14
15
 
15
16
  out vec4 v_color;
@@ -25,12 +26,12 @@ void main() {
25
26
  // 透明度计算
26
27
  v_stroke = stroke;
27
28
  vec3 extrude = a_Extrude;
28
- float shape_type = a_Shape;
29
+ float shape_type = a_SizeAndShape.y;
29
30
  /*
30
31
  * setPickingSize 设置拾取大小
31
32
  * u_meter2coord 在等面积大小的时候设置单位
32
33
  */
33
- float newSize = setPickingSize(a_Size);
34
+ float newSize = setPickingSize(a_SizeAndShape.x);
34
35
  // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;
35
36
 
36
37
 
@@ -0,0 +1,24 @@
1
+ in vec4 v_color;
2
+ in vec2 v_uv;// 本身的 uv 坐标
3
+ in vec2 v_Iconuv;
4
+ in float v_opacity;
5
+ out vec4 outputColor;
6
+
7
+ uniform sampler2D u_texture;
8
+ layout(std140) uniform commonUniform {
9
+ vec2 u_textSize;
10
+ float u_heightfixed: 0.0;
11
+ float u_raisingHeight: 0.0;
12
+ float u_size_unit;
13
+ };
14
+
15
+ #pragma include "sdf_2d"
16
+ #pragma include "picking"
17
+
18
+
19
+ void main() {
20
+ vec2 pos = v_Iconuv / u_textSize + v_uv / u_textSize * 64.;
21
+ outputColor = texture(SAMPLER_2D(u_texture), pos);
22
+ outputColor.a *= v_opacity;
23
+ outputColor = filterColor(outputColor);
24
+ }
@@ -1,21 +1,19 @@
1
- attribute vec4 a_Color;
2
- attribute vec3 a_Position;
3
- attribute vec3 a_Extrude;
4
- attribute float a_Size;
5
- attribute vec2 a_Uv;
1
+ layout(location = 0) in vec3 a_Position;
2
+ layout(location = 1) in vec4 a_Color;
3
+ layout(location = 9) in float a_Size;
4
+ layout(location = 11) in vec3 a_Extrude;
5
+ layout(location = 14) in vec2 a_Uv;
6
6
 
7
- uniform mat4 u_ModelMatrix;
7
+ layout(std140) uniform commonUniform {
8
+ vec2 u_textSize;
9
+ float u_heightfixed: 0.0;
10
+ float u_raisingHeight: 0.0;
11
+ float u_size_unit;
12
+ };
8
13
 
9
- uniform mat2 u_RotateMatrix;
10
- uniform int u_size_unit;
11
-
12
- varying vec2 v_uv; // 本身的 uv 坐标
13
- varying vec2 v_Iconuv; // icon 贴图的 uv 坐标
14
-
15
- uniform float u_raisingHeight: 0.0;
16
- uniform float u_heightfixed: 0.0;
17
- varying float v_opacity;
18
- // uniform vec2 u_offsets; // shader 注入
14
+ out vec2 v_uv;
15
+ out vec2 v_Iconuv;
16
+ out float v_opacity;
19
17
 
20
18
 
21
19
  #pragma include "projection"
@@ -29,7 +27,7 @@ void main() {
29
27
  v_Iconuv = a_Uv;
30
28
  v_opacity = opacity;
31
29
  float newSize = a_Size;
32
- if(u_size_unit == 1) {
30
+ if(u_size_unit == 1.0) {
33
31
  newSize = newSize * u_PixelsPerMeter.z;
34
32
  }
35
33