@antv/l7-layers 2.25.7 → 2.25.10

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 (717) hide show
  1. package/es/canvas/index.d.ts +18 -0
  2. package/es/canvas/index.js +70 -0
  3. package/es/canvas/models/canvas.d.ts +23 -0
  4. package/es/canvas/models/canvas.js +141 -0
  5. package/es/canvas/models/constants.d.ts +2 -0
  6. package/es/canvas/models/constants.js +6 -0
  7. package/es/canvas/models/index.d.ts +2 -0
  8. package/es/canvas/models/index.js +2 -0
  9. package/es/citybuilding/building.d.ts +7 -0
  10. package/es/citybuilding/building.js +25 -0
  11. package/es/citybuilding/models/build.d.ts +33 -0
  12. package/es/citybuilding/models/build.js +160 -0
  13. package/es/citybuilding/shaders/build_frag.glsl +123 -0
  14. package/es/citybuilding/shaders/build_vert.glsl +58 -0
  15. package/es/core/BaseLayer.d.ts +265 -0
  16. package/es/core/BaseLayer.js +1310 -0
  17. package/es/core/BaseModel.d.ts +95 -0
  18. package/es/core/BaseModel.js +367 -0
  19. package/es/core/CommonStyleAttribute.d.ts +16 -0
  20. package/es/core/CommonStyleAttribute.js +114 -0
  21. package/es/core/LayerPickService.d.ts +12 -0
  22. package/es/core/LayerPickService.js +102 -0
  23. package/es/core/TextureService.d.ts +15 -0
  24. package/es/core/TextureService.js +65 -0
  25. package/es/core/constant.d.ts +6 -0
  26. package/es/core/constant.js +19 -0
  27. package/es/core/interface.d.ts +284 -0
  28. package/es/core/interface.js +32 -0
  29. package/es/core/line_trangluation.d.ts +19 -0
  30. package/es/core/line_trangluation.js +86 -0
  31. package/es/core/schema.d.ts +27 -0
  32. package/es/core/schema.js +25 -0
  33. package/es/core/shape/Path.d.ts +40 -0
  34. package/es/core/shape/Path.js +69 -0
  35. package/es/core/shape/arrow.d.ts +25 -0
  36. package/es/core/shape/arrow.js +144 -0
  37. package/es/core/shape/extrude.d.ts +17 -0
  38. package/es/core/shape/extrude.js +133 -0
  39. package/es/core/triangulation.d.ts +136 -0
  40. package/es/core/triangulation.js +601 -0
  41. package/es/core/utils.d.ts +5 -0
  42. package/es/core/utils.js +36 -0
  43. package/es/earth/index.d.ts +22 -0
  44. package/es/earth/index.js +54 -0
  45. package/es/earth/models/atmosphere.d.ts +30 -0
  46. package/es/earth/models/atmosphere.js +116 -0
  47. package/es/earth/models/base.d.ts +37 -0
  48. package/es/earth/models/base.js +172 -0
  49. package/es/earth/models/bloomsphere.d.ts +30 -0
  50. package/es/earth/models/bloomsphere.js +115 -0
  51. package/es/earth/shaders/atmosphere/atmosphere_frag.glsl +17 -0
  52. package/es/earth/shaders/atmosphere/atmosphere_vert.glsl +24 -0
  53. package/es/earth/shaders/base/base_frag.glsl +11 -0
  54. package/es/earth/shaders/base/base_vert.glsl +52 -0
  55. package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +15 -0
  56. package/es/earth/shaders/bloomshpere/bloomsphere_vert.glsl +20 -0
  57. package/es/earth/utils.d.ts +26 -0
  58. package/es/earth/utils.js +99 -0
  59. package/es/geometry/index.d.ts +22 -0
  60. package/es/geometry/index.js +53 -0
  61. package/es/geometry/models/billboard.d.ts +39 -0
  62. package/es/geometry/models/billboard.js +175 -0
  63. package/es/geometry/models/index.d.ts +5 -0
  64. package/es/geometry/models/index.js +9 -0
  65. package/es/geometry/models/plane.d.ts +58 -0
  66. package/es/geometry/models/plane.js +308 -0
  67. package/es/geometry/models/sprite.d.ts +48 -0
  68. package/es/geometry/models/sprite.js +225 -0
  69. package/es/geometry/shaders/billboard_frag.glsl +18 -0
  70. package/es/geometry/shaders/billboard_vert.glsl +43 -0
  71. package/es/geometry/shaders/plane_frag.glsl +23 -0
  72. package/es/geometry/shaders/plane_vert.glsl +31 -0
  73. package/es/geometry/shaders/sprite_frag.glsl +23 -0
  74. package/es/geometry/shaders/sprite_vert.glsl +21 -0
  75. package/es/heatmap/index.d.ts +13 -0
  76. package/es/heatmap/index.js +87 -0
  77. package/es/heatmap/models/grid.d.ts +29 -0
  78. package/es/heatmap/models/grid.js +83 -0
  79. package/es/heatmap/models/grid3d.d.ts +31 -0
  80. package/es/heatmap/models/grid3d.js +122 -0
  81. package/es/heatmap/models/heatmap.d.ts +46 -0
  82. package/es/heatmap/models/heatmap.js +447 -0
  83. package/es/heatmap/models/hexagon.d.ts +29 -0
  84. package/es/heatmap/models/hexagon.js +83 -0
  85. package/es/heatmap/models/index.d.ts +5 -0
  86. package/es/heatmap/models/index.js +12 -0
  87. package/es/heatmap/shaders/grid/grid_frag.glsl +9 -0
  88. package/es/heatmap/shaders/grid/grid_vert.glsl +30 -0
  89. package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +17 -0
  90. package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +34 -0
  91. package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +23 -0
  92. package/es/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +59 -0
  93. package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +40 -0
  94. package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +17 -0
  95. package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +36 -0
  96. package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +21 -0
  97. package/es/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
  98. package/es/heatmap/shaders/hexagon/hexagon_vert.glsl +30 -0
  99. package/es/heatmap/triangulation.d.ts +5 -0
  100. package/es/heatmap/triangulation.js +33 -0
  101. package/es/image/index.d.ts +9 -0
  102. package/es/image/index.js +28 -0
  103. package/es/image/models/image.d.ts +31 -0
  104. package/es/image/models/image.js +113 -0
  105. package/es/image/models/index.d.ts +5 -0
  106. package/es/image/models/index.js +5 -0
  107. package/es/image/shaders/dataImage_frag.glsl +32 -0
  108. package/es/image/shaders/image_frag.glsl +38 -0
  109. package/es/image/shaders/image_vert.glsl +20 -0
  110. package/es/index.d.ts +18 -0
  111. package/es/index.js +18 -0
  112. package/es/line/index.d.ts +36 -0
  113. package/es/line/index.js +90 -0
  114. package/es/line/models/arc.d.ts +40 -0
  115. package/es/line/models/arc.js +279 -0
  116. package/es/line/models/arc_3d.d.ts +40 -0
  117. package/es/line/models/arc_3d.js +269 -0
  118. package/es/line/models/flow.d.ts +31 -0
  119. package/es/line/models/flow.js +140 -0
  120. package/es/line/models/great_circle.d.ts +34 -0
  121. package/es/line/models/great_circle.js +240 -0
  122. package/es/line/models/index.d.ts +5 -0
  123. package/es/line/models/index.js +18 -0
  124. package/es/line/models/line.d.ts +44 -0
  125. package/es/line/models/line.js +273 -0
  126. package/es/line/models/simple_line.d.ts +33 -0
  127. package/es/line/models/simple_line.js +118 -0
  128. package/es/line/models/wall.d.ts +34 -0
  129. package/es/line/models/wall.js +223 -0
  130. package/es/line/shaders/arc/line_arc_frag.glsl +92 -0
  131. package/es/line/shaders/arc/line_arc_vert.glsl +156 -0
  132. package/es/line/shaders/arc3d/line_arc_3d_frag.glsl +108 -0
  133. package/es/line/shaders/arc3d/line_arc_3d_vert.glsl +177 -0
  134. package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
  135. package/es/line/shaders/flow/flow_line_vert.glsl +76 -0
  136. package/es/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +99 -0
  137. package/es/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +165 -0
  138. package/es/line/shaders/line/line_frag.glsl +122 -0
  139. package/es/line/shaders/line/line_vert.glsl +101 -0
  140. package/es/line/shaders/simple/simpleline_frag.glsl +30 -0
  141. package/es/line/shaders/simple/simpleline_vert.glsl +45 -0
  142. package/es/line/shaders/wall/wall_frag.glsl +94 -0
  143. package/es/line/shaders/wall/wall_vert.glsl +90 -0
  144. package/es/mask/index.d.ts +16 -0
  145. package/es/mask/index.js +21 -0
  146. package/es/mask/models/fill.d.ts +18 -0
  147. package/es/mask/models/fill.js +61 -0
  148. package/es/mask/models/index.d.ts +5 -0
  149. package/es/mask/models/index.js +5 -0
  150. package/es/mask/shaders/mask_vert.glsl +14 -0
  151. package/es/plugins/DataMappingPlugin.d.ts +12 -0
  152. package/es/plugins/DataMappingPlugin.js +226 -0
  153. package/es/plugins/DataSourcePlugin.d.ts +6 -0
  154. package/es/plugins/DataSourcePlugin.js +75 -0
  155. package/es/plugins/FeatureScalePlugin.d.ts +20 -0
  156. package/es/plugins/FeatureScalePlugin.js +295 -0
  157. package/es/plugins/LayerAnimateStylePlugin.d.ts +4 -0
  158. package/es/plugins/LayerAnimateStylePlugin.js +14 -0
  159. package/es/plugins/LayerMaskPlugin.d.ts +7 -0
  160. package/es/plugins/LayerMaskPlugin.js +19 -0
  161. package/es/plugins/LayerModelPlugin.d.ts +10 -0
  162. package/es/plugins/LayerModelPlugin.js +60 -0
  163. package/es/plugins/LayerStylePlugin.d.ts +7 -0
  164. package/es/plugins/LayerStylePlugin.js +18 -0
  165. package/es/plugins/LightingPlugin.d.ts +35 -0
  166. package/es/plugins/LightingPlugin.js +84 -0
  167. package/es/plugins/MultiPassRendererPlugin.d.ts +22 -0
  168. package/es/plugins/MultiPassRendererPlugin.js +52 -0
  169. package/es/plugins/PixelPickingPlugin.d.ts +11 -0
  170. package/es/plugins/PixelPickingPlugin.js +146 -0
  171. package/es/plugins/RegisterStyleAttributePlugin.d.ts +10 -0
  172. package/es/plugins/RegisterStyleAttributePlugin.js +72 -0
  173. package/es/plugins/ShaderUniformPlugin.d.ts +17 -0
  174. package/es/plugins/ShaderUniformPlugin.js +196 -0
  175. package/es/plugins/UpdateModelPlugin.d.ts +7 -0
  176. package/es/plugins/UpdateModelPlugin.js +20 -0
  177. package/es/plugins/UpdateStyleAttributePlugin.d.ts +9 -0
  178. package/es/plugins/UpdateStyleAttributePlugin.js +54 -0
  179. package/es/plugins/index.d.ts +15 -0
  180. package/es/plugins/index.js +18 -0
  181. package/es/point/index.d.ts +35 -0
  182. package/es/point/index.js +153 -0
  183. package/es/point/models/billboard_point.d.ts +35 -0
  184. package/es/point/models/billboard_point.js +95 -0
  185. package/es/point/models/earthExtrude.d.ts +32 -0
  186. package/es/point/models/earthExtrude.js +199 -0
  187. package/es/point/models/earthFill.d.ts +31 -0
  188. package/es/point/models/earthFill.js +158 -0
  189. package/es/point/models/extrude.d.ts +32 -0
  190. package/es/point/models/extrude.js +195 -0
  191. package/es/point/models/fill.d.ts +47 -0
  192. package/es/point/models/fill.js +180 -0
  193. package/es/point/models/fillImage.d.ts +42 -0
  194. package/es/point/models/fillImage.js +189 -0
  195. package/es/point/models/image.d.ts +48 -0
  196. package/es/point/models/image.js +293 -0
  197. package/es/point/models/index.d.ts +5 -0
  198. package/es/point/models/index.js +24 -0
  199. package/es/point/models/normal.d.ts +36 -0
  200. package/es/point/models/normal.js +89 -0
  201. package/es/point/models/radar.d.ts +37 -0
  202. package/es/point/models/radar.js +115 -0
  203. package/es/point/models/text.d.ts +85 -0
  204. package/es/point/models/text.js +503 -0
  205. package/es/point/shaders/billboard/billboard_point_frag.glsl +48 -0
  206. package/es/point/shaders/billboard/billboard_point_vert.glsl +33 -0
  207. package/es/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
  208. package/es/point/shaders/earthExtrude/earthExtrude_vert.glsl +118 -0
  209. package/es/point/shaders/earthFill/earthFill_frag.glsl +79 -0
  210. package/es/point/shaders/earthFill/earthFill_vert.glsl +46 -0
  211. package/es/point/shaders/extrude/extrude_frag.glsl +29 -0
  212. package/es/point/shaders/extrude/extrude_vert.glsl +95 -0
  213. package/es/point/shaders/fill/fill_frag.glsl +97 -0
  214. package/es/point/shaders/fill/fill_vert.glsl +79 -0
  215. package/es/point/shaders/fillImage/fillImage_frag.glsl +23 -0
  216. package/es/point/shaders/fillImage/fillImage_vert.glsl +46 -0
  217. package/es/point/shaders/image/image_frag.glsl +45 -0
  218. package/es/point/shaders/image/image_vert.glsl +47 -0
  219. package/es/point/shaders/normal/normal_frag.glsl +5 -0
  220. package/es/point/shaders/normal/normal_vert.glsl +22 -0
  221. package/es/point/shaders/radar/radar_frag.glsl +52 -0
  222. package/es/point/shaders/radar/radar_vert.glsl +53 -0
  223. package/es/point/shaders/text/text_frag.glsl +47 -0
  224. package/es/point/shaders/text/text_vert.glsl +65 -0
  225. package/es/point/shape/extrude.d.ts +15 -0
  226. package/es/point/shape/extrude.js +48 -0
  227. package/es/polygon/index.d.ts +18 -0
  228. package/es/polygon/index.js +71 -0
  229. package/es/polygon/models/extrude.d.ts +41 -0
  230. package/es/polygon/models/extrude.js +248 -0
  231. package/es/polygon/models/extrusion.d.ts +40 -0
  232. package/es/polygon/models/extrusion.js +137 -0
  233. package/es/polygon/models/fill.d.ts +32 -0
  234. package/es/polygon/models/fill.js +127 -0
  235. package/es/polygon/models/index.d.ts +5 -0
  236. package/es/polygon/models/index.js +26 -0
  237. package/es/polygon/models/ocean.d.ts +37 -0
  238. package/es/polygon/models/ocean.js +172 -0
  239. package/es/polygon/models/water.d.ts +35 -0
  240. package/es/polygon/models/water.js +150 -0
  241. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +24 -0
  242. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +49 -0
  243. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +53 -0
  244. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +74 -0
  245. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +55 -0
  246. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +54 -0
  247. package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +8 -0
  248. package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +24 -0
  249. package/es/polygon/shaders/fill/fill_frag.glsl +8 -0
  250. package/es/polygon/shaders/fill/fill_linear_frag.glsl +23 -0
  251. package/es/polygon/shaders/fill/fill_linear_vert.glsl +36 -0
  252. package/es/polygon/shaders/fill/fill_vert.glsl +35 -0
  253. package/es/polygon/shaders/ocean/ocean_frag.glsl +277 -0
  254. package/es/polygon/shaders/ocean/ocean_vert.glsl +21 -0
  255. package/es/polygon/shaders/water/polygon_water_frag.glsl +78 -0
  256. package/es/polygon/shaders/water/polygon_water_vert.glsl +22 -0
  257. package/es/raster/buffers/triangulation.d.ts +6 -0
  258. package/es/raster/buffers/triangulation.js +25 -0
  259. package/es/raster/index.d.ts +11 -0
  260. package/es/raster/index.js +55 -0
  261. package/es/raster/models/index.d.ts +5 -0
  262. package/es/raster/models/index.js +10 -0
  263. package/es/raster/models/raster.d.ts +35 -0
  264. package/es/raster/models/raster.js +156 -0
  265. package/es/raster/models/rasterRgb.d.ts +35 -0
  266. package/es/raster/models/rasterRgb.js +158 -0
  267. package/es/raster/models/rasterTerrainRgb.d.ts +30 -0
  268. package/es/raster/models/rasterTerrainRgb.js +118 -0
  269. package/es/raster/shaders/raster/raster_2d_frag.glsl +37 -0
  270. package/es/raster/shaders/raster/raster_2d_vert.glsl +21 -0
  271. package/es/raster/shaders/rgb/raster_rgb_frag.glsl +30 -0
  272. package/es/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
  273. package/es/raster/shaders/terrain/terrain_rgb_frag.glsl +40 -0
  274. package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +19 -0
  275. package/es/shader/minify_frag.glsl +11 -0
  276. package/es/shader/minify_picking_frag.glsl +10 -0
  277. package/es/tile/core/BaseLayer.d.ts +50 -0
  278. package/es/tile/core/BaseLayer.js +256 -0
  279. package/es/tile/core/TileDebugLayer.d.ts +15 -0
  280. package/es/tile/core/TileDebugLayer.js +23 -0
  281. package/es/tile/interaction/getFeatureData.d.ts +0 -0
  282. package/es/tile/interaction/getFeatureData.js +0 -0
  283. package/es/tile/interaction/getRasterData.d.ts +4 -0
  284. package/es/tile/interaction/getRasterData.js +45 -0
  285. package/es/tile/interaction/utils.d.ts +11 -0
  286. package/es/tile/interaction/utils.js +69 -0
  287. package/es/tile/interface.d.ts +29 -0
  288. package/es/tile/interface.js +1 -0
  289. package/es/tile/service/TileLayerService.d.ts +58 -0
  290. package/es/tile/service/TileLayerService.js +195 -0
  291. package/es/tile/service/TilePickService.d.ts +26 -0
  292. package/es/tile/service/TilePickService.js +126 -0
  293. package/es/tile/service/TileSourceService.d.ts +7 -0
  294. package/es/tile/service/TileSourceService.js +26 -0
  295. package/es/tile/tile/DebugTile.d.ts +16 -0
  296. package/es/tile/tile/DebugTile.js +47 -0
  297. package/es/tile/tile/ImageTile.d.ts +14 -0
  298. package/es/tile/tile/ImageTile.js +39 -0
  299. package/es/tile/tile/MaskTile.d.ts +18 -0
  300. package/es/tile/tile/MaskTile.js +54 -0
  301. package/es/tile/tile/RasterRGBTile.d.ts +11 -0
  302. package/es/tile/tile/RasterRGBTile.js +47 -0
  303. package/es/tile/tile/RasterTerrainRGBTile.d.ts +14 -0
  304. package/es/tile/tile/RasterTerrainRGBTile.js +39 -0
  305. package/es/tile/tile/RasterTile.d.ts +18 -0
  306. package/es/tile/tile/RasterTile.js +81 -0
  307. package/es/tile/tile/Tile.d.ts +112 -0
  308. package/es/tile/tile/Tile.js +166 -0
  309. package/es/tile/tile/VectorTile.d.ts +26 -0
  310. package/es/tile/tile/VectorTile.js +87 -0
  311. package/es/tile/tile/index.d.ts +12 -0
  312. package/es/tile/tile/index.js +44 -0
  313. package/es/tile/tile/util.d.ts +5 -0
  314. package/es/tile/tile/util.js +18 -0
  315. package/es/tile/utils/constants.d.ts +1 -0
  316. package/es/tile/utils/constants.js +8 -0
  317. package/es/tile/utils/utils.d.ts +8 -0
  318. package/es/tile/utils/utils.js +11 -0
  319. package/es/utils/blend.d.ts +2 -0
  320. package/es/utils/blend.js +57 -0
  321. package/es/utils/collision-index.d.ts +47 -0
  322. package/es/utils/collision-index.js +87 -0
  323. package/es/utils/extrude_polyline.d.ts +53 -0
  324. package/es/utils/extrude_polyline.js +319 -0
  325. package/es/utils/grid-index.d.ts +28 -0
  326. package/es/utils/grid-index.js +128 -0
  327. package/es/utils/identityScale.d.ts +8 -0
  328. package/es/utils/identityScale.js +26 -0
  329. package/es/utils/load-image.d.ts +1 -0
  330. package/es/utils/load-image.js +22 -0
  331. package/es/utils/multiPassRender.d.ts +16 -0
  332. package/es/utils/multiPassRender.js +37 -0
  333. package/es/utils/polylineNormal.d.ts +9 -0
  334. package/es/utils/polylineNormal.js +182 -0
  335. package/es/utils/rampcolor_legend.d.ts +6 -0
  336. package/es/utils/rampcolor_legend.js +12 -0
  337. package/es/utils/scale.d.ts +87 -0
  338. package/es/utils/scale.js +595 -0
  339. package/es/utils/simpleLine.d.ts +23 -0
  340. package/es/utils/simpleLine.js +76 -0
  341. package/es/utils/stencil.d.ts +7 -0
  342. package/es/utils/stencil.js +49 -0
  343. package/es/utils/symbol-layout.d.ts +43 -0
  344. package/es/utils/symbol-layout.js +251 -0
  345. package/es/wind/index.d.ts +11 -0
  346. package/es/wind/index.js +34 -0
  347. package/es/wind/models/index.d.ts +5 -0
  348. package/es/wind/models/index.js +5 -0
  349. package/es/wind/models/utils.d.ts +19 -0
  350. package/es/wind/models/utils.js +213 -0
  351. package/es/wind/models/wind.d.ts +38 -0
  352. package/es/wind/models/wind.js +240 -0
  353. package/es/wind/models/windRender.d.ts +104 -0
  354. package/es/wind/models/windRender.js +333 -0
  355. package/es/wind/models/windShader.d.ts +12 -0
  356. package/es/wind/models/windShader.js +151 -0
  357. package/es/wind/shaders/wind_frag.glsl +9 -0
  358. package/es/wind/shaders/wind_vert.glsl +14 -0
  359. package/lib/canvas/index.d.ts +18 -0
  360. package/lib/canvas/index.js +79 -0
  361. package/lib/canvas/models/canvas.d.ts +23 -0
  362. package/lib/canvas/models/canvas.js +149 -0
  363. package/lib/canvas/models/constants.d.ts +2 -0
  364. package/lib/canvas/models/constants.js +12 -0
  365. package/lib/canvas/models/index.d.ts +2 -0
  366. package/lib/canvas/models/index.js +27 -0
  367. package/lib/citybuilding/building.d.ts +7 -0
  368. package/lib/citybuilding/building.js +33 -0
  369. package/lib/citybuilding/models/build.d.ts +33 -0
  370. package/lib/citybuilding/models/build.js +168 -0
  371. package/lib/citybuilding/shaders/build_frag.glsl +123 -0
  372. package/lib/citybuilding/shaders/build_vert.glsl +58 -0
  373. package/lib/core/BaseLayer.d.ts +265 -0
  374. package/lib/core/BaseLayer.js +1317 -0
  375. package/lib/core/BaseModel.d.ts +95 -0
  376. package/lib/core/BaseModel.js +375 -0
  377. package/lib/core/CommonStyleAttribute.d.ts +16 -0
  378. package/lib/core/CommonStyleAttribute.js +120 -0
  379. package/lib/core/LayerPickService.d.ts +12 -0
  380. package/lib/core/LayerPickService.js +110 -0
  381. package/lib/core/TextureService.d.ts +15 -0
  382. package/lib/core/TextureService.js +73 -0
  383. package/lib/core/constant.d.ts +6 -0
  384. package/lib/core/constant.js +25 -0
  385. package/lib/core/interface.d.ts +284 -0
  386. package/lib/core/interface.js +34 -0
  387. package/lib/core/line_trangluation.d.ts +19 -0
  388. package/lib/core/line_trangluation.js +94 -0
  389. package/lib/core/schema.d.ts +27 -0
  390. package/lib/core/schema.js +31 -0
  391. package/lib/core/shape/Path.d.ts +40 -0
  392. package/lib/core/shape/Path.js +81 -0
  393. package/lib/core/shape/arrow.d.ts +25 -0
  394. package/lib/core/shape/arrow.js +158 -0
  395. package/lib/core/shape/extrude.d.ts +17 -0
  396. package/lib/core/shape/extrude.js +142 -0
  397. package/lib/core/triangulation.d.ts +136 -0
  398. package/lib/core/triangulation.js +628 -0
  399. package/lib/core/utils.d.ts +5 -0
  400. package/lib/core/utils.js +44 -0
  401. package/lib/earth/index.d.ts +22 -0
  402. package/lib/earth/index.js +62 -0
  403. package/lib/earth/models/atmosphere.d.ts +30 -0
  404. package/lib/earth/models/atmosphere.js +124 -0
  405. package/lib/earth/models/base.d.ts +37 -0
  406. package/lib/earth/models/base.js +180 -0
  407. package/lib/earth/models/bloomsphere.d.ts +30 -0
  408. package/lib/earth/models/bloomsphere.js +123 -0
  409. package/lib/earth/shaders/atmosphere/atmosphere_frag.glsl +17 -0
  410. package/lib/earth/shaders/atmosphere/atmosphere_vert.glsl +24 -0
  411. package/lib/earth/shaders/base/base_frag.glsl +11 -0
  412. package/lib/earth/shaders/base/base_vert.glsl +52 -0
  413. package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +15 -0
  414. package/lib/earth/shaders/bloomshpere/bloomsphere_vert.glsl +20 -0
  415. package/lib/earth/utils.d.ts +26 -0
  416. package/lib/earth/utils.js +107 -0
  417. package/lib/geometry/index.d.ts +22 -0
  418. package/lib/geometry/index.js +61 -0
  419. package/lib/geometry/models/billboard.d.ts +39 -0
  420. package/lib/geometry/models/billboard.js +183 -0
  421. package/lib/geometry/models/index.d.ts +5 -0
  422. package/lib/geometry/models/index.js +16 -0
  423. package/lib/geometry/models/plane.d.ts +58 -0
  424. package/lib/geometry/models/plane.js +316 -0
  425. package/lib/geometry/models/sprite.d.ts +48 -0
  426. package/lib/geometry/models/sprite.js +233 -0
  427. package/lib/geometry/shaders/billboard_frag.glsl +18 -0
  428. package/lib/geometry/shaders/billboard_vert.glsl +43 -0
  429. package/lib/geometry/shaders/plane_frag.glsl +23 -0
  430. package/lib/geometry/shaders/plane_vert.glsl +31 -0
  431. package/lib/geometry/shaders/sprite_frag.glsl +23 -0
  432. package/lib/geometry/shaders/sprite_vert.glsl +21 -0
  433. package/lib/heatmap/index.d.ts +13 -0
  434. package/lib/heatmap/index.js +95 -0
  435. package/lib/heatmap/models/grid.d.ts +29 -0
  436. package/lib/heatmap/models/grid.js +91 -0
  437. package/lib/heatmap/models/grid3d.d.ts +31 -0
  438. package/lib/heatmap/models/grid3d.js +130 -0
  439. package/lib/heatmap/models/heatmap.d.ts +46 -0
  440. package/lib/heatmap/models/heatmap.js +455 -0
  441. package/lib/heatmap/models/hexagon.d.ts +29 -0
  442. package/lib/heatmap/models/hexagon.js +91 -0
  443. package/lib/heatmap/models/index.d.ts +5 -0
  444. package/lib/heatmap/models/index.js +19 -0
  445. package/lib/heatmap/shaders/grid/grid_frag.glsl +9 -0
  446. package/lib/heatmap/shaders/grid/grid_vert.glsl +30 -0
  447. package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +17 -0
  448. package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +34 -0
  449. package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +23 -0
  450. package/lib/heatmap/shaders/heatmap/heatmap_3d_vert.glsl +59 -0
  451. package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +40 -0
  452. package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +17 -0
  453. package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +36 -0
  454. package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +21 -0
  455. package/lib/heatmap/shaders/hexagon/hexagon_frag.glsl +8 -0
  456. package/lib/heatmap/shaders/hexagon/hexagon_vert.glsl +30 -0
  457. package/lib/heatmap/triangulation.d.ts +5 -0
  458. package/lib/heatmap/triangulation.js +39 -0
  459. package/lib/image/index.d.ts +9 -0
  460. package/lib/image/index.js +36 -0
  461. package/lib/image/models/image.d.ts +31 -0
  462. package/lib/image/models/image.js +121 -0
  463. package/lib/image/models/index.d.ts +5 -0
  464. package/lib/image/models/index.js +12 -0
  465. package/lib/image/shaders/dataImage_frag.glsl +32 -0
  466. package/lib/image/shaders/image_frag.glsl +38 -0
  467. package/lib/image/shaders/image_vert.glsl +20 -0
  468. package/lib/index.d.ts +18 -0
  469. package/lib/index.js +148 -0
  470. package/lib/line/index.d.ts +36 -0
  471. package/lib/line/index.js +98 -0
  472. package/lib/line/models/arc.d.ts +40 -0
  473. package/lib/line/models/arc.js +287 -0
  474. package/lib/line/models/arc_3d.d.ts +40 -0
  475. package/lib/line/models/arc_3d.js +277 -0
  476. package/lib/line/models/flow.d.ts +31 -0
  477. package/lib/line/models/flow.js +148 -0
  478. package/lib/line/models/great_circle.d.ts +34 -0
  479. package/lib/line/models/great_circle.js +248 -0
  480. package/lib/line/models/index.d.ts +5 -0
  481. package/lib/line/models/index.js +25 -0
  482. package/lib/line/models/line.d.ts +44 -0
  483. package/lib/line/models/line.js +281 -0
  484. package/lib/line/models/simple_line.d.ts +33 -0
  485. package/lib/line/models/simple_line.js +126 -0
  486. package/lib/line/models/wall.d.ts +34 -0
  487. package/lib/line/models/wall.js +231 -0
  488. package/lib/line/shaders/arc/line_arc_frag.glsl +92 -0
  489. package/lib/line/shaders/arc/line_arc_vert.glsl +156 -0
  490. package/lib/line/shaders/arc3d/line_arc_3d_frag.glsl +108 -0
  491. package/lib/line/shaders/arc3d/line_arc_3d_vert.glsl +177 -0
  492. package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
  493. package/lib/line/shaders/flow/flow_line_vert.glsl +76 -0
  494. package/lib/line/shaders/greatCircle/line_arc_great_circle_frag.glsl +99 -0
  495. package/lib/line/shaders/greatCircle/line_arc_great_circle_vert.glsl +165 -0
  496. package/lib/line/shaders/line/line_frag.glsl +122 -0
  497. package/lib/line/shaders/line/line_vert.glsl +101 -0
  498. package/lib/line/shaders/simple/simpleline_frag.glsl +30 -0
  499. package/lib/line/shaders/simple/simpleline_vert.glsl +45 -0
  500. package/lib/line/shaders/wall/wall_frag.glsl +94 -0
  501. package/lib/line/shaders/wall/wall_vert.glsl +90 -0
  502. package/lib/mask/index.d.ts +16 -0
  503. package/lib/mask/index.js +29 -0
  504. package/lib/mask/models/fill.d.ts +18 -0
  505. package/lib/mask/models/fill.js +69 -0
  506. package/lib/mask/models/index.d.ts +5 -0
  507. package/lib/mask/models/index.js +12 -0
  508. package/lib/mask/shaders/mask_vert.glsl +14 -0
  509. package/lib/plugins/DataMappingPlugin.d.ts +12 -0
  510. package/lib/plugins/DataMappingPlugin.js +234 -0
  511. package/lib/plugins/DataSourcePlugin.d.ts +6 -0
  512. package/lib/plugins/DataSourcePlugin.js +83 -0
  513. package/lib/plugins/FeatureScalePlugin.d.ts +20 -0
  514. package/lib/plugins/FeatureScalePlugin.js +303 -0
  515. package/lib/plugins/LayerAnimateStylePlugin.d.ts +4 -0
  516. package/lib/plugins/LayerAnimateStylePlugin.js +22 -0
  517. package/lib/plugins/LayerMaskPlugin.d.ts +7 -0
  518. package/lib/plugins/LayerMaskPlugin.js +26 -0
  519. package/lib/plugins/LayerModelPlugin.d.ts +10 -0
  520. package/lib/plugins/LayerModelPlugin.js +68 -0
  521. package/lib/plugins/LayerStylePlugin.d.ts +7 -0
  522. package/lib/plugins/LayerStylePlugin.js +25 -0
  523. package/lib/plugins/LightingPlugin.d.ts +35 -0
  524. package/lib/plugins/LightingPlugin.js +93 -0
  525. package/lib/plugins/MultiPassRendererPlugin.d.ts +22 -0
  526. package/lib/plugins/MultiPassRendererPlugin.js +59 -0
  527. package/lib/plugins/PixelPickingPlugin.d.ts +11 -0
  528. package/lib/plugins/PixelPickingPlugin.js +154 -0
  529. package/lib/plugins/RegisterStyleAttributePlugin.d.ts +10 -0
  530. package/lib/plugins/RegisterStyleAttributePlugin.js +78 -0
  531. package/lib/plugins/ShaderUniformPlugin.d.ts +17 -0
  532. package/lib/plugins/ShaderUniformPlugin.js +203 -0
  533. package/lib/plugins/UpdateModelPlugin.d.ts +7 -0
  534. package/lib/plugins/UpdateModelPlugin.js +27 -0
  535. package/lib/plugins/UpdateStyleAttributePlugin.d.ts +9 -0
  536. package/lib/plugins/UpdateStyleAttributePlugin.js +61 -0
  537. package/lib/plugins/index.d.ts +15 -0
  538. package/lib/plugins/index.js +26 -0
  539. package/lib/point/index.d.ts +35 -0
  540. package/lib/point/index.js +161 -0
  541. package/lib/point/models/billboard_point.d.ts +35 -0
  542. package/lib/point/models/billboard_point.js +104 -0
  543. package/lib/point/models/earthExtrude.d.ts +32 -0
  544. package/lib/point/models/earthExtrude.js +207 -0
  545. package/lib/point/models/earthFill.d.ts +31 -0
  546. package/lib/point/models/earthFill.js +166 -0
  547. package/lib/point/models/extrude.d.ts +32 -0
  548. package/lib/point/models/extrude.js +203 -0
  549. package/lib/point/models/fill.d.ts +47 -0
  550. package/lib/point/models/fill.js +188 -0
  551. package/lib/point/models/fillImage.d.ts +42 -0
  552. package/lib/point/models/fillImage.js +197 -0
  553. package/lib/point/models/image.d.ts +48 -0
  554. package/lib/point/models/image.js +301 -0
  555. package/lib/point/models/index.d.ts +5 -0
  556. package/lib/point/models/index.js +32 -0
  557. package/lib/point/models/normal.d.ts +36 -0
  558. package/lib/point/models/normal.js +98 -0
  559. package/lib/point/models/radar.d.ts +37 -0
  560. package/lib/point/models/radar.js +123 -0
  561. package/lib/point/models/text.d.ts +85 -0
  562. package/lib/point/models/text.js +512 -0
  563. package/lib/point/shaders/billboard/billboard_point_frag.glsl +48 -0
  564. package/lib/point/shaders/billboard/billboard_point_vert.glsl +33 -0
  565. package/lib/point/shaders/earthExtrude/earthExtrude_frag.glsl +36 -0
  566. package/lib/point/shaders/earthExtrude/earthExtrude_vert.glsl +118 -0
  567. package/lib/point/shaders/earthFill/earthFill_frag.glsl +79 -0
  568. package/lib/point/shaders/earthFill/earthFill_vert.glsl +46 -0
  569. package/lib/point/shaders/extrude/extrude_frag.glsl +29 -0
  570. package/lib/point/shaders/extrude/extrude_vert.glsl +95 -0
  571. package/lib/point/shaders/fill/fill_frag.glsl +97 -0
  572. package/lib/point/shaders/fill/fill_vert.glsl +79 -0
  573. package/lib/point/shaders/fillImage/fillImage_frag.glsl +23 -0
  574. package/lib/point/shaders/fillImage/fillImage_vert.glsl +46 -0
  575. package/lib/point/shaders/image/image_frag.glsl +45 -0
  576. package/lib/point/shaders/image/image_vert.glsl +47 -0
  577. package/lib/point/shaders/normal/normal_frag.glsl +5 -0
  578. package/lib/point/shaders/normal/normal_vert.glsl +22 -0
  579. package/lib/point/shaders/radar/radar_frag.glsl +52 -0
  580. package/lib/point/shaders/radar/radar_vert.glsl +53 -0
  581. package/lib/point/shaders/text/text_frag.glsl +47 -0
  582. package/lib/point/shaders/text/text_vert.glsl +65 -0
  583. package/lib/point/shape/extrude.d.ts +15 -0
  584. package/lib/point/shape/extrude.js +56 -0
  585. package/lib/polygon/index.d.ts +18 -0
  586. package/lib/polygon/index.js +79 -0
  587. package/lib/polygon/models/extrude.d.ts +41 -0
  588. package/lib/polygon/models/extrude.js +256 -0
  589. package/lib/polygon/models/extrusion.d.ts +40 -0
  590. package/lib/polygon/models/extrusion.js +145 -0
  591. package/lib/polygon/models/fill.d.ts +32 -0
  592. package/lib/polygon/models/fill.js +135 -0
  593. package/lib/polygon/models/index.d.ts +5 -0
  594. package/lib/polygon/models/index.js +33 -0
  595. package/lib/polygon/models/ocean.d.ts +37 -0
  596. package/lib/polygon/models/ocean.js +180 -0
  597. package/lib/polygon/models/water.d.ts +35 -0
  598. package/lib/polygon/models/water.js +158 -0
  599. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +24 -0
  600. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +49 -0
  601. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +53 -0
  602. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +74 -0
  603. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +55 -0
  604. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +54 -0
  605. package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +8 -0
  606. package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +24 -0
  607. package/lib/polygon/shaders/fill/fill_frag.glsl +8 -0
  608. package/lib/polygon/shaders/fill/fill_linear_frag.glsl +23 -0
  609. package/lib/polygon/shaders/fill/fill_linear_vert.glsl +36 -0
  610. package/lib/polygon/shaders/fill/fill_vert.glsl +35 -0
  611. package/lib/polygon/shaders/ocean/ocean_frag.glsl +277 -0
  612. package/lib/polygon/shaders/ocean/ocean_vert.glsl +21 -0
  613. package/lib/polygon/shaders/water/polygon_water_frag.glsl +78 -0
  614. package/lib/polygon/shaders/water/polygon_water_vert.glsl +22 -0
  615. package/lib/raster/buffers/triangulation.d.ts +6 -0
  616. package/lib/raster/buffers/triangulation.js +33 -0
  617. package/lib/raster/index.d.ts +11 -0
  618. package/lib/raster/index.js +63 -0
  619. package/lib/raster/models/index.d.ts +5 -0
  620. package/lib/raster/models/index.js +17 -0
  621. package/lib/raster/models/raster.d.ts +35 -0
  622. package/lib/raster/models/raster.js +164 -0
  623. package/lib/raster/models/rasterRgb.d.ts +35 -0
  624. package/lib/raster/models/rasterRgb.js +166 -0
  625. package/lib/raster/models/rasterTerrainRgb.d.ts +30 -0
  626. package/lib/raster/models/rasterTerrainRgb.js +126 -0
  627. package/lib/raster/shaders/raster/raster_2d_frag.glsl +37 -0
  628. package/lib/raster/shaders/raster/raster_2d_vert.glsl +21 -0
  629. package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +30 -0
  630. package/lib/raster/shaders/rgb/raster_rgb_vert.glsl +21 -0
  631. package/lib/raster/shaders/terrain/terrain_rgb_frag.glsl +40 -0
  632. package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +19 -0
  633. package/lib/shader/minify_frag.glsl +11 -0
  634. package/lib/shader/minify_picking_frag.glsl +10 -0
  635. package/lib/tile/core/BaseLayer.d.ts +50 -0
  636. package/lib/tile/core/BaseLayer.js +264 -0
  637. package/lib/tile/core/TileDebugLayer.d.ts +15 -0
  638. package/lib/tile/core/TileDebugLayer.js +31 -0
  639. package/lib/tile/interaction/getFeatureData.d.ts +0 -0
  640. package/lib/tile/interaction/getFeatureData.js +1 -0
  641. package/lib/tile/interaction/getRasterData.d.ts +4 -0
  642. package/lib/tile/interaction/getRasterData.js +52 -0
  643. package/lib/tile/interaction/utils.d.ts +11 -0
  644. package/lib/tile/interaction/utils.js +81 -0
  645. package/lib/tile/interface.d.ts +29 -0
  646. package/lib/tile/interface.js +5 -0
  647. package/lib/tile/service/TileLayerService.d.ts +58 -0
  648. package/lib/tile/service/TileLayerService.js +203 -0
  649. package/lib/tile/service/TilePickService.d.ts +26 -0
  650. package/lib/tile/service/TilePickService.js +134 -0
  651. package/lib/tile/service/TileSourceService.d.ts +7 -0
  652. package/lib/tile/service/TileSourceService.js +35 -0
  653. package/lib/tile/tile/DebugTile.d.ts +16 -0
  654. package/lib/tile/tile/DebugTile.js +55 -0
  655. package/lib/tile/tile/ImageTile.d.ts +14 -0
  656. package/lib/tile/tile/ImageTile.js +47 -0
  657. package/lib/tile/tile/MaskTile.d.ts +18 -0
  658. package/lib/tile/tile/MaskTile.js +62 -0
  659. package/lib/tile/tile/RasterRGBTile.d.ts +11 -0
  660. package/lib/tile/tile/RasterRGBTile.js +55 -0
  661. package/lib/tile/tile/RasterTerrainRGBTile.d.ts +14 -0
  662. package/lib/tile/tile/RasterTerrainRGBTile.js +47 -0
  663. package/lib/tile/tile/RasterTile.d.ts +18 -0
  664. package/lib/tile/tile/RasterTile.js +89 -0
  665. package/lib/tile/tile/Tile.d.ts +112 -0
  666. package/lib/tile/tile/Tile.js +174 -0
  667. package/lib/tile/tile/VectorTile.d.ts +26 -0
  668. package/lib/tile/tile/VectorTile.js +95 -0
  669. package/lib/tile/tile/index.d.ts +12 -0
  670. package/lib/tile/tile/index.js +76 -0
  671. package/lib/tile/tile/util.d.ts +5 -0
  672. package/lib/tile/tile/util.js +26 -0
  673. package/lib/tile/utils/constants.d.ts +1 -0
  674. package/lib/tile/utils/constants.js +14 -0
  675. package/lib/tile/utils/utils.d.ts +8 -0
  676. package/lib/tile/utils/utils.js +18 -0
  677. package/lib/utils/blend.d.ts +2 -0
  678. package/lib/utils/blend.js +63 -0
  679. package/lib/utils/collision-index.d.ts +47 -0
  680. package/lib/utils/collision-index.js +96 -0
  681. package/lib/utils/extrude_polyline.d.ts +53 -0
  682. package/lib/utils/extrude_polyline.js +331 -0
  683. package/lib/utils/grid-index.d.ts +28 -0
  684. package/lib/utils/grid-index.js +135 -0
  685. package/lib/utils/identityScale.d.ts +8 -0
  686. package/lib/utils/identityScale.js +32 -0
  687. package/lib/utils/load-image.d.ts +1 -0
  688. package/lib/utils/load-image.js +29 -0
  689. package/lib/utils/multiPassRender.d.ts +16 -0
  690. package/lib/utils/multiPassRender.js +44 -0
  691. package/lib/utils/polylineNormal.d.ts +9 -0
  692. package/lib/utils/polylineNormal.js +191 -0
  693. package/lib/utils/rampcolor_legend.d.ts +6 -0
  694. package/lib/utils/rampcolor_legend.js +18 -0
  695. package/lib/utils/scale.d.ts +87 -0
  696. package/lib/utils/scale.js +610 -0
  697. package/lib/utils/simpleLine.d.ts +23 -0
  698. package/lib/utils/simpleLine.js +85 -0
  699. package/lib/utils/stencil.d.ts +7 -0
  700. package/lib/utils/stencil.js +56 -0
  701. package/lib/utils/symbol-layout.d.ts +43 -0
  702. package/lib/utils/symbol-layout.js +258 -0
  703. package/lib/wind/index.d.ts +11 -0
  704. package/lib/wind/index.js +42 -0
  705. package/lib/wind/models/index.d.ts +5 -0
  706. package/lib/wind/models/index.js +12 -0
  707. package/lib/wind/models/utils.d.ts +19 -0
  708. package/lib/wind/models/utils.js +229 -0
  709. package/lib/wind/models/wind.d.ts +38 -0
  710. package/lib/wind/models/wind.js +248 -0
  711. package/lib/wind/models/windRender.d.ts +104 -0
  712. package/lib/wind/models/windRender.js +343 -0
  713. package/lib/wind/models/windShader.d.ts +12 -0
  714. package/lib/wind/models/windShader.js +157 -0
  715. package/lib/wind/shaders/wind_frag.glsl +9 -0
  716. package/lib/wind/shaders/wind_vert.glsl +14 -0
  717. package/package.json +6 -6
@@ -0,0 +1,240 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import { AttributeType, gl } from '@antv/l7-core';
4
+ import { fp64LowPart, rgb2arr } from '@antv/l7-utils';
5
+ import BaseModel from "../../core/BaseModel";
6
+ import { LineArcTriangulation } from "../../core/triangulation";
7
+ /* babel-plugin-inline-import '../shaders/greatCircle/line_arc_great_circle_frag.glsl' */
8
+ const line_arc_frag = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0;\n};\n\nin vec4 v_dash_array;\nin vec4 v_color;\nin vec2 v_iconMapUV;\nin vec4 v_line_data;\nin float v_distance_ratio;\n\nout vec4 outputColor;\n#pragma include \"picking\"\n#pragma include \"project\"\n#pragma include \"projection\"\n\nvoid main() {\n\n float animateSpeed = 0.0;\n float d_segmentIndex = v_line_data.g;\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n outputColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n outputColor.a *= v_color.a;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n outputColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n if(u_line_type == LineTypeDash) {\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n // \u5B9E\u7EBF\u90E8\u5206\n } else {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) {\n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = v_line_data.b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_animate.x == Animate) {\n u = outputColor.a/v_color.a;\n }\n\n float v = v_line_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n // \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor = filterColor(outputColor + pattern);\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = filterColor(pattern);\n }\n } else {\n outputColor = filterColor(outputColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}\n";
9
+ /* babel-plugin-inline-import '../shaders/greatCircle/line_arc_great_circle_vert.glsl' */
10
+ const line_arc2d_vert = "#define LineTypeSolid (0.0)\n#define LineTypeDash (1.0)\n#define Animate (0.0)\n#define LineTexture (1.0)\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE) in vec4 a_Instance;\nlayout(location = ATTRIBUTE_LOCATION_INSTANCE_64LOW) in vec4 a_Instance64Low;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array: [10.0, 5., 0, 0];\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float segmentNumber;\n float u_line_type: 0.0;\n float u_icon_step: 100;\n float u_line_texture: 0.0;\n float u_textureBlend;\n float u_time;\n float u_linearColor: 0;\n};\n\nout vec4 v_dash_array;\nout vec4 v_color;\nout vec2 v_iconMapUV;\nout vec4 v_line_data;\nout float v_distance_ratio;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nfloat maps(float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return index / (segmentNumber - 1.0);\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(mix(source, target, segmentRatio), sqrt(max(0.0, vertex_height)));\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size) / 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return dir_screenspace.xy * sign(offset_direction);\n}\nfloat getAngularDist(vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) * sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 midPoint(vec2 source, vec2 target) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = 0.314;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2 * cos(theta2) + source.x, r2 * sin(theta2) + source.y);\n return mid;\n}\nfloat bezier3(vec3 arr, float t) {\n float ut = 1.0 - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\n\nvec2 interpolate(vec2 source, vec2 target, float angularDist, float t) {\n if (abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n\n}\n\nvoid main() {\n v_color = a_Color;\n v_color.a = v_color.a * opacity;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n if (u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n float total_Distance = pixelDistance(source, target) / 2.0 * PI;\n total_Distance = total_Distance * 16.0; // total_Distance*16.0 \u8C03\u6574\u9ED8\u8BA4\u7684\u6548\u679C\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n }\n\n if (u_animate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0), a_Instance64Low.xy);\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0), a_Instance64Low.zw);\n\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n\n v_line_data.g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F\n if (LineTexture == u_line_texture) {\n float d_arcDistrance = length(source - target);\n d_arcDistrance = project_pixel(d_arcDistrance);\n\n float d_pixelLen = project_pixel(u_icon_step) / 8.0;\n v_line_data.b = floor(d_arcDistrance / d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\n float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB\n v_line_data.a = lineOffsetWidth / linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_iconMapUV = a_iconMapUV;\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, 0, 1.0));\n setPickingColor(a_PickingColor);\n}\n\n";
11
+ const lineStyleObj = {
12
+ solid: 0.0,
13
+ dash: 1.0
14
+ };
15
+ export default class GreatCircleModel extends BaseModel {
16
+ constructor(...args) {
17
+ super(...args);
18
+ _defineProperty(this, "texture", void 0);
19
+ _defineProperty(this, "updateTexture", () => {
20
+ const {
21
+ createTexture2D
22
+ } = this.rendererService;
23
+ if (this.texture) {
24
+ this.texture.update({
25
+ data: this.iconService.getCanvas()
26
+ });
27
+ this.layer.render();
28
+ return;
29
+ }
30
+ this.texture = createTexture2D({
31
+ data: this.iconService.getCanvas(),
32
+ mag: gl.NEAREST,
33
+ min: gl.NEAREST,
34
+ premultiplyAlpha: false,
35
+ width: 1024,
36
+ height: this.iconService.canvasHeight || 128
37
+ });
38
+ this.textures = [this.texture];
39
+ });
40
+ }
41
+ get attributeLocation() {
42
+ return Object.assign(super.attributeLocation, {
43
+ MAX: super.attributeLocation.MAX,
44
+ SIZE: 9,
45
+ INSTANCE: 10,
46
+ INSTANCE_64LOW: 11,
47
+ UV: 12
48
+ });
49
+ }
50
+ getCommonUniformsInfo() {
51
+ const {
52
+ sourceColor,
53
+ targetColor,
54
+ textureBlend = 'normal',
55
+ lineType = 'solid',
56
+ dashArray = [10, 5],
57
+ lineTexture = false,
58
+ iconStep = 100,
59
+ segmentNumber = 30
60
+ } = this.layer.getLayerConfig();
61
+ const {
62
+ animateOption
63
+ } = this.layer.getLayerConfig();
64
+ if (dashArray.length === 2) {
65
+ dashArray.push(0, 0);
66
+ }
67
+ if (this.rendererService.getDirty()) {
68
+ var _this$texture;
69
+ (_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.bind();
70
+ }
71
+
72
+ // 转化渐变色
73
+ let useLinearColor = 0; // 默认不生效
74
+ let sourceColorArr = [0, 0, 0, 0];
75
+ let targetColorArr = [0, 0, 0, 0];
76
+ if (sourceColor && targetColor) {
77
+ sourceColorArr = rgb2arr(sourceColor);
78
+ targetColorArr = rgb2arr(targetColor);
79
+ useLinearColor = 1;
80
+ }
81
+ let u_time = this.layer.getLayerAnimateTime();
82
+ if (isNaN(u_time)) {
83
+ u_time = 0.0;
84
+ }
85
+ const commonOptions = {
86
+ u_animate: this.animateOption2Array(animateOption),
87
+ u_dash_array: dashArray,
88
+ u_sourceColor: sourceColorArr,
89
+ u_targetColor: targetColorArr,
90
+ u_textSize: [1024, this.iconService.canvasHeight || 128],
91
+ segmentNumber,
92
+ u_line_type: lineStyleObj[lineType] || 0.0,
93
+ u_icon_step: iconStep,
94
+ u_line_texture: lineTexture ? 1.0 : 0.0,
95
+ // 传入线的标识
96
+ u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
97
+ u_time,
98
+ // 纹理支持参数
99
+ // u_texture: this.texture, // 贴图
100
+ // 渐变色支持参数
101
+ u_linearColor: useLinearColor
102
+ };
103
+ const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
104
+ return commonBufferInfo;
105
+ }
106
+ // public getAnimateUniforms(): IModelUniform {
107
+ // const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;
108
+ // return {
109
+ // u_animate: this.animateOption2Array(animateOption as IAnimateOption),
110
+ // u_time: this.layer.getLayerAnimateTime(),
111
+ // };
112
+ // }
113
+
114
+ initModels() {
115
+ var _this = this;
116
+ return _asyncToGenerator(function* () {
117
+ _this.initUniformsBuffer();
118
+ _this.updateTexture();
119
+ _this.iconService.on('imageUpdate', _this.updateTexture);
120
+ return _this.buildModels();
121
+ })();
122
+ }
123
+ clearModels() {
124
+ var _this$texture2;
125
+ (_this$texture2 = this.texture) === null || _this$texture2 === void 0 || _this$texture2.destroy();
126
+ this.iconService.off('imageUpdate', this.updateTexture);
127
+ }
128
+ buildModels() {
129
+ var _this2 = this;
130
+ return _asyncToGenerator(function* () {
131
+ const {
132
+ segmentNumber = 30
133
+ } = _this2.layer.getLayerConfig();
134
+ const model = yield _this2.layer.buildLayerModel({
135
+ moduleName: 'lineGreatCircle',
136
+ vertexShader: line_arc2d_vert,
137
+ fragmentShader: line_arc_frag,
138
+ triangulation: LineArcTriangulation,
139
+ styleOption: {
140
+ segmentNumber
141
+ },
142
+ defines: _this2.getDefines(),
143
+ inject: _this2.getInject(),
144
+ depth: {
145
+ enable: false
146
+ }
147
+ });
148
+ return [model];
149
+ })();
150
+ }
151
+ registerBuiltinAttributes() {
152
+ this.styleAttributeService.registerStyleAttribute({
153
+ name: 'size',
154
+ type: AttributeType.Attribute,
155
+ descriptor: {
156
+ name: 'a_Size',
157
+ shaderLocation: this.attributeLocation.SIZE,
158
+ buffer: {
159
+ // give the WebGL driver a hint that this buffer may change
160
+ usage: gl.DYNAMIC_DRAW,
161
+ data: [],
162
+ type: gl.FLOAT
163
+ },
164
+ size: 1,
165
+ update: feature => {
166
+ const {
167
+ size = 1
168
+ } = feature;
169
+ return Array.isArray(size) ? [size[0]] : [size];
170
+ }
171
+ }
172
+ });
173
+ this.styleAttributeService.registerStyleAttribute({
174
+ name: 'instance',
175
+ // 弧线起始点信息
176
+ type: AttributeType.Attribute,
177
+ descriptor: {
178
+ name: 'a_Instance',
179
+ shaderLocation: this.attributeLocation.INSTANCE,
180
+ buffer: {
181
+ usage: gl.STATIC_DRAW,
182
+ data: [],
183
+ type: gl.FLOAT
184
+ },
185
+ size: 4,
186
+ update: (feature, featureIdx, vertex) => {
187
+ return [vertex[3], vertex[4], vertex[5], vertex[6]];
188
+ }
189
+ }
190
+ });
191
+
192
+ // save low part for enabled double precision INSTANCE attribute
193
+ this.styleAttributeService.registerStyleAttribute({
194
+ name: 'instance64Low',
195
+ type: AttributeType.Attribute,
196
+ descriptor: {
197
+ name: 'a_Instance64Low',
198
+ shaderLocation: this.attributeLocation.INSTANCE_64LOW,
199
+ buffer: {
200
+ usage: gl.STATIC_DRAW,
201
+ data: [],
202
+ type: gl.FLOAT
203
+ },
204
+ size: 4,
205
+ update: (feature, featureIdx, vertex) => {
206
+ return [fp64LowPart(vertex[3]), fp64LowPart(vertex[4]), fp64LowPart(vertex[5]), fp64LowPart(vertex[6])];
207
+ }
208
+ }
209
+ });
210
+ this.styleAttributeService.registerStyleAttribute({
211
+ name: 'uv',
212
+ type: AttributeType.Attribute,
213
+ descriptor: {
214
+ name: 'a_iconMapUV',
215
+ shaderLocation: this.attributeLocation.UV,
216
+ buffer: {
217
+ // give the WebGL driver a hint that this buffer may change
218
+ usage: gl.DYNAMIC_DRAW,
219
+ data: [],
220
+ type: gl.FLOAT
221
+ },
222
+ size: 2,
223
+ update: feature => {
224
+ const iconMap = this.iconService.getIconMap();
225
+ const {
226
+ texture
227
+ } = feature;
228
+ const {
229
+ x,
230
+ y
231
+ } = iconMap[texture] || {
232
+ x: 0,
233
+ y: 0
234
+ };
235
+ return [x, y];
236
+ }
237
+ }
238
+ });
239
+ }
240
+ }
@@ -0,0 +1,5 @@
1
+ export type LineModelType = 'arc' | 'arc3d' | 'greatcircle' | 'flowline' | 'wall' | 'simple' | 'line' | 'earthArc3d';
2
+ declare const LineModels: {
3
+ [key in LineModelType]: any;
4
+ };
5
+ export default LineModels;
@@ -0,0 +1,18 @@
1
+ import ArcModel from "./arc";
2
+ import Arc3DModel from "./arc_3d";
3
+ import FlowLineModel from "./flow";
4
+ import GreatCircleModel from "./great_circle";
5
+ import LineModel from "./line";
6
+ import SimpleLineModel from "./simple_line";
7
+ import LineWallModel from "./wall";
8
+ const LineModels = {
9
+ arc: ArcModel,
10
+ arc3d: Arc3DModel,
11
+ greatcircle: GreatCircleModel,
12
+ wall: LineWallModel,
13
+ line: LineModel,
14
+ simple: SimpleLineModel,
15
+ flowline: FlowLineModel,
16
+ earthArc3d: Arc3DModel
17
+ };
18
+ export default LineModels;
@@ -0,0 +1,44 @@
1
+ import type { IModel, ITexture2D } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ export default class LineModel extends BaseModel {
4
+ protected get attributeLocation(): {
5
+ readonly POSITION: 0;
6
+ readonly POSITION_64LOW: 1;
7
+ readonly COLOR: 2;
8
+ readonly PICKING_COLOR: 3;
9
+ readonly STROKE: 4;
10
+ readonly OPACITY: 5;
11
+ readonly OFFSETS: 6;
12
+ readonly ROTATION: 7;
13
+ readonly MAX: 8;
14
+ } & Record<string, number> & {
15
+ MAX: 8;
16
+ SIZE: number;
17
+ DISTANCE_INDEX: number;
18
+ NORMAL: number;
19
+ UV: number;
20
+ };
21
+ private textureEventFlag;
22
+ protected texture: ITexture2D;
23
+ protected getCommonUniformsInfo(): {
24
+ uniformsArray: number[];
25
+ uniformsLength: number;
26
+ uniformsOption: {
27
+ [key: string]: any;
28
+ };
29
+ };
30
+ initModels(): Promise<IModel[]>;
31
+ clearModels(): void;
32
+ buildModels(): Promise<IModel[]>;
33
+ /**
34
+ * 根据参数获取不同的 shader 代码
35
+ * @returns
36
+ */
37
+ getShaders(): {
38
+ frag: string;
39
+ vert: string;
40
+ type: string;
41
+ };
42
+ protected registerBuiltinAttributes(): void;
43
+ private updateTexture;
44
+ }
@@ -0,0 +1,273 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
+ import { AttributeType, gl } from '@antv/l7-core';
4
+ import { rgb2arr } from '@antv/l7-utils';
5
+ import BaseModel from "../../core/BaseModel";
6
+ import { LinearDir, TextureBlend } from "../../core/interface";
7
+ import { LineTriangulation } from "../../core/triangulation";
8
+ /* babel-plugin-inline-import '../shaders/line/line_frag.glsl' */
9
+ const line_frag = "// #extension GL_OES_standard_derivatives : enable\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform sampler2D u_texture;\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\nin vec4 v_color;\nin vec4 v_stroke;\n// dash\nin vec4 v_dash_array;\nin float v_d_distance_ratio;\nin vec2 v_iconMapUV;\nin vec4 v_texture_data;\n\nout vec4 outputColor;\n#pragma include \"picking\"\n\n// [animate, duration, interval, trailLength],\nvoid main() {\n if(u_dash_array!=vec4(0.0)){\n float dashLength = mod(v_d_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(!(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z))) {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n }\n float animateSpeed = 0.0; // \u8FD0\u52A8\u901F\u5EA6\n float d_distance_ratio = v_texture_data.r; // \u5F53\u524D\u70B9\u4F4D\u8DDD\u79BB\u5360\u7EBF\u603B\u957F\u7684\u6BD4\u4F8B\n if(u_linearDir < 1.0) {\n d_distance_ratio = v_texture_data.a;\n }\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n outputColor = mix(u_sourceColor, u_targetColor, d_distance_ratio);\n outputColor.a *= v_color.a;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n outputColor = v_color;\n }\n // anti-alias\n // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));\n if(u_animate.x == Animate) {\n animateSpeed = u_time / u_animate.y;\n float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);\n alpha = (alpha + u_animate.w -1.0) / u_animate.w;\n alpha = smoothstep(0., 1., alpha);\n outputColor.a *= alpha;\n }\n\n if(u_line_texture == LineTexture) { // while load texture\n float aDistance = v_texture_data.g; // \u5F53\u524D\u9876\u70B9\u7684\u8DDD\u79BB\n float d_texPixelLen = v_texture_data.b; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen - animateSpeed);\n float v = v_texture_data.a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n // v = max(smoothstep(0.95, 1.0, v), v);\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture(SAMPLER_2D(u_texture), uv);\n\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n outputColor += pattern;\n } else { // replace\n pattern.a *= v_color.a;\n if(outputColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n outputColor = pattern;\n }\n } \n\n float v = v_texture_data.a;\n float strokeWidth = min(0.5, u_strokeWidth);\n // \u7ED8\u5236 border\n if(strokeWidth > 0.01) {\n float borderOuterWidth = strokeWidth / 2.0;\n\n\n if(v >= 1.0 - strokeWidth || v <= strokeWidth) {\n if(v > strokeWidth) { // \u5916\u4FA7\n float linear = smoothstep(0.0, 1.0, (v - (1.0 - strokeWidth))/strokeWidth);\n // float linear = step(0.0, (v - (1.0 - borderWidth))/borderWidth);\n outputColor.rgb = mix(outputColor.rgb, v_stroke.rgb, linear);\n } else if(v <= strokeWidth) {\n float linear = smoothstep(0.0, 1.0, v/strokeWidth);\n outputColor.rgb = mix(v_stroke.rgb, outputColor.rgb, linear);\n }\n }\n\n if(v < borderOuterWidth) {\n outputColor.a = mix(0.0, outputColor.a, v/borderOuterWidth);\n } else if(v > 1.0 - borderOuterWidth) {\n outputColor.a = mix(outputColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);\n }\n }\n\n // blur\n float blurV = v_texture_data.a;\n if(blurV < 0.5) {\n outputColor.a *= mix(u_blur.r, u_blur.g, blurV/0.5);\n } else {\n outputColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);\n }\n \n outputColor = filterColor(outputColor);\n}\n";
10
+ /* babel-plugin-inline-import '../shaders/line/line_vert.glsl' */
11
+ const line_vert = "#define Animate (0.0)\n\nlayout(location = ATTRIBUTE_LOCATION_POSITION) in vec3 a_Position;\nlayout(location = ATTRIBUTE_LOCATION_POSITION_64LOW) in vec2 a_Position64Low;\nlayout(location = ATTRIBUTE_LOCATION_COLOR) in vec4 a_Color;\nlayout(location = ATTRIBUTE_LOCATION_SIZE) in vec2 a_Size;\nlayout(location = ATTRIBUTE_LOCATION_DISTANCE_INDEX) in vec3 a_DistanceAndIndexAndMiter;\nlayout(location = ATTRIBUTE_LOCATION_NORMAL) in vec4 a_Normal_Total_Distance;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_iconMapUV;\n\nlayout(std140) uniform commonUniorm {\n vec4 u_animate: [ 1., 2., 1.0, 0.2 ];\n vec4 u_dash_array;\n vec4 u_blur;\n vec4 u_sourceColor;\n vec4 u_targetColor;\n vec2 u_textSize;\n float u_icon_step: 100;\n float u_heightfixed: 0.0;\n float u_vertexScale: 1.0;\n float u_raisingHeight: 0.0;\n float u_strokeWidth: 0.0;\n float u_textureBlend;\n float u_line_texture;\n float u_linearDir: 1.0;\n float u_linearColor: 0;\n float u_time;\n};\n\nout vec4 v_color;\nout vec4 v_stroke;\n//dash\nout vec4 v_dash_array;\nout float v_d_distance_ratio;\n// texV \u7EBF\u56FE\u5C42 - \u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\uFF08\u7EBF\u7684\u5BBD\u5EA6\u65B9\u5411\uFF09\nout vec2 v_iconMapUV;\nout vec4 v_texture_data;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec2 a_DistanceAndIndex = a_DistanceAndIndexAndMiter.xy;\n float a_Miter = a_DistanceAndIndexAndMiter.z;\n vec3 a_Normal = a_Normal_Total_Distance.xyz;\n float a_Total_Distance = a_Normal_Total_Distance.w;\n //dash\u8F93\u51FA\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / a_Total_Distance;\n v_d_distance_ratio = a_DistanceAndIndex.x / a_Total_Distance;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n float d_texPixelLen; // \u8D34\u56FE\u7684\u50CF\u7D20\u957F\u5EA6\uFF0C\u6839\u636E\u5730\u56FE\u5C42\u7EA7\u7F29\u653E\n v_iconMapUV = a_iconMapUV;\n d_texPixelLen = project_float_pixel(u_icon_step);\n\n v_color = a_Color;\n v_color.a *= opacity;\n v_stroke = stroke;\n\n vec3 size = a_Miter * setPickingSize(a_Size.x) * a_Normal;\n\n vec2 offset = project_pixel(size.xy);\n\n float lineDistance = a_DistanceAndIndex.x;\n float currentLinePointRatio = lineDistance / a_Total_Distance;\n\n float lineOffsetWidth = length(offset + offset * sign(a_Miter)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\uFF08\u5411\u4E24\u4FA7\u504F\u79FB\u7684\u548C\uFF09\n float linePixelSize = project_pixel(a_Size.x) * 2.0; // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB \u5355\u4FA7 * 2\n float texV = lineOffsetWidth / linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_texture_data = vec4(currentLinePointRatio, lineDistance, d_texPixelLen, texV);\n // \u8BBE\u7F6E\u6570\u636E\u96C6\u7684\u53C2\u6570\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0), a_Position64Low);\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, a_Size.y, 1.0));\n\n float h = float(a_Position.z) * u_vertexScale; // \u7EBF\u9876\u70B9\u7684\u9AD8\u5EA6 - \u517C\u5BB9\u4E0D\u5B58\u5728\u7B2C\u4E09\u4E2A\u6570\u503C\u7684\u60C5\u51B5 vertex height\n float lineHeight = a_Size.y; // size \u7B2C\u4E8C\u4E2A\u53C2\u6570\u4EE3\u8868\u7684\u9AD8\u5EA6 [linewidth, lineheight]\n\n // \u517C\u5BB9 mapbox \u5728\u7EBF\u9AD8\u5EA6\u4E0A\u7684\u6548\u679C\u8868\u73B0\u57FA\u672C\u4E00\u81F4\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n // mapbox\n // \u4FDD\u6301\u9AD8\u5EA6\u76F8\u5BF9\u4E0D\u53D8\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n h *= mapboxZoomScale;\n h += u_raisingHeight * mapboxZoomScale;\n if (u_heightfixed > 0.0) {\n lineHeight *= mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(\n vec4(project_pos.xy + offset, lineHeight + h, 1.0)\n );\n\n setPickingColor(a_PickingColor);\n}\n";
12
+ export default class LineModel extends BaseModel {
13
+ constructor(...args) {
14
+ super(...args);
15
+ _defineProperty(this, "textureEventFlag", false);
16
+ _defineProperty(this, "texture", this.createTexture2D({
17
+ data: new Uint8Array([0, 0, 0, 0]),
18
+ width: 1,
19
+ height: 1
20
+ }));
21
+ _defineProperty(this, "updateTexture", () => {
22
+ const {
23
+ createTexture2D
24
+ } = this.rendererService;
25
+ if (this.textures.length === 0) {
26
+ this.textures = [this.texture];
27
+ }
28
+ if (this.texture) {
29
+ this.texture.update({
30
+ data: this.iconService.getCanvas()
31
+ });
32
+ this.layer.render();
33
+ return;
34
+ }
35
+ this.texture = createTexture2D({
36
+ data: this.iconService.getCanvas(),
37
+ mag: gl.NEAREST,
38
+ min: gl.NEAREST,
39
+ premultiplyAlpha: false,
40
+ width: 1024,
41
+ height: this.iconService.canvasHeight || 128
42
+ });
43
+ });
44
+ }
45
+ get attributeLocation() {
46
+ return Object.assign(super.attributeLocation, {
47
+ MAX: super.attributeLocation.MAX,
48
+ SIZE: 9,
49
+ DISTANCE_INDEX: 10,
50
+ NORMAL: 11,
51
+ UV: 12
52
+ });
53
+ }
54
+ getCommonUniformsInfo() {
55
+ const {
56
+ sourceColor,
57
+ targetColor,
58
+ textureBlend = 'normal',
59
+ lineType = 'solid',
60
+ dashArray = [10, 5, 0, 0],
61
+ lineTexture = false,
62
+ iconStep = 100,
63
+ vertexHeightScale = 20.0,
64
+ strokeWidth = 0.0,
65
+ raisingHeight = 0,
66
+ heightfixed = false,
67
+ linearDir = LinearDir.VERTICAL,
68
+ // 默认纵向
69
+ blur = [1, 1, 1, 0]
70
+ } = this.layer.getLayerConfig();
71
+ let u_dash_array = dashArray;
72
+ if (lineType !== 'dash') {
73
+ u_dash_array = [0, 0, 0, 0];
74
+ }
75
+ if (u_dash_array.length === 2) {
76
+ u_dash_array.push(0, 0);
77
+ }
78
+ if (this.rendererService.getDirty() && this.texture) {
79
+ var _this$texture;
80
+ (_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.bind();
81
+ }
82
+ const {
83
+ animateOption
84
+ } = this.layer.getLayerConfig();
85
+ // 转化渐变色
86
+ let useLinearColor = 0; // 默认不生效
87
+ let sourceColorArr = [0, 0, 0, 0];
88
+ let targetColorArr = [0, 0, 0, 0];
89
+ if (sourceColor && targetColor) {
90
+ sourceColorArr = rgb2arr(sourceColor);
91
+ targetColorArr = rgb2arr(targetColor);
92
+ useLinearColor = 1;
93
+ }
94
+ const commonOptions = {
95
+ u_animate: this.animateOption2Array(animateOption),
96
+ u_dash_array,
97
+ u_blur: blur,
98
+ u_sourceColor: sourceColorArr,
99
+ u_targetColor: targetColorArr,
100
+ u_textSize: [1024, this.iconService.canvasHeight || 128],
101
+ u_icon_step: iconStep,
102
+ // 是否固定高度
103
+ u_heightfixed: Number(heightfixed),
104
+ // 顶点高度 scale
105
+ u_vertexScale: vertexHeightScale,
106
+ u_raisingHeight: Number(raisingHeight),
107
+ // line border 参数
108
+ u_strokeWidth: strokeWidth,
109
+ u_textureBlend: textureBlend === TextureBlend.NORMAL ? 0.0 : 1.0,
110
+ u_line_texture: lineTexture ? 1.0 : 0.0,
111
+ // 传入线的标识
112
+ u_linearDir: linearDir === LinearDir.VERTICAL ? 1.0 : 0.0,
113
+ u_linearColor: useLinearColor,
114
+ u_time: this.layer.getLayerAnimateTime() || 0
115
+ };
116
+ const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
117
+ return commonBufferInfo;
118
+ }
119
+ // public getAnimateUniforms(): IModelUniform {
120
+ // const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;
121
+ // return {
122
+ // u_animate: this.animateOption2Array(animateOption as IAnimateOption),
123
+ // u_time: this.layer.getLayerAnimateTime(),
124
+ // };
125
+ // }
126
+ initModels() {
127
+ var _this = this;
128
+ return _asyncToGenerator(function* () {
129
+ _this.initUniformsBuffer();
130
+ // this.updateTexture();
131
+ // this.iconService.on('imageUpdate', this.updateTexture);
132
+ if (!_this.textureEventFlag) {
133
+ _this.textureEventFlag = true;
134
+ _this.updateTexture();
135
+ _this.iconService.on('imageUpdate', _this.updateTexture);
136
+ }
137
+ return _this.buildModels();
138
+ })();
139
+ }
140
+ clearModels() {
141
+ var _this$texture2;
142
+ (_this$texture2 = this.texture) === null || _this$texture2 === void 0 || _this$texture2.destroy();
143
+ this.iconService.off('imageUpdate', this.updateTexture);
144
+ }
145
+ buildModels() {
146
+ var _this2 = this;
147
+ return _asyncToGenerator(function* () {
148
+ const {
149
+ depth = false
150
+ } = _this2.layer.getLayerConfig();
151
+ const {
152
+ frag,
153
+ vert,
154
+ type
155
+ } = _this2.getShaders();
156
+ _this2.layer.triangulation = LineTriangulation;
157
+ const model = yield _this2.layer.buildLayerModel({
158
+ moduleName: 'line' + type,
159
+ vertexShader: vert,
160
+ fragmentShader: frag,
161
+ triangulation: LineTriangulation,
162
+ defines: _this2.getDefines(),
163
+ inject: _this2.getInject(),
164
+ depth: {
165
+ enable: depth
166
+ }
167
+ });
168
+ return [model];
169
+ })();
170
+ }
171
+
172
+ /**
173
+ * 根据参数获取不同的 shader 代码
174
+ * @returns
175
+ */
176
+ getShaders() {
177
+ return {
178
+ frag: line_frag,
179
+ vert: line_vert,
180
+ type: ''
181
+ };
182
+ }
183
+ registerBuiltinAttributes() {
184
+ // 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
185
+ this.registerPosition64LowAttribute();
186
+ this.styleAttributeService.registerStyleAttribute({
187
+ name: 'distanceAndIndex',
188
+ type: AttributeType.Attribute,
189
+ descriptor: {
190
+ name: 'a_DistanceAndIndexAndMiter',
191
+ shaderLocation: this.attributeLocation.DISTANCE_INDEX,
192
+ buffer: {
193
+ // give the WebGL driver a hint that this buffer may change
194
+ usage: gl.STATIC_DRAW,
195
+ data: [],
196
+ type: gl.FLOAT
197
+ },
198
+ size: 3,
199
+ update: (feature, featureIdx, vertex, attributeIdx, normal, vertexIndex) => {
200
+ return vertexIndex === undefined ? [vertex[3], 10, vertex[4]] : [vertex[3], vertexIndex, vertex[4]];
201
+ }
202
+ }
203
+ });
204
+ this.styleAttributeService.registerStyleAttribute({
205
+ name: 'size',
206
+ type: AttributeType.Attribute,
207
+ descriptor: {
208
+ name: 'a_Size',
209
+ shaderLocation: this.attributeLocation.SIZE,
210
+ buffer: {
211
+ // give the WebGL driver a hint that this buffer may change
212
+ usage: gl.DYNAMIC_DRAW,
213
+ data: [],
214
+ type: gl.FLOAT
215
+ },
216
+ size: 2,
217
+ update: feature => {
218
+ const {
219
+ size = 1
220
+ } = feature;
221
+ return Array.isArray(size) ? [size[0], size[1]] : [size, 0];
222
+ }
223
+ }
224
+ });
225
+ this.styleAttributeService.registerStyleAttribute({
226
+ name: 'normal_total_distance',
227
+ type: AttributeType.Attribute,
228
+ descriptor: {
229
+ name: 'a_Normal_Total_Distance',
230
+ shaderLocation: this.attributeLocation.NORMAL,
231
+ buffer: {
232
+ // give the WebGL driver a hint that this buffer may change
233
+ usage: gl.STATIC_DRAW,
234
+ data: [],
235
+ type: gl.FLOAT
236
+ },
237
+ size: 4,
238
+ update: (feature, featureIdx, vertex, attributeIdx, normal) => {
239
+ return [...normal, vertex[5]];
240
+ }
241
+ }
242
+ });
243
+ this.styleAttributeService.registerStyleAttribute({
244
+ name: 'uv',
245
+ type: AttributeType.Attribute,
246
+ descriptor: {
247
+ name: 'a_iconMapUV',
248
+ shaderLocation: this.attributeLocation.UV,
249
+ buffer: {
250
+ // give the WebGL driver a hint that this buffer may change
251
+ usage: gl.DYNAMIC_DRAW,
252
+ data: [],
253
+ type: gl.FLOAT
254
+ },
255
+ size: 2,
256
+ update: feature => {
257
+ const iconMap = this.iconService.getIconMap();
258
+ const {
259
+ texture
260
+ } = feature;
261
+ const {
262
+ x,
263
+ y
264
+ } = iconMap[texture] || {
265
+ x: 0,
266
+ y: 0
267
+ };
268
+ return [x, y];
269
+ }
270
+ }
271
+ });
272
+ }
273
+ }
@@ -0,0 +1,33 @@
1
+ import type { IModel } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ export default class SimpleLineModel extends BaseModel {
4
+ protected get attributeLocation(): {
5
+ readonly POSITION: 0;
6
+ readonly POSITION_64LOW: 1;
7
+ readonly COLOR: 2;
8
+ readonly PICKING_COLOR: 3;
9
+ readonly STROKE: 4;
10
+ readonly OPACITY: 5;
11
+ readonly OFFSETS: 6;
12
+ readonly ROTATION: 7;
13
+ readonly MAX: 8;
14
+ } & Record<string, number> & {
15
+ MAX: 8;
16
+ SIZE: number;
17
+ };
18
+ protected getCommonUniformsInfo(): {
19
+ uniformsArray: number[];
20
+ uniformsLength: number;
21
+ uniformsOption: {
22
+ [key: string]: any;
23
+ };
24
+ };
25
+ initModels(): Promise<IModel[]>;
26
+ getShaders(): {
27
+ frag: string;
28
+ vert: string;
29
+ type: string;
30
+ };
31
+ buildModels(): Promise<IModel[]>;
32
+ protected registerBuiltinAttributes(): void;
33
+ }