@antv/l7-layers 2.25.7 → 2.25.9

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,293 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
+ import { AttributeType, gl } from '@antv/l7-core';
5
+ import { boundsContains, calculateCentroid, padBounds } from '@antv/l7-utils';
6
+ import BaseModel from "../../core/BaseModel";
7
+ import { PointImageTriangulation } from "../../core/triangulation";
8
+ import CollisionIndex from "../../utils/collision-index";
9
+ /* babel-plugin-inline-import '../shaders/image/image_frag.glsl' */
10
+ const pointImageFrag = "layout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nuniform sampler2D u_texture;\n\nin vec4 v_color;\nin vec2 v_uv;\nin float v_opacity;\n\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n vec2 pos = v_uv / u_textSize + gl_PointCoord / u_textSize * 64.0;\n vec4 textureColor;\n\n // Y = 0.299R + 0.587G + 0.114B // \u4EAE\u5EA6\u63D0\u53D6\n\n textureColor = texture(SAMPLER_2D(u_texture), pos);\n\n // Tip: \u53BB\u9664\u8FB9\u7F18\u90E8\u5206 mipmap \u5BFC\u81F4\u7684\u6DF7\u5408\u53D8\u6697\n float fragmengTocenter = distance(vec2(0.5), gl_PointCoord);\n if (fragmengTocenter >= 0.5) {\n float luma = 0.299 * textureColor.r + 0.587 * textureColor.g + 0.114 * textureColor.b;\n textureColor.a *= luma;\n }\n\n if (\n all(lessThan(v_color, vec4(1.0 + 0.00001))) && all(greaterThan(v_color, vec4(1.0 - 0.00001))) ||\n v_color == vec4(1.0)\n ) {\n outputColor = textureColor;\n } else {\n outputColor = step(0.01, textureColor.z) * v_color;\n }\n outputColor.a *= v_opacity;\n if (outputColor.a < 0.01) {\n discard;\n }\n outputColor = filterColor(outputColor);\n}\n";
11
+ /* babel-plugin-inline-import '../shaders/image/image_vert.glsl' */
12
+ const pointImageVert = "layout(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 float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_UV) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_textSize;\n float u_raisingHeight;\n float u_heightfixed;\n};\n\nout vec4 v_color;\nout vec2 v_uv;\nout float v_opacity;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n v_color = a_Color;\n v_opacity = opacity;\n v_uv = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n\n vec2 offset = project_pixel(offsets);\n\n float raisingHeight = u_raisingHeight;\n if (u_heightfixed < 1.0) {\n // false\n raisingHeight = project_pixel(u_raisingHeight);\n } else {\n if (\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET\n ) {\n float mapboxZoomScale = 4.0 / pow(2.0, 21.0 - u_Zoom);\n raisingHeight = u_raisingHeight * mapboxZoomScale;\n }\n }\n\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, raisingHeight, 1.0));\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
13
+ export default class ImageModel extends BaseModel {
14
+ constructor(...args) {
15
+ super(...args);
16
+ _defineProperty(this, "texture", void 0);
17
+ // 通过碰撞检测的 feature id 集合,由 filterImages() 填充;null 表示不启用过滤(allowOverlap: true)
18
+ _defineProperty(this, "imageFilterMap", null);
19
+ _defineProperty(this, "currentZoom", -1);
20
+ _defineProperty(this, "extent", void 0);
21
+ _defineProperty(this, "preAllowOverlap", true);
22
+ _defineProperty(this, "updateTexture", () => {
23
+ const {
24
+ createTexture2D
25
+ } = this.rendererService;
26
+ if (this.texture) {
27
+ this.texture.update({
28
+ data: this.iconService.getCanvas(),
29
+ mag: 'linear',
30
+ min: 'linear mipmap nearest',
31
+ mipmap: true
32
+ });
33
+ // 更新完纹理后在更新的图层的时候需要更新所有的图层
34
+ // this.layer.layerModelNeedUpdate = true;
35
+ setTimeout(() => {
36
+ // 延迟渲染
37
+ this.layerService.throttleRenderLayers();
38
+ });
39
+ return;
40
+ }
41
+ this.texture = createTexture2D({
42
+ data: this.iconService.getCanvas(),
43
+ mag: gl.LINEAR,
44
+ min: gl.LINEAR_MIPMAP_LINEAR,
45
+ premultiplyAlpha: false,
46
+ width: 1024,
47
+ height: this.iconService.canvasHeight || 128,
48
+ mipmap: true
49
+ });
50
+ });
51
+ }
52
+ get attributeLocation() {
53
+ return Object.assign(super.attributeLocation, {
54
+ MAX: super.attributeLocation.MAX,
55
+ SIZE: 9,
56
+ UV: 10
57
+ });
58
+ }
59
+ getUninforms() {
60
+ // ThreeJS 图层兼容
61
+ if (this.rendererService.getDirty()) {
62
+ var _this$texture;
63
+ (_this$texture = this.texture) === null || _this$texture === void 0 || _this$texture.bind();
64
+ }
65
+ const commonInfo = this.getCommonUniformsInfo();
66
+ const attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
67
+ this.updateStyleUnifoms();
68
+ return _objectSpread(_objectSpread({}, commonInfo.uniformsOption), attributeInfo.uniformsOption);
69
+ }
70
+ getCommonUniformsInfo() {
71
+ const {
72
+ raisingHeight = 0,
73
+ heightfixed = false
74
+ } = this.layer.getLayerConfig();
75
+ const commonOptions = {
76
+ u_textSize: [1024, this.iconService.canvasHeight || 128],
77
+ u_raisingHeight: Number(raisingHeight),
78
+ u_heightfixed: Number(heightfixed),
79
+ u_texture: this.texture
80
+ };
81
+ this.textures = [this.texture];
82
+ const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
83
+ return commonBufferInfo;
84
+ }
85
+ initModels() {
86
+ var _this = this;
87
+ return _asyncToGenerator(function* () {
88
+ const {
89
+ allowOverlap = true
90
+ } = _this.layer.getLayerConfig();
91
+ _this.extent = _this.imageExtent();
92
+ _this.preAllowOverlap = allowOverlap;
93
+ _this.iconService.on('imageUpdate', _this.updateTexture);
94
+ _this.updateTexture();
95
+ return _this.buildModels();
96
+ })();
97
+ }
98
+ buildModels() {
99
+ var _this2 = this;
100
+ return _asyncToGenerator(function* () {
101
+ const {
102
+ allowOverlap = true
103
+ } = _this2.layer.getLayerConfig();
104
+ _this2.initUniformsBuffer();
105
+ if (!allowOverlap) {
106
+ _this2.filterImages();
107
+ } else {
108
+ // 允许压盖时置 null,PointImageTriangulation 检测到 null 则跳过过滤
109
+ _this2.imageFilterMap = null;
110
+ }
111
+ const model = yield _this2.layer.buildLayerModel({
112
+ moduleName: 'pointImage',
113
+ vertexShader: pointImageVert,
114
+ fragmentShader: pointImageFrag,
115
+ // 绑定 this,让 PointImageTriangulation 能读取 imageFilterMap
116
+ triangulation: PointImageTriangulation.bind(_this2),
117
+ defines: _this2.getDefines(),
118
+ inject: _this2.getInject(),
119
+ depth: {
120
+ enable: false
121
+ },
122
+ primitive: gl.POINTS
123
+ });
124
+ return [model];
125
+ })();
126
+ }
127
+ needUpdate() {
128
+ var _this3 = this;
129
+ return _asyncToGenerator(function* () {
130
+ const {
131
+ allowOverlap = true
132
+ } = _this3.layer.getLayerConfig();
133
+
134
+ // allowOverlap 开关发生变化时,强制重建
135
+ if (allowOverlap !== _this3.preAllowOverlap) {
136
+ _this3.preAllowOverlap = allowOverlap;
137
+ yield _this3.reBuildModel();
138
+ return true;
139
+ }
140
+
141
+ // 允许压盖时无需每帧检测
142
+ if (allowOverlap) {
143
+ return false;
144
+ }
145
+
146
+ // 不允许压盖时,zoom 变化 >0.5 或视野超出上次范围则重算碰撞
147
+ const zoom = _this3.mapService.getZoom();
148
+ const extent = _this3.mapService.getBounds();
149
+ const flag = boundsContains(_this3.extent, extent);
150
+ if (Math.abs(_this3.currentZoom - zoom) > 0.5 || !flag) {
151
+ yield _this3.reBuildModel();
152
+ return true;
153
+ }
154
+ return false;
155
+ })();
156
+ }
157
+ clearModels() {
158
+ var _this$texture2;
159
+ (_this$texture2 = this.texture) === null || _this$texture2 === void 0 || _this$texture2.destroy();
160
+ this.iconService.off('imageUpdate', this.updateTexture);
161
+ }
162
+ registerBuiltinAttributes() {
163
+ // 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
164
+ this.registerPosition64LowAttribute();
165
+
166
+ // point layer size;
167
+ this.styleAttributeService.registerStyleAttribute({
168
+ name: 'size',
169
+ type: AttributeType.Attribute,
170
+ descriptor: {
171
+ name: 'a_Size',
172
+ shaderLocation: this.attributeLocation.SIZE,
173
+ buffer: {
174
+ // give the WebGL driver a hint that this buffer may change
175
+ usage: gl.DYNAMIC_DRAW,
176
+ data: [],
177
+ type: gl.FLOAT
178
+ },
179
+ size: 1,
180
+ update: feature => {
181
+ const {
182
+ size = 5
183
+ } = feature;
184
+ return Array.isArray(size) ? [size[0]] : [size];
185
+ }
186
+ }
187
+ });
188
+
189
+ // point layer uv;
190
+ this.styleAttributeService.registerStyleAttribute({
191
+ name: 'uv',
192
+ type: AttributeType.Attribute,
193
+ descriptor: {
194
+ name: 'a_Uv',
195
+ shaderLocation: this.attributeLocation.UV,
196
+ buffer: {
197
+ // give the WebGL driver a hint that this buffer may change
198
+ usage: gl.DYNAMIC_DRAW,
199
+ data: [],
200
+ type: gl.FLOAT
201
+ },
202
+ size: 2,
203
+ update: feature => {
204
+ const iconMap = this.iconService.getIconMap();
205
+ const {
206
+ shape
207
+ } = feature;
208
+ const {
209
+ x,
210
+ y
211
+ } = iconMap[shape] || {
212
+ x: -64,
213
+ y: -64
214
+ }; // 非画布区域,默认的图标改为透明
215
+ return [x, y];
216
+ }
217
+ }
218
+ });
219
+ }
220
+
221
+ /**
222
+ * 图标碰撞避让:遍历所有 feature,在屏幕空间做 AABB 碰撞检测,
223
+ * 将通过检测的 feature id 写入 imageFilterMap。
224
+ * PointImageTriangulation 绑定 this 后,会跳过不在 map 中的 feature。
225
+ */
226
+ filterImages() {
227
+ const {
228
+ padding = [0, 0]
229
+ } = this.layer.getLayerConfig();
230
+ this.imageFilterMap = {};
231
+ this.currentZoom = this.mapService.getZoom();
232
+ this.extent = this.imageExtent();
233
+ const {
234
+ width,
235
+ height
236
+ } = this.rendererService.getViewportSize();
237
+ const collisionIndex = new CollisionIndex(width, height);
238
+ const data = this.layer.getEncodedData();
239
+ data.forEach(feature => {
240
+ const {
241
+ id = 0,
242
+ size = 5
243
+ } = feature;
244
+ const iconSize = Array.isArray(size) ? size[0] : size;
245
+ const centroid = calculateCentroid(feature.coordinates);
246
+ const pixels = this.mapService.lngLatToContainer(centroid);
247
+ const {
248
+ box
249
+ } = collisionIndex.placeCollisionBox({
250
+ x1: -iconSize - padding[0],
251
+ x2: iconSize + padding[0],
252
+ y1: -iconSize - padding[1],
253
+ y2: iconSize + padding[1],
254
+ anchorPointX: pixels.x,
255
+ anchorPointY: pixels.y
256
+ });
257
+ if (box && box.length) {
258
+ collisionIndex.insertCollisionBox(box, id);
259
+ this.imageFilterMap[id] = true;
260
+ }
261
+ });
262
+ }
263
+ imageExtent() {
264
+ const bounds = this.mapService.getBounds();
265
+ return padBounds(bounds, 0.5);
266
+ }
267
+ reBuildModel() {
268
+ var _this4 = this;
269
+ return _asyncToGenerator(function* () {
270
+ const {
271
+ allowOverlap = true
272
+ } = _this4.layer.getLayerConfig();
273
+ if (!allowOverlap) {
274
+ _this4.filterImages();
275
+ } else {
276
+ _this4.imageFilterMap = null; // 允许压盖:清空过滤表,全量渲染
277
+ }
278
+ const model = yield _this4.layer.buildLayerModel({
279
+ moduleName: 'pointImage',
280
+ vertexShader: pointImageVert,
281
+ fragmentShader: pointImageFrag,
282
+ triangulation: PointImageTriangulation.bind(_this4),
283
+ defines: _this4.getDefines(),
284
+ inject: _this4.getInject(),
285
+ depth: {
286
+ enable: false
287
+ },
288
+ primitive: gl.POINTS
289
+ });
290
+ _this4.layer.models = [model];
291
+ })();
292
+ }
293
+ }
@@ -0,0 +1,5 @@
1
+ export type PointType = 'fillImage' | 'fill' | 'radar' | 'image' | 'normal' | 'simplePoint' | 'extrude' | 'text' | 'earthFill' | 'earthExtrude';
2
+ declare const PointModels: {
3
+ [key in PointType]: any;
4
+ };
5
+ export default PointModels;
@@ -0,0 +1,24 @@
1
+ import SimplePoint from "./billboard_point";
2
+ import EarthExtrudeModel from "./earthExtrude";
3
+ // earth
4
+ import EarthFillModel from "./earthFill";
5
+ import ExtrudeModel from "./extrude";
6
+ import FillModel from "./fill";
7
+ import FillImageModel from "./fillImage";
8
+ import IMageModel from "./image";
9
+ import NormalModel from "./normal";
10
+ import Radar from "./radar";
11
+ import TextModel from "./text";
12
+ const PointModels = {
13
+ fillImage: FillImageModel,
14
+ fill: FillModel,
15
+ radar: Radar,
16
+ image: IMageModel,
17
+ normal: NormalModel,
18
+ simplePoint: SimplePoint,
19
+ extrude: ExtrudeModel,
20
+ text: TextModel,
21
+ earthFill: EarthFillModel,
22
+ earthExtrude: EarthExtrudeModel
23
+ };
24
+ export default PointModels;
@@ -0,0 +1,36 @@
1
+ import type { IEncodeFeature, IModel } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ import type { IPointLayerStyleOptions } from '../../core/interface';
4
+ export declare function PointTriangulation(feature: IEncodeFeature): {
5
+ vertices: number[];
6
+ indices: number[];
7
+ size: number;
8
+ };
9
+ export default class NormalModel extends BaseModel {
10
+ protected get attributeLocation(): {
11
+ readonly POSITION: 0;
12
+ readonly POSITION_64LOW: 1;
13
+ readonly COLOR: 2;
14
+ readonly PICKING_COLOR: 3;
15
+ readonly STROKE: 4;
16
+ readonly OPACITY: 5;
17
+ readonly OFFSETS: 6;
18
+ readonly ROTATION: 7;
19
+ readonly MAX: 8;
20
+ } & Record<string, number> & {
21
+ MAX: 8;
22
+ SIZE: number;
23
+ };
24
+ getDefaultStyle(): Partial<IPointLayerStyleOptions>;
25
+ protected getCommonUniformsInfo(): {
26
+ uniformsArray: number[];
27
+ uniformsLength: number;
28
+ uniformsOption: {
29
+ [key: string]: any;
30
+ };
31
+ };
32
+ initModels(): Promise<IModel[]>;
33
+ buildModels(): Promise<IModel[]>;
34
+ clearModels(): void;
35
+ protected registerBuiltinAttributes(): void;
36
+ }
@@ -0,0 +1,89 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import { AttributeType, gl } from '@antv/l7-core';
3
+ import BaseModel from "../../core/BaseModel";
4
+ /* babel-plugin-inline-import '../shaders/normal/normal_frag.glsl' */
5
+ const normalFrag = "in vec4 v_color;\nout vec4 outputColor;\nvoid main() {\n outputColor = v_color;\n}\n";
6
+ /* babel-plugin-inline-import '../shaders/normal/normal_vert.glsl' */
7
+ const normalVert = "layout(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 float a_Size;\n\nlayout(std140) uniform u_Common {\n float u_size_scale;\n};\n\nout vec4 v_color;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n\nvoid main() {\n v_color = vec4(a_Color.xyz, a_Color.w * opacity);\n\n vec4 project_pos = project_position(vec4(a_Position, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(project_pos);\n\n gl_PointSize = a_Size * u_size_scale * 2.0 * u_DevicePixelRatio;\n}\n";
8
+ export function PointTriangulation(feature) {
9
+ const coordinates = feature.coordinates;
10
+ return {
11
+ vertices: [...coordinates],
12
+ indices: [0],
13
+ size: coordinates.length
14
+ };
15
+ }
16
+ export default class NormalModel extends BaseModel {
17
+ get attributeLocation() {
18
+ return Object.assign(super.attributeLocation, {
19
+ MAX: super.attributeLocation.MAX,
20
+ SIZE: 9
21
+ });
22
+ }
23
+ getDefaultStyle() {
24
+ return {
25
+ blend: 'additive'
26
+ };
27
+ }
28
+ getCommonUniformsInfo() {
29
+ const commonOptions = {
30
+ u_size_scale: 0.5
31
+ };
32
+ const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
33
+ return commonBufferInfo;
34
+ }
35
+ initModels() {
36
+ var _this = this;
37
+ return _asyncToGenerator(function* () {
38
+ return _this.buildModels();
39
+ })();
40
+ }
41
+ buildModels() {
42
+ var _this2 = this;
43
+ return _asyncToGenerator(function* () {
44
+ _this2.layer.triangulation = PointTriangulation;
45
+ _this2.initUniformsBuffer();
46
+ const model = yield _this2.layer.buildLayerModel({
47
+ moduleName: 'pointNormal',
48
+ vertexShader: normalVert,
49
+ fragmentShader: normalFrag,
50
+ triangulation: PointTriangulation,
51
+ defines: _this2.getDefines(),
52
+ inject: _this2.getInject(),
53
+ depth: {
54
+ enable: false
55
+ },
56
+ primitive: gl.POINTS,
57
+ pick: false
58
+ });
59
+ return [model];
60
+ })();
61
+ }
62
+ clearModels() {
63
+ return;
64
+ }
65
+ registerBuiltinAttributes() {
66
+ // 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
67
+ this.registerPosition64LowAttribute();
68
+ this.styleAttributeService.registerStyleAttribute({
69
+ name: 'size',
70
+ type: AttributeType.Attribute,
71
+ descriptor: {
72
+ name: 'a_Size',
73
+ shaderLocation: this.attributeLocation.SIZE,
74
+ buffer: {
75
+ usage: gl.DYNAMIC_DRAW,
76
+ data: [],
77
+ type: gl.FLOAT
78
+ },
79
+ size: 1,
80
+ update: feature => {
81
+ const {
82
+ size = 1
83
+ } = feature;
84
+ return Array.isArray(size) ? [size[0]] : [size];
85
+ }
86
+ }
87
+ });
88
+ }
89
+ }
@@ -0,0 +1,37 @@
1
+ import type { IAnimateOption, IAttribute, IElements, IModel, IModelUniform } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ export default class RadarModel 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
+ EXTRUDE: number;
18
+ };
19
+ protected getCommonUniformsInfo(): {
20
+ uniformsArray: number[];
21
+ uniformsLength: number;
22
+ uniformsOption: {
23
+ [key: string]: any;
24
+ };
25
+ };
26
+ getAnimateUniforms(): IModelUniform;
27
+ getAttribute(): {
28
+ attributes: {
29
+ [attributeName: string]: IAttribute;
30
+ };
31
+ elements: IElements;
32
+ };
33
+ initModels(): Promise<IModel[]>;
34
+ buildModels(): Promise<IModel[]>;
35
+ protected animateOption2Array(option: Partial<IAnimateOption>): number[];
36
+ protected registerBuiltinAttributes(): void;
37
+ }
@@ -0,0 +1,115 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
+ import { AttributeType, gl } from '@antv/l7-core';
3
+ import BaseModel from "../../core/BaseModel";
4
+ import { SizeUnitType } from "../../core/interface";
5
+ import { PointFillTriangulation } from "../../core/triangulation";
6
+ /* babel-plugin-inline-import '../shaders/radar/radar_frag.glsl' */
7
+ const pointFillFrag = "\nlayout(std140) uniform commonUniorm{\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\nin vec4 v_data;\nin vec4 v_color;\nin float v_radius;\nin vec2 v_extrude;\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nout vec4 outputColor;\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n outputColor = vec4(v_color.rgb, v_color.a);\n\n if(u_additive > 0.0) {\n outputColor *= opacity_t;\n } else {\n outputColor.a *= opacity_t;\n }\n\n if(outputColor.a > 0.0) {\n outputColor = filterColor(outputColor);\n }\n\n vec2 extrude = v_extrude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n outputColor.a *= radar_v;\n}\n";
8
+ /* babel-plugin-inline-import '../shaders/radar/radar_vert.glsl' */
9
+ const pointFillVert = "layout(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 float a_Size;\nlayout(location = ATTRIBUTE_LOCATION_EXTRUDE) in vec3 a_Extrude;\n\nlayout(std140) uniform commonUniorm {\n float u_additive;\n float u_size_unit;\n float u_speed: 1.0;\n float u_time;\n};\n\nout vec4 v_data;\nout vec4 v_color;\nout float v_radius;\nout vec2 v_extrude;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n float newSize = setPickingSize(a_Size);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2(\n cos(time), sin(time),\n -sin(time), cos(time)\n );\n v_extrude = rotateMatrix * a_Extrude.xy;\n\n v_color = a_Color;\n v_color.a *= opacity;\n\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n if(u_size_unit == 1.) {\n newSize = newSize * u_PixelsPerMeter.z;\n }\n v_radius = newSize;\n\n vec2 offset = (a_Extrude.xy * (newSize));\n\n offset = project_pixel(offset);\n\n v_data = vec4(a_Extrude.x, a_Extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0), a_Position64Low);\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
10
+ export default class RadarModel extends BaseModel {
11
+ get attributeLocation() {
12
+ return Object.assign(super.attributeLocation, {
13
+ MAX: super.attributeLocation.MAX,
14
+ SIZE: 9,
15
+ EXTRUDE: 10
16
+ });
17
+ }
18
+ getCommonUniformsInfo() {
19
+ const {
20
+ blend,
21
+ speed = 1,
22
+ unit = 'pixel'
23
+ } = this.layer.getLayerConfig();
24
+ const commonOptions = {
25
+ u_additive: blend === 'additive' ? 1.0 : 0.0,
26
+ u_size_unit: SizeUnitType[unit],
27
+ u_speed: speed,
28
+ u_time: this.layer.getLayerAnimateTime()
29
+ }; //1+1+1+1
30
+ const commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
31
+ return commonBufferInfo;
32
+ }
33
+ getAnimateUniforms() {
34
+ return {};
35
+ }
36
+ getAttribute() {
37
+ return this.styleAttributeService.createAttributesAndIndices(this.layer.getEncodedData(), PointFillTriangulation);
38
+ }
39
+ initModels() {
40
+ var _this = this;
41
+ return _asyncToGenerator(function* () {
42
+ return _this.buildModels();
43
+ })();
44
+ }
45
+ buildModels() {
46
+ var _this2 = this;
47
+ return _asyncToGenerator(function* () {
48
+ _this2.initUniformsBuffer();
49
+ const model = yield _this2.layer.buildLayerModel({
50
+ moduleName: 'pointRadar',
51
+ vertexShader: pointFillVert,
52
+ fragmentShader: pointFillFrag,
53
+ triangulation: PointFillTriangulation,
54
+ defines: _this2.getDefines(),
55
+ inject: _this2.getInject(),
56
+ depth: {
57
+ enable: false
58
+ }
59
+ });
60
+ return [model];
61
+ })();
62
+ }
63
+
64
+ // overwrite baseModel func
65
+ animateOption2Array(option) {
66
+ return [option.enable ? 0 : 1.0, option.speed || 1, option.rings || 3, 0];
67
+ }
68
+ registerBuiltinAttributes() {
69
+ // 注册 Position 属性 64 位地位部分,经纬度数据开启双精度,避免大于 20层级以上出现数据偏移
70
+ this.registerPosition64LowAttribute();
71
+ this.styleAttributeService.registerStyleAttribute({
72
+ name: 'extrude',
73
+ type: AttributeType.Attribute,
74
+ descriptor: {
75
+ name: 'a_Extrude',
76
+ shaderLocation: this.attributeLocation.EXTRUDE,
77
+ buffer: {
78
+ // give the WebGL driver a hint that this buffer may change
79
+ usage: gl.DYNAMIC_DRAW,
80
+ data: [],
81
+ type: gl.FLOAT
82
+ },
83
+ size: 3,
84
+ update: (feature, featureIdx, vertex, attributeIdx) => {
85
+ const extrude = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0];
86
+ const extrudeIndex = attributeIdx % 4 * 3;
87
+ return [extrude[extrudeIndex], extrude[extrudeIndex + 1], extrude[extrudeIndex + 2]];
88
+ }
89
+ }
90
+ });
91
+
92
+ // point layer size;
93
+ this.styleAttributeService.registerStyleAttribute({
94
+ name: 'size',
95
+ type: AttributeType.Attribute,
96
+ descriptor: {
97
+ shaderLocation: this.attributeLocation.SIZE,
98
+ name: 'a_Size',
99
+ buffer: {
100
+ // give the WebGL driver a hint that this buffer may change
101
+ usage: gl.DYNAMIC_DRAW,
102
+ data: [],
103
+ type: gl.FLOAT
104
+ },
105
+ size: 1,
106
+ update: feature => {
107
+ const {
108
+ size = 5
109
+ } = feature;
110
+ return Array.isArray(size) ? [size[0]] : [size];
111
+ }
112
+ }
113
+ });
114
+ }
115
+ }
@@ -0,0 +1,85 @@
1
+ import type { IEncodeFeature, IModel, IModelUniform } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ import type { IGlyphQuad } from '../../utils/symbol-layout';
4
+ export declare function TextTrianglation(feature: IEncodeFeature): {
5
+ vertices: number[];
6
+ indices: number[];
7
+ size: number;
8
+ };
9
+ export default class TextModel extends BaseModel {
10
+ protected get attributeLocation(): {
11
+ readonly POSITION: 0;
12
+ readonly POSITION_64LOW: 1;
13
+ readonly COLOR: 2;
14
+ readonly PICKING_COLOR: 3;
15
+ readonly STROKE: 4;
16
+ readonly OPACITY: 5;
17
+ readonly OFFSETS: 6;
18
+ readonly ROTATION: 7;
19
+ readonly MAX: 8;
20
+ } & Record<string, number> & {
21
+ MAX: 8;
22
+ SIZE: number;
23
+ TEXT_OFFSETS: number;
24
+ UV: number;
25
+ };
26
+ glyphInfo: IEncodeFeature[];
27
+ glyphInfoMap: {
28
+ [key: string]: {
29
+ shaping: any;
30
+ glyphQuads: IGlyphQuad[];
31
+ centroid: number[];
32
+ };
33
+ };
34
+ private rawEncodeData;
35
+ private texture;
36
+ private currentZoom;
37
+ private extent;
38
+ private textureHeight;
39
+ private textCount;
40
+ private preTextStyle;
41
+ getUninforms(): IModelUniform;
42
+ protected getCommonUniformsInfo(): {
43
+ uniformsArray: number[];
44
+ uniformsLength: number;
45
+ uniformsOption: {
46
+ [key: string]: any;
47
+ };
48
+ };
49
+ initModels(): Promise<IModel[]>;
50
+ buildModels(): Promise<IModel[]>;
51
+ needUpdate(): Promise<boolean>;
52
+ clearModels(): void;
53
+ protected registerBuiltinAttributes(): void;
54
+ private bindEvent;
55
+ private mapping;
56
+ private textExtent;
57
+ /**
58
+ * 生成文字纹理(生成文字纹理字典)
59
+ */
60
+ private initTextFont;
61
+ /**
62
+ * 生成 iconfont 纹理字典
63
+ */
64
+ private initIconFontTex;
65
+ private getTextStyle;
66
+ /**
67
+ * 生成文字布局(对照文字纹理字典提取对应文字的位置很好信息)
68
+ */
69
+ private generateGlyphLayout;
70
+ private getFontServiceMapping;
71
+ private getFontServiceCanvas;
72
+ /**
73
+ * 文字避让 depend on originCentorid
74
+ */
75
+ private filterGlyphs;
76
+ /**
77
+ * 初始化文字布局
78
+ */
79
+ private initGlyph;
80
+ /**
81
+ * 更新文字纹理
82
+ */
83
+ private updateTexture;
84
+ private reBuildModel;
85
+ }