@antv/l7-layers 2.20.5 → 2.20.8

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
@@ -1,5 +1,5 @@
1
- import { ILayer, ILngLat, ITile } from '@antv/l7-core';
2
- import { SourceTile } from '@antv/l7-utils';
1
+ import type { ILayer, ILngLat, ITile } from '@antv/l7-core';
2
+ import type { SourceTile } from '@antv/l7-utils';
3
3
  import { EventEmitter } from 'eventemitter3';
4
4
  export type TileEventType = 'loaded';
5
5
  export default abstract class Tile extends EventEmitter implements ITile {
@@ -80,7 +80,6 @@ export default abstract class Tile extends EventEmitter implements ITile {
80
80
  id?: string | HTMLDivElement | undefined;
81
81
  canvas?: HTMLCanvasElement | undefined;
82
82
  gl?: any;
83
- hasBaseMap?: boolean | undefined;
84
83
  map?: import("@antv/l7-core").IMapWrapper | undefined;
85
84
  logoPosition?: import("@antv/l7-core").PositionName | undefined;
86
85
  logoVisible?: boolean | undefined;
@@ -1,4 +1,4 @@
1
- import { ILayer } from '@antv/l7-core';
1
+ import type { ILayer } from '@antv/l7-core';
2
2
  import Tile from './Tile';
3
3
  export default class VectorTile extends Tile {
4
4
  initTileLayer(): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { ILayer } from '@antv/l7-core';
1
+ import type { ILayer } from '@antv/l7-core';
2
2
  import DebugTile from './DebugTile';
3
3
  import ImageTile from './ImageTile';
4
4
  import MaskLayer from './MaskTile';
@@ -5,4 +5,4 @@ export var ProxyFuncs = [
5
5
  * 1. 需要作用到所属子图层才会生效的方法
6
6
  * 2. 不需要主动重新创建 model 的方法
7
7
  */
8
- 'shape', 'color', 'size', 'style', 'animate', 'filter', 'rotate', 'scale', 'setBlend', 'setSelect', 'setActive', 'disableMask', 'enableMask'];
8
+ 'shape', 'color', 'size', 'style', 'animate', 'filter', 'rotate', 'scale', 'setBlend', 'setSelect', 'setActive', 'disableMask', 'enableMask', 'addMask', 'removeMask'];
@@ -1,4 +1,4 @@
1
- import { ILayer } from '@antv/l7-core';
1
+ import type { ILayer } from '@antv/l7-core';
2
2
  export declare const tileVectorParser: string[];
3
3
  /**
4
4
  * 判断当前图层是否是瓦片图层
@@ -1,2 +1,2 @@
1
- import { IBlendTypes } from '@antv/l7-core';
1
+ import type { IBlendTypes } from '@antv/l7-core';
2
2
  export declare const BlendTypes: IBlendTypes;
@@ -1,4 +1,4 @@
1
- import { ILayer, IPass, IPostProcessingPass } from '@antv/l7-core';
1
+ import type { ILayer, IPass, IPostProcessingPass } from '@antv/l7-core';
2
2
  /**
3
3
  * 'blurH' -> ['blurH', {}]
4
4
  */
@@ -1,4 +1,4 @@
1
- import { IRenderOptions, IStencilOptions, MaskOperationType } from '@antv/l7-core';
1
+ import type { IRenderOptions, IStencilOptions, MaskOperationType } from '@antv/l7-core';
2
2
  export declare function getStencil(mask: boolean, maskInside: boolean): Partial<IStencilOptions>;
3
3
  interface IStencilMaskOptions extends IRenderOptions {
4
4
  maskOperation?: MaskOperationType;
@@ -1,7 +1,7 @@
1
- import { IRenderOptions } from '@antv/l7-core';
1
+ import type { IRenderOptions } from '@antv/l7-core';
2
2
  import BaseLayer from '../core/BaseLayer';
3
- import { IWindLayerStyleOptions } from '../core/interface';
4
- import { WindModelType } from './models';
3
+ import type { IWindLayerStyleOptions } from '../core/interface';
4
+ import type { WindModelType } from './models';
5
5
  export default class WindLayer extends BaseLayer<IWindLayerStyleOptions> {
6
6
  type: string;
7
7
  buildModels(): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { IModel, IModelUniform, IRenderOptions, ITexture2D } from '@antv/l7-core';
1
+ import type { IModel, IModelUniform, IRenderOptions, ITexture2D } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class WindModel extends BaseModel {
4
4
  protected texture: ITexture2D;
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
13
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
14
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
@@ -17,12 +18,13 @@ var _l7Core = require("@antv/l7-core");
17
18
  var _l7Utils = require("@antv/l7-utils");
18
19
  var _BaseModel2 = _interopRequireDefault(require("../../core/BaseModel"));
19
20
  var _triangulation = require("../../core/triangulation");
21
+ var _CommonStyleAttribute = require("../../core/CommonStyleAttribute");
20
22
  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); }; }
21
23
  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; } }
22
24
  /* babel-plugin-inline-import '../shaders/build_frag.glsl' */
23
- var buildFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\nuniform float u_near : 0;\nuniform float u_far : 1;\nvarying vec4 v_Color;\nvarying vec2 v_texCoord;\nuniform float u_Zoom : 1;\nuniform float u_time;\n\nuniform float u_circleSweep;\nuniform float u_cityMinSize;\nuniform vec3 u_circleSweepColor;\nuniform float u_circleSweepSpeed;\n\nvarying float v_worldDis;\n\n#pragma include \"picking\"\n\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\n float s = step(hot, n);\n vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\n\n return mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\n\nfloat LinearizeDepth()\n{\n float z = gl_FragCoord.z * 2.0 - 1.0;\n return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\n\nvec3 fog(vec3 color, vec3 fogColor, float depth){\n float fogFactor=clamp(depth,0.0,1.0);\n vec3 output_color=mix(fogColor,color,fogFactor);\n return output_color;\n}\n\nfloat sdRect(vec2 p, vec2 sz) {\n vec2 d = abs(p) - sz;\n float outside = length(max(d, 0.));\n float inside = min(max(d.x, d.y), 0.);\n return outside + inside;\n}\n\nvoid main() {\n gl_FragColor = v_Color;\n vec3 baseColor = u_baseColor.xyz;\n vec3 brightColor = u_brightColor.xyz;\n vec3 windowColor = u_windowColor.xyz;\n float targetColId = 5.;\n float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\n vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\n if(v_texCoord.x < 0.) { //\u9876\u90E8\u989C\u8272\n vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\n gl_FragColor = vec4( foggedColor, v_Color.w);\n }else { // \u4FA7\u9762\u989C\u8272\n vec2 st = v_texCoord;\n vec2 UvScale = v_texCoord;\n float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\n float tStart = 0.25 * tStep;\n float tEnd = 0.75 * tStep;\n float u = mod(UvScale.x, tStep);\n float v = mod(UvScale.y, tStep);\n float ux = floor(UvScale.x/tStep);\n float uy = floor(UvScale.y/tStep);\n float n = random(vec2(ux,uy));\n float lightP = u_time;\n float head = 1.0- step(0.005,st.y);\n /*step3*/\n // \u5C06\u7A97\u6237\u989C\u8272\u548C\u5899\u9762\u989C\u8272\u533A\u522B\u5F00\u6765\n float sU = step(tStart, u) - step(tEnd, u);\n float sV = step(tStart, v) - step(tEnd, v);\n vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\n float dist = sdRect(vec2(u,v), windowSize);\n float s = sU * sV;\n\n float curColId = floor(UvScale.x / tStep);\n float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\n\n float mLightP = mod(lightP, 2.);\n float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\n if(ux == targetColId){\n n =0.;\n }\n float timeP = min(0.75, abs ( sin(u_time/3.0) ) );\n float hot = smoothstep(1.0,0.0,timeP);\n vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\n //vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);\n float sFinal = s * sCol * sRow;\n color += mix(baseColor, brightColor, sFinal*n);\n if (st.y<0.01){\n color = baseColor;\n }\n if(head ==1.0) { // \u9876\u90E8\u4EAE\u7EBF\n color = brightColor;\n }\n color = color * v_Color.rgb;\n\n vec3 foggedColor = fog(color,fogColor,depth);\n\n gl_FragColor = vec4(foggedColor,1.0);\n }\n\n\n if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {\n float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);\n gl_FragColor.rgb += r * r * u_circleSweepColor;\n }\n \n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
25
+ var buildFrag = "precision highp float;\nlayout(std140) uniform commonUniforms {\n vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\n vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\n vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\n vec4 u_circleSweepColor;\n vec2 u_cityCenter;\n float u_circleSweep;\n float u_cityMinSize;\n float u_circleSweepSpeed;\n float u_opacity: 1.0;\n float u_near : 0;\n float u_far : 1;\n float u_time;\n};\nin vec4 v_Color;\nin vec2 v_texCoord;\nin float v_worldDis;\nout vec4 outputColor;\n\n#pragma include \"picking\"\n#pragma include \"scene_uniforms\"\n\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\n float s = step(hot, n);\n vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\n\n return mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\n\nfloat LinearizeDepth()\n{\n float z = gl_FragCoord.z * 2.0 - 1.0;\n return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\n\nvec3 fog(vec3 color, vec3 fogColor, float depth){\n float fogFactor=clamp(depth,0.0,1.0);\n vec3 output_color=mix(fogColor,color,fogFactor);\n return output_color;\n}\n\nfloat sdRect(vec2 p, vec2 sz) {\n vec2 d = abs(p) - sz;\n float outside = length(max(d, 0.));\n float inside = min(max(d.x, d.y), 0.);\n return outside + inside;\n}\n\nvoid main() {\n outputColor = v_Color;\n vec3 baseColor = u_baseColor.xyz;\n vec3 brightColor = u_brightColor.xyz;\n vec3 windowColor = u_windowColor.xyz;\n float targetColId = 5.;\n float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\n vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\n if(v_texCoord.x < 0.) { //\u9876\u90E8\u989C\u8272\n vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\n outputColor = vec4( foggedColor, v_Color.w);\n }else { // \u4FA7\u9762\u989C\u8272\n vec2 st = v_texCoord;\n vec2 UvScale = v_texCoord;\n float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\n float tStart = 0.25 * tStep;\n float tEnd = 0.75 * tStep;\n float u = mod(UvScale.x, tStep);\n float v = mod(UvScale.y, tStep);\n float ux = floor(UvScale.x/tStep);\n float uy = floor(UvScale.y/tStep);\n float n = random(vec2(ux,uy));\n float lightP = u_time;\n float head = 1.0- step(0.005,st.y);\n /*step3*/\n // \u5C06\u7A97\u6237\u989C\u8272\u548C\u5899\u9762\u989C\u8272\u533A\u522B\u5F00\u6765\n float sU = step(tStart, u) - step(tEnd, u);\n float sV = step(tStart, v) - step(tEnd, v);\n vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\n float dist = sdRect(vec2(u,v), windowSize);\n float s = sU * sV;\n\n float curColId = floor(UvScale.x / tStep);\n float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\n\n float mLightP = mod(lightP, 2.);\n float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\n if(ux == targetColId){\n n =0.;\n }\n float timeP = min(0.75, abs ( sin(u_time/3.0) ) );\n float hot = smoothstep(1.0,0.0,timeP);\n vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\n //vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);\n float sFinal = s * sCol * sRow;\n color += mix(baseColor, brightColor, sFinal*n);\n if (st.y<0.01){\n color = baseColor;\n }\n if(head ==1.0) { // \u9876\u90E8\u4EAE\u7EBF\n color = brightColor;\n }\n color = color * v_Color.rgb;\n\n vec3 foggedColor = fog(color,fogColor,depth);\n\n outputColor = vec4(foggedColor,1.0);\n }\n\n\n if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {\n float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);\n outputColor.rgb += r * r * u_circleSweepColor.rgb;\n }\n \n outputColor.a *= u_opacity;\n outputColor = filterColor(outputColor);\n}\n";
24
26
  /* babel-plugin-inline-import '../shaders/build_vert.glsl' */
25
- var buildVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\n\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvarying vec4 v_Color;\n\nuniform float u_circleSweep;\nuniform vec2 u_cityCenter;\n\nvarying float v_worldDis;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n v_texCoord = a_Uv;\n\n if(u_circleSweep > 0.0) {\n vec2 lnglatscale = vec2(0.0);\n if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {\n lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);\n }\n v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n";
27
+ var buildVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 1) in vec4 a_Color;\nlayout(location = 9) in float a_Size;\nlayout(location = 13) in vec3 a_Normal;\nlayout(location = 14) in vec2 a_Uv;\n\nout vec2 v_texCoord;\nout vec4 v_Color;\nout float v_worldDis;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\n vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\n vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\n vec4 u_circleSweepColor;\n vec2 u_cityCenter;\n float u_circleSweep;\n float u_cityMinSize;\n float u_circleSweepSpeed;\n float u_opacity: 1.0;\n float u_near : 0;\n float u_far : 1;\n float u_time;\n};\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n v_texCoord = a_Uv;\n\n if(u_circleSweep > 0.0) {\n vec2 lnglatscale = vec2(0.0);\n if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {\n lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);\n }\n v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n";
26
28
  var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
27
29
  (0, _inherits2.default)(CityBuildModel, _BaseModel);
28
30
  var _super = _createSuper(CityBuildModel);
@@ -31,8 +33,8 @@ var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
31
33
  return _super.apply(this, arguments);
32
34
  }
33
35
  (0, _createClass2.default)(CityBuildModel, [{
34
- key: "getUninforms",
35
- value: function getUninforms() {
36
+ key: "getCommonUniformsInfo",
37
+ value: function getCommonUniformsInfo() {
36
38
  var _ref = this.layer.getLayerConfig(),
37
39
  _ref$opacity = _ref.opacity,
38
40
  opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
@@ -52,18 +54,22 @@ var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
52
54
  sweepSpeed: 0.4,
53
55
  sweepCenter: this.cityCenter
54
56
  } : _ref$sweep;
55
- return {
57
+ var commonOptions = {
58
+ u_baseColor: (0, _l7Utils.rgb2arr)(baseColor),
59
+ u_brightColor: (0, _l7Utils.rgb2arr)(brightColor),
60
+ u_windowColor: (0, _l7Utils.rgb2arr)(windowColor),
61
+ u_circleSweepColor: [].concat((0, _toConsumableArray2.default)((0, _l7Utils.rgb2arr)(sweep.sweepColor).slice(0, 3)), [1.0]),
56
62
  u_cityCenter: sweep.sweepCenter || this.cityCenter,
57
- u_cityMinSize: this.cityMinSize * sweep.sweepRadius,
58
63
  u_circleSweep: sweep.enable ? 1.0 : 0.0,
59
- u_circleSweepColor: (0, _l7Utils.rgb2arr)(sweep.sweepColor).slice(0, 3),
64
+ u_cityMinSize: this.cityMinSize * sweep.sweepRadius,
60
65
  u_circleSweepSpeed: sweep.sweepSpeed,
61
66
  u_opacity: opacity,
62
- u_baseColor: (0, _l7Utils.rgb2arr)(baseColor),
63
- u_brightColor: (0, _l7Utils.rgb2arr)(brightColor),
64
- u_windowColor: (0, _l7Utils.rgb2arr)(windowColor),
67
+ u_near: 0,
68
+ u_far: 1,
65
69
  u_time: this.layer.getLayerAnimateTime() || time
66
70
  };
71
+ var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
72
+ return commonBufferInfo;
67
73
  }
68
74
  }, {
69
75
  key: "calCityGeo",
@@ -97,9 +103,10 @@ var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
97
103
  while (1) switch (_context.prev = _context.next) {
98
104
  case 0:
99
105
  this.calCityGeo();
106
+ this.initUniformsBuffer();
100
107
  this.startModelAnimate();
101
108
  return _context.abrupt("return", this.buildModels());
102
- case 3:
109
+ case 4:
103
110
  case "end":
104
111
  return _context.stop();
105
112
  }
@@ -127,6 +134,7 @@ var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
127
134
  depth: {
128
135
  enable: true
129
136
  },
137
+ inject: this.getInject(),
130
138
  cull: {
131
139
  enable: true,
132
140
  face: _l7Core.gl.BACK
@@ -155,6 +163,7 @@ var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
155
163
  type: _l7Core.AttributeType.Attribute,
156
164
  descriptor: {
157
165
  name: 'a_Normal',
166
+ shaderLocation: _CommonStyleAttribute.ShaderLocation.NORMAL,
158
167
  buffer: {
159
168
  // give the WebGL driver a hint that this buffer may change
160
169
  usage: _l7Core.gl.STATIC_DRAW,
@@ -172,6 +181,7 @@ var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
172
181
  type: _l7Core.AttributeType.Attribute,
173
182
  descriptor: {
174
183
  name: 'a_Size',
184
+ shaderLocation: _CommonStyleAttribute.ShaderLocation.SIZE,
175
185
  buffer: {
176
186
  // give the WebGL driver a hint that this buffer may change
177
187
  usage: _l7Core.gl.DYNAMIC_DRAW,
@@ -191,6 +201,7 @@ var CityBuildModel = exports.default = /*#__PURE__*/function (_BaseModel) {
191
201
  type: _l7Core.AttributeType.Attribute,
192
202
  descriptor: {
193
203
  name: 'a_Uv',
204
+ shaderLocation: _CommonStyleAttribute.ShaderLocation.UV,
194
205
  buffer: {
195
206
  // give the WebGL driver a hint that this buffer may change
196
207
  usage: _l7Core.gl.DYNAMIC_DRAW,
@@ -1,22 +1,25 @@
1
- uniform float u_opacity: 1.0;
2
- uniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
3
- uniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
4
- uniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
5
- uniform float u_near : 0;
6
- uniform float u_far : 1;
7
- varying vec4 v_Color;
8
- varying vec2 v_texCoord;
9
- uniform float u_Zoom : 1;
10
- uniform float u_time;
11
-
12
- uniform float u_circleSweep;
13
- uniform float u_cityMinSize;
14
- uniform vec3 u_circleSweepColor;
15
- uniform float u_circleSweepSpeed;
16
-
17
- varying float v_worldDis;
1
+ precision highp float;
2
+ layout(std140) uniform commonUniforms {
3
+ vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
4
+ vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
5
+ vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
6
+ vec4 u_circleSweepColor;
7
+ vec2 u_cityCenter;
8
+ float u_circleSweep;
9
+ float u_cityMinSize;
10
+ float u_circleSweepSpeed;
11
+ float u_opacity: 1.0;
12
+ float u_near : 0;
13
+ float u_far : 1;
14
+ float u_time;
15
+ };
16
+ in vec4 v_Color;
17
+ in vec2 v_texCoord;
18
+ in float v_worldDis;
19
+ out vec4 outputColor;
18
20
 
19
21
  #pragma include "picking"
22
+ #pragma include "scene_uniforms"
20
23
 
21
24
  vec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {
22
25
  float s = step(hot, n);
@@ -48,7 +51,7 @@ float sdRect(vec2 p, vec2 sz) {
48
51
  }
49
52
 
50
53
  void main() {
51
- gl_FragColor = v_Color;
54
+ outputColor = v_Color;
52
55
  vec3 baseColor = u_baseColor.xyz;
53
56
  vec3 brightColor = u_brightColor.xyz;
54
57
  vec3 windowColor = u_windowColor.xyz;
@@ -57,7 +60,7 @@ void main() {
57
60
  vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);
58
61
  if(v_texCoord.x < 0.) { //顶部颜色
59
62
  vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);
60
- gl_FragColor = vec4( foggedColor, v_Color.w);
63
+ outputColor = vec4( foggedColor, v_Color.w);
61
64
  }else { // 侧面颜色
62
65
  vec2 st = v_texCoord;
63
66
  vec2 UvScale = v_texCoord;
@@ -103,15 +106,15 @@ void main() {
103
106
 
104
107
  vec3 foggedColor = fog(color,fogColor,depth);
105
108
 
106
- gl_FragColor = vec4(foggedColor,1.0);
109
+ outputColor = vec4(foggedColor,1.0);
107
110
  }
108
111
 
109
112
 
110
113
  if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {
111
114
  float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);
112
- gl_FragColor.rgb += r * r * u_circleSweepColor;
115
+ outputColor.rgb += r * r * u_circleSweepColor.rgb;
113
116
  }
114
117
 
115
- gl_FragColor.a *= u_opacity;
116
- gl_FragColor = filterColor(gl_FragColor);
118
+ outputColor.a *= u_opacity;
119
+ outputColor = filterColor(outputColor);
117
120
  }
@@ -4,22 +4,30 @@ precision highp float;
4
4
  #define diffuseRatio 0.3
5
5
  #define specularRatio 0.2
6
6
 
7
- attribute vec4 a_Color;
8
- attribute vec3 a_Position;
9
- attribute vec3 a_Normal;
10
- attribute float a_Size;
11
- uniform mat4 u_ModelMatrix;
12
-
13
- attribute vec2 a_Uv;
14
- varying vec2 v_texCoord;
15
-
16
- varying vec4 v_Color;
17
-
18
- uniform float u_circleSweep;
19
- uniform vec2 u_cityCenter;
20
-
21
- varying float v_worldDis;
22
-
7
+ layout(location = 0) in vec3 a_Position;
8
+ layout(location = 1) in vec4 a_Color;
9
+ layout(location = 9) in float a_Size;
10
+ layout(location = 13) in vec3 a_Normal;
11
+ layout(location = 14) in vec2 a_Uv;
12
+
13
+ out vec2 v_texCoord;
14
+ out vec4 v_Color;
15
+ out float v_worldDis;
16
+
17
+ layout(std140) uniform commonUniforms {
18
+ vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];
19
+ vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];
20
+ vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];
21
+ vec4 u_circleSweepColor;
22
+ vec2 u_cityCenter;
23
+ float u_circleSweep;
24
+ float u_cityMinSize;
25
+ float u_circleSweepSpeed;
26
+ float u_opacity: 1.0;
27
+ float u_near : 0;
28
+ float u_far : 1;
29
+ float u_time;
30
+ };
23
31
  #pragma include "projection"
24
32
  #pragma include "light"
25
33
  #pragma include "picking"
@@ -50,8 +50,6 @@ var layerIdCounter = 0;
50
50
  var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigService), (_class = /*#__PURE__*/function (_ref) {
51
51
  (0, _inherits2.default)(BaseLayer, _ref);
52
52
  var _super = _createSuper(BaseLayer);
53
- // private pickingPassRender: IPass<'pixelPicking'>;
54
-
55
53
  function BaseLayer() {
56
54
  var _this;
57
55
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -123,6 +121,8 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
123
121
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scaleOptions", {});
124
122
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "animateStatus", false);
125
123
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isDestroyed", false);
124
+ // private pickingPassRender: IPass<'pixelPicking'>;
125
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "uniformBuffers", []);
126
126
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "encodeDataLength", 0);
127
127
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sourceEvent", function () {
128
128
  _this.dataState.dataSourceNeedUpdate = true;
@@ -146,6 +146,9 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
146
146
  key: "addMask",
147
147
  value: function addMask(layer) {
148
148
  this.masks.push(layer);
149
+ this.updateLayerConfig({
150
+ maskLayers: this.masks
151
+ });
149
152
  this.enableMask();
150
153
  }
151
154
  }, {
@@ -155,6 +158,9 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
155
158
  if (layerIndex > -1) {
156
159
  this.masks.splice(layerIndex, 1);
157
160
  }
161
+ this.updateLayerConfig({
162
+ maskLayers: this.masks
163
+ });
158
164
  }
159
165
  }, {
160
166
  key: "disableMask",
@@ -170,13 +176,21 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
170
176
  enableMask: true
171
177
  });
172
178
  }
173
- // 将废弃
179
+
180
+ /**
181
+ * 将废弃
182
+ * @deprecated
183
+ */
174
184
  }, {
175
185
  key: "addMaskLayer",
176
186
  value: function addMaskLayer(maskLayer) {
177
187
  this.masks.push(maskLayer);
178
188
  }
179
- // 将废弃
189
+
190
+ /**
191
+ * 将废弃
192
+ * @deprecated
193
+ */
180
194
  }, {
181
195
  key: "removeMaskLayer",
182
196
  value: function removeMaskLayer(maskLayer) {
@@ -1195,7 +1209,7 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
1195
1209
  vs: vs,
1196
1210
  elements: elements,
1197
1211
  blend: _blend.BlendTypes[_l7Core.BlendType.normal],
1198
- uniformBuffers: [].concat((0, _toConsumableArray2.default)(_this10.layerModel.uniformBuffers), (0, _toConsumableArray2.default)(_this10.rendererService.uniformBuffers)),
1212
+ uniformBuffers: [].concat((0, _toConsumableArray2.default)(_this10.layerModel.uniformBuffers), (0, _toConsumableArray2.default)(_this10.rendererService.uniformBuffers), [_this10.getLayerUniformBuffer(), _this10.getPickingUniformBuffer()]),
1199
1213
  textures: _this10.layerModel.textures
1200
1214
  }, rest);
1201
1215
  if (count) {
@@ -1345,7 +1359,8 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
1345
1359
  model.draw({
1346
1360
  uniforms: _this11.layerModel.getUninforms(),
1347
1361
  blend: _this11.layerModel.getBlend(),
1348
- stencil: _this11.layerModel.getStencil(options)
1362
+ stencil: _this11.layerModel.getStencil(options),
1363
+ textures: _this11.layerModel.textures
1349
1364
  }, (options === null || options === void 0 ? void 0 : options.ispick) || false);
1350
1365
  });
1351
1366
  this.hooks.afterRender.call();
@@ -1439,6 +1454,7 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
1439
1454
  key: "initLayerModels",
1440
1455
  value: function () {
1441
1456
  var _initLayerModels = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
1457
+ var layerUniforms, pickingUniforms;
1442
1458
  return _regenerator.default.wrap(function _callee7$(_context7) {
1443
1459
  while (1) switch (_context7.prev = _context7.next) {
1444
1460
  case 0:
@@ -1446,11 +1462,29 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
1446
1462
  return model.destroy();
1447
1463
  });
1448
1464
  this.models = [];
1449
- _context7.next = 4;
1465
+ this.uniformBuffers.forEach(function (buffer) {
1466
+ buffer.destroy();
1467
+ });
1468
+ this.uniformBuffers = [];
1469
+ // Layer Uniform
1470
+ layerUniforms = this.rendererService.createBuffer({
1471
+ data: new Float32Array(16 + 4).fill(0),
1472
+ // u_Mvp
1473
+ isUBO: true
1474
+ });
1475
+ this.uniformBuffers.push(layerUniforms);
1476
+
1477
+ // Picking Uniform
1478
+ pickingUniforms = this.rendererService.createBuffer({
1479
+ data: new Float32Array(20).fill(0),
1480
+ isUBO: true
1481
+ });
1482
+ this.uniformBuffers.push(pickingUniforms);
1483
+ _context7.next = 10;
1450
1484
  return this.layerModel.initModels();
1451
- case 4:
1485
+ case 10:
1452
1486
  this.models = _context7.sent;
1453
- case 5:
1487
+ case 11:
1454
1488
  case "end":
1455
1489
  return _context7.stop();
1456
1490
  }
@@ -1461,6 +1495,16 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
1461
1495
  }
1462
1496
  return initLayerModels;
1463
1497
  }()
1498
+ }, {
1499
+ key: "getLayerUniformBuffer",
1500
+ value: function getLayerUniformBuffer() {
1501
+ return this.uniformBuffers[0];
1502
+ }
1503
+ }, {
1504
+ key: "getPickingUniformBuffer",
1505
+ value: function getPickingUniformBuffer() {
1506
+ return this.uniformBuffers[1];
1507
+ }
1464
1508
  }, {
1465
1509
  key: "reRender",
1466
1510
  value: function reRender() {
@@ -28,7 +28,8 @@ var shaderLocationMap = {
28
28
  stroke: _CommonStyleAttribute.ShaderLocation.STROKE,
29
29
  offsets: _CommonStyleAttribute.ShaderLocation.OFFSETS,
30
30
  rotation: _CommonStyleAttribute.ShaderLocation.ROTATION,
31
- extrusionBase: _CommonStyleAttribute.ShaderLocation.EXTRUSION_BASE
31
+ extrusionBase: _CommonStyleAttribute.ShaderLocation.EXTRUSION_BASE,
32
+ thetaOffset: 15
32
33
  };
33
34
 
34
35
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -121,10 +122,21 @@ var BaseModel = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
121
122
  value: function getDefaultStyle() {
122
123
  return {};
123
124
  }
125
+ // public getUninforms(): IModelUniform {
126
+ // throw new Error('Method not implemented.');
127
+ // }
124
128
  }, {
125
129
  key: "getUninforms",
126
130
  value: function getUninforms() {
127
- throw new Error('Method not implemented.');
131
+ var commoninfo = this.getCommonUniformsInfo();
132
+ var attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
133
+ this.updateStyleUnifoms();
134
+ var result = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, attributeInfo.uniformsOption), commoninfo.uniformsOption);
135
+ //如果是regl渲染 需要在uniform中带上u_texture 暂时用this.rendererService.device判断
136
+ if (!this.rendererService.hasOwnProperty('device') && this.textures && this.textures.length === 1) {
137
+ result['u_texture'] = this.textures[0];
138
+ }
139
+ return result;
128
140
  }
129
141
  }, {
130
142
  key: "getAnimateUniforms",
@@ -244,6 +256,10 @@ var BaseModel = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
244
256
  } else {
245
257
  uniforms.push(" ".concat(_constant.DefaultUniformStyleType[key], " u_").concat(key, ";"));
246
258
  }
259
+ var location = shaderLocationMap[key];
260
+ if (!location && key === 'THETA_OFFSET') {
261
+ location = 15;
262
+ }
247
263
  str += "\n #ifdef USE_ATTRIBUTE_".concat(key.toUpperCase(), "\n layout(location = ").concat(shaderLocationMap[key], ") in ").concat(_constant.DefaultUniformStyleType[key], " a_").concat(key.charAt(0).toUpperCase() + key.slice(1), ";\n #endif\n\n ");
248
264
  });
249
265
  var attributeUniforms = uniforms.length ? "\nlayout(std140) uniform AttributeUniforms {\n".concat(uniforms.join('\n'), "\n};\n ") : '';
@@ -305,16 +321,21 @@ var BaseModel = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
305
321
  value: function initUniformsBuffer() {
306
322
  var attrUniforms = this.getUniformsBufferInfo(this.getStyleAttribute());
307
323
  var commonUniforms = this.getCommonUniformsInfo();
308
- this.attributeUnifoms = this.rendererService.createBuffer({
309
- data: new Float32Array((0, _utils.MultipleOfFourNumber)(attrUniforms.uniformsLength)),
310
- // 长度需要大于等于 4
311
- isUBO: true
312
- });
313
- this.commonUnifoms = this.rendererService.createBuffer({
314
- data: new Float32Array((0, _utils.MultipleOfFourNumber)(commonUniforms.uniformsLength)),
315
- isUBO: true
316
- });
317
- this.uniformBuffers = [this.attributeUnifoms, this.commonUnifoms];
324
+ if (attrUniforms.uniformsLength !== 0) {
325
+ this.attributeUnifoms = this.rendererService.createBuffer({
326
+ data: new Float32Array((0, _utils.MultipleOfFourNumber)(attrUniforms.uniformsLength)).fill(0),
327
+ // 长度需要大于等于 4
328
+ isUBO: true
329
+ });
330
+ this.uniformBuffers.push(this.attributeUnifoms);
331
+ }
332
+ if (commonUniforms.uniformsLength !== 0) {
333
+ this.commonUnifoms = this.rendererService.createBuffer({
334
+ data: new Float32Array((0, _utils.MultipleOfFourNumber)(commonUniforms.uniformsLength)).fill(0),
335
+ isUBO: true
336
+ });
337
+ this.uniformBuffers.push(this.commonUnifoms);
338
+ }
318
339
  }
319
340
  // 获取数据映射 uniform 信息
320
341
  }, {
@@ -326,9 +347,13 @@ var BaseModel = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
326
347
  if (Array.isArray(value)) {
327
348
  uniformsArray.push.apply(uniformsArray, (0, _toConsumableArray2.default)(value));
328
349
  uniformsLength += value.length;
329
- } else {
350
+ } else if (typeof value === 'number') {
351
+ // 排除纹理
330
352
  uniformsArray.push(value);
331
353
  uniformsLength += 1;
354
+ } else if (typeof value === 'boolean') {
355
+ uniformsArray.push(Number(value));
356
+ uniformsLength += 1;
332
357
  }
333
358
  });
334
359
  return {
@@ -351,15 +376,16 @@ var BaseModel = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
351
376
  }, {
352
377
  key: "updateStyleUnifoms",
353
378
  value: function updateStyleUnifoms() {
379
+ var _this$attributeUnifom, _this$commonUnifoms;
354
380
  var _this$getUniformsBuff = this.getUniformsBufferInfo(this.getStyleAttribute()),
355
381
  uniformsArray = _this$getUniformsBuff.uniformsArray;
356
382
  var _this$getCommonUnifor = this.getCommonUniformsInfo(),
357
383
  commonUniformsArray = _this$getCommonUnifor.uniformsArray;
358
- this.attributeUnifoms.subData({
384
+ (_this$attributeUnifom = this.attributeUnifoms) === null || _this$attributeUnifom === void 0 || _this$attributeUnifom.subData({
359
385
  offset: 0,
360
386
  data: new Uint8Array(new Float32Array(uniformsArray).buffer)
361
387
  });
362
- this.commonUnifoms.subData({
388
+ (_this$commonUnifoms = this.commonUnifoms) === null || _this$commonUnifoms === void 0 || _this$commonUnifoms.subData({
363
389
  offset: 0,
364
390
  data: new Uint8Array(new Float32Array(commonUniformsArray).buffer)
365
391
  });
@@ -21,6 +21,8 @@ var ShaderLocation = exports.ShaderLocation = /*#__PURE__*/function (ShaderLocat
21
21
  ShaderLocation[ShaderLocation["EXTRUDE"] = 11] = "EXTRUDE";
22
22
  ShaderLocation[ShaderLocation["MAX"] = 12] = "MAX";
23
23
  ShaderLocation[ShaderLocation["NORMAL"] = 13] = "NORMAL";
24
+ ShaderLocation[ShaderLocation["UV"] = 14] = "UV";
25
+ ShaderLocation[ShaderLocation["LINEAR"] = 15] = "LINEAR";
24
26
  return ShaderLocation;
25
27
  }({});
26
28
  function getCommonStyleAttributeOptions(name) {
@@ -135,6 +137,7 @@ function getCommonStyleAttributeOptions(name) {
135
137
  type: _l7Core.AttributeType.Attribute,
136
138
  descriptor: {
137
139
  name: 'a_ThetaOffset',
140
+ shaderLocation: 15,
138
141
  buffer: {
139
142
  // give the WebGL driver a hint that this buffer may change
140
143
  usage: _l7Core.gl.STATIC_DRAW,