@antv/l7-layers 2.9.26-alpha.0 → 2.9.26

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 (588) hide show
  1. package/es/Geometry/index.d.ts +19 -0
  2. package/es/Geometry/index.js +106 -0
  3. package/es/Geometry/models/billboard.d.ts +26 -0
  4. package/es/Geometry/models/billboard.js +232 -0
  5. package/es/Geometry/models/index.d.ts +5 -0
  6. package/es/Geometry/models/index.js +9 -0
  7. package/es/Geometry/models/plane.d.ts +45 -0
  8. package/es/Geometry/models/plane.js +421 -0
  9. package/es/Geometry/models/sprite.d.ts +47 -0
  10. package/es/Geometry/models/sprite.js +304 -0
  11. package/es/Geometry/shaders/billboard_frag.glsl +13 -0
  12. package/es/Geometry/shaders/billboard_vert.glsl +50 -0
  13. package/es/Geometry/shaders/plane_frag.glsl +22 -0
  14. package/es/Geometry/shaders/plane_vert.glsl +53 -0
  15. package/es/Geometry/shaders/sprite_frag.glsl +21 -0
  16. package/es/Geometry/shaders/sprite_vert.glsl +28 -0
  17. package/es/canvas/index.d.ts +19 -0
  18. package/es/canvas/index.js +91 -0
  19. package/es/canvas/models/canvas.d.ts +18 -0
  20. package/es/canvas/models/canvas.js +212 -0
  21. package/es/canvas/models/index.d.ts +5 -0
  22. package/es/canvas/models/index.js +5 -0
  23. package/es/citybuliding/building.d.ts +17 -0
  24. package/es/citybuliding/building.js +88 -0
  25. package/es/citybuliding/models/build.d.ts +22 -0
  26. package/es/citybuliding/models/build.js +188 -0
  27. package/es/citybuliding/shaders/build_frag.glsl +117 -0
  28. package/es/citybuliding/shaders/build_vert.glsl +54 -0
  29. package/es/core/BaseLayer.d.ts +212 -0
  30. package/es/core/BaseLayer.js +1409 -0
  31. package/es/core/BaseModel.d.ts +140 -0
  32. package/es/core/BaseModel.js +486 -0
  33. package/es/core/interface.d.ts +201 -0
  34. package/es/core/interface.js +30 -0
  35. package/es/core/schema.d.ts +27 -0
  36. package/es/core/schema.js +25 -0
  37. package/es/core/shape/Path.d.ts +39 -0
  38. package/es/core/shape/Path.js +62 -0
  39. package/es/core/shape/extrude.d.ts +17 -0
  40. package/es/core/shape/extrude.js +148 -0
  41. package/es/core/triangulation.d.ts +122 -0
  42. package/es/core/triangulation.js +491 -0
  43. package/es/earth/index.d.ts +17 -0
  44. package/es/earth/index.js +91 -0
  45. package/es/earth/models/atmosphere.d.ts +9 -0
  46. package/es/earth/models/atmosphere.js +138 -0
  47. package/es/earth/models/base.d.ts +16 -0
  48. package/es/earth/models/base.js +212 -0
  49. package/es/earth/models/bloomsphere.d.ts +9 -0
  50. package/es/earth/models/bloomsphere.js +138 -0
  51. package/es/earth/shaders/atmosphere_frag.glsl +17 -0
  52. package/es/earth/shaders/atmosphere_vert.glsl +26 -0
  53. package/es/earth/shaders/base_frag.glsl +13 -0
  54. package/es/earth/shaders/base_vert.glsl +52 -0
  55. package/es/earth/shaders/bloomsphere_frag.glsl +15 -0
  56. package/es/earth/shaders/bloomsphere_vert.glsl +20 -0
  57. package/es/earth/utils.d.ts +26 -0
  58. package/es/earth/utils.js +104 -0
  59. package/es/heatmap/index.d.ts +21 -0
  60. package/es/heatmap/index.js +145 -0
  61. package/es/heatmap/models/grid.d.ts +8 -0
  62. package/es/heatmap/models/grid.js +108 -0
  63. package/es/heatmap/models/grid3d.d.ts +8 -0
  64. package/es/heatmap/models/grid3d.js +147 -0
  65. package/es/heatmap/models/heatmap.d.ts +24 -0
  66. package/es/heatmap/models/heatmap.js +464 -0
  67. package/es/heatmap/models/hexagon.d.ts +8 -0
  68. package/es/heatmap/models/hexagon.js +111 -0
  69. package/es/heatmap/models/index.d.ts +5 -0
  70. package/es/heatmap/models/index.js +12 -0
  71. package/es/heatmap/shaders/grid_vert.glsl +42 -0
  72. package/es/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
  73. package/es/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
  74. package/es/heatmap/shaders/heatmap_frag.glsl +47 -0
  75. package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
  76. package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
  77. package/es/heatmap/shaders/heatmap_vert.glsl +10 -0
  78. package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  79. package/es/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
  80. package/es/heatmap/shaders/hexagon_frag.glsl +12 -0
  81. package/es/heatmap/shaders/hexagon_vert.glsl +41 -0
  82. package/es/heatmap/triangulation.d.ts +5 -0
  83. package/es/heatmap/triangulation.js +38 -0
  84. package/es/image/index.d.ts +19 -0
  85. package/es/image/index.js +103 -0
  86. package/es/image/models/dataImage.d.ts +22 -0
  87. package/es/image/models/dataImage.js +225 -0
  88. package/es/image/models/image.d.ts +19 -0
  89. package/es/image/models/image.js +169 -0
  90. package/es/image/models/index.d.ts +5 -0
  91. package/es/image/models/index.js +7 -0
  92. package/es/image/shaders/dataImage_frag.glsl +38 -0
  93. package/es/image/shaders/image_frag.glsl +9 -0
  94. package/es/image/shaders/image_vert.glsl +17 -0
  95. package/es/index.d.ts +17 -0
  96. package/es/index.js +107 -0
  97. package/es/line/index.d.ts +42 -0
  98. package/es/line/index.js +140 -0
  99. package/es/line/models/arc.d.ts +17 -0
  100. package/es/line/models/arc.js +356 -0
  101. package/es/line/models/arc_3d.d.ts +17 -0
  102. package/es/line/models/arc_3d.js +335 -0
  103. package/es/line/models/earthArc_3d.d.ts +17 -0
  104. package/es/line/models/earthArc_3d.js +338 -0
  105. package/es/line/models/great_circle.d.ts +12 -0
  106. package/es/line/models/great_circle.js +294 -0
  107. package/es/line/models/half.d.ts +18 -0
  108. package/es/line/models/half.js +282 -0
  109. package/es/line/models/index.d.ts +5 -0
  110. package/es/line/models/index.js +25 -0
  111. package/es/line/models/line.d.ts +21 -0
  112. package/es/line/models/line.js +442 -0
  113. package/es/line/models/linearline.d.ts +11 -0
  114. package/es/line/models/linearline.js +276 -0
  115. package/es/line/models/simpleLine.d.ts +14 -0
  116. package/es/line/models/simpleLine.js +233 -0
  117. package/es/line/models/tile.d.ts +11 -0
  118. package/es/line/models/tile.js +351 -0
  119. package/es/line/models/wall.d.ts +12 -0
  120. package/es/line/models/wall.js +329 -0
  121. package/es/line/shaders/arc_chunks.vert.glsl +21 -0
  122. package/es/line/shaders/dash/arc_dash_frag.glsl +28 -0
  123. package/es/line/shaders/dash/arc_dash_vert.glsl +148 -0
  124. package/es/line/shaders/dash/line_dash_frag.glsl +31 -0
  125. package/es/line/shaders/dash/line_dash_vert.glsl +93 -0
  126. package/es/line/shaders/half/line_half_frag.glsl +53 -0
  127. package/es/line/shaders/half/line_half_vert.glsl +169 -0
  128. package/es/line/shaders/line_arc2d_vert.glsl +114 -0
  129. package/es/line/shaders/line_arc_3d_frag.glsl +103 -0
  130. package/es/line/shaders/line_arc_3d_vert.glsl +207 -0
  131. package/es/line/shaders/line_arc_frag.glsl +89 -0
  132. package/es/line/shaders/line_arc_great_circle_frag.glsl +101 -0
  133. package/es/line/shaders/line_arc_great_circle_vert.glsl +215 -0
  134. package/es/line/shaders/line_arc_vert.glsl +176 -0
  135. package/es/line/shaders/line_bezier_vert.glsl +85 -0
  136. package/es/line/shaders/line_frag.glsl +100 -0
  137. package/es/line/shaders/line_vert.glsl +192 -0
  138. package/es/line/shaders/linear/arc3d_linear_frag.glsl +47 -0
  139. package/es/line/shaders/linear/arc3d_linear_vert.glsl +207 -0
  140. package/es/line/shaders/linear/arc_linear_frag.glsl +38 -0
  141. package/es/line/shaders/linear/arc_linear_vert.glsl +138 -0
  142. package/es/line/shaders/linear/line_linear_frag.glsl +27 -0
  143. package/es/line/shaders/linearLine/line_linear_frag.glsl +20 -0
  144. package/es/line/shaders/linearLine/line_linear_vert.glsl +112 -0
  145. package/es/line/shaders/simple/simpleline_frag.glsl +10 -0
  146. package/es/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
  147. package/es/line/shaders/simple/simpleline_vert.glsl +79 -0
  148. package/es/line/shaders/tile/line_tile_frag.glsl +79 -0
  149. package/es/line/shaders/tile/line_tile_vert.glsl +210 -0
  150. package/es/line/shaders/wall_frag.glsl +93 -0
  151. package/es/line/shaders/wall_vert.glsl +111 -0
  152. package/es/mask/index.d.ts +26 -0
  153. package/es/mask/index.js +82 -0
  154. package/es/mask/models/fill.d.ts +11 -0
  155. package/es/mask/models/fill.js +121 -0
  156. package/es/mask/models/index.d.ts +5 -0
  157. package/es/mask/models/index.js +5 -0
  158. package/es/mask/shaders/mask_frag.glsl +7 -0
  159. package/es/mask/shaders/mask_vert.glsl +22 -0
  160. package/es/plugins/DataMappingPlugin.d.ts +18 -0
  161. package/es/plugins/DataMappingPlugin.js +345 -0
  162. package/es/plugins/DataSourcePlugin.d.ts +7 -0
  163. package/es/plugins/DataSourcePlugin.js +83 -0
  164. package/es/plugins/FeatureScalePlugin.d.ts +26 -0
  165. package/es/plugins/FeatureScalePlugin.js +380 -0
  166. package/es/plugins/LayerAnimateStylePlugin.d.ts +7 -0
  167. package/es/plugins/LayerAnimateStylePlugin.js +49 -0
  168. package/es/plugins/LayerModelPlugin.d.ts +10 -0
  169. package/es/plugins/LayerModelPlugin.js +71 -0
  170. package/es/plugins/LayerStylePlugin.d.ts +8 -0
  171. package/es/plugins/LayerStylePlugin.js +39 -0
  172. package/es/plugins/LightingPlugin.d.ts +36 -0
  173. package/es/plugins/LightingPlugin.js +110 -0
  174. package/es/plugins/MultiPassRendererPlugin.d.ts +24 -0
  175. package/es/plugins/MultiPassRendererPlugin.js +77 -0
  176. package/es/plugins/PixelPickingPlugin.d.ts +8 -0
  177. package/es/plugins/PixelPickingPlugin.js +146 -0
  178. package/es/plugins/RegisterStyleAttributePlugin.d.ts +11 -0
  179. package/es/plugins/RegisterStyleAttributePlugin.js +105 -0
  180. package/es/plugins/ShaderUniformPlugin.d.ts +17 -0
  181. package/es/plugins/ShaderUniformPlugin.js +107 -0
  182. package/es/plugins/UpdateModelPlugin.d.ts +8 -0
  183. package/es/plugins/UpdateModelPlugin.js +31 -0
  184. package/es/plugins/UpdateStyleAttributePlugin.d.ts +12 -0
  185. package/es/plugins/UpdateStyleAttributePlugin.js +87 -0
  186. package/es/point/index.d.ts +40 -0
  187. package/es/point/index.js +234 -0
  188. package/es/point/models/earthExtrude.d.ts +24 -0
  189. package/es/point/models/earthExtrude.js +279 -0
  190. package/es/point/models/earthFill.d.ts +11 -0
  191. package/es/point/models/earthFill.js +258 -0
  192. package/es/point/models/extrude.d.ts +24 -0
  193. package/es/point/models/extrude.js +298 -0
  194. package/es/point/models/fill.d.ts +40 -0
  195. package/es/point/models/fill.js +404 -0
  196. package/es/point/models/fillmage.d.ts +25 -0
  197. package/es/point/models/fillmage.js +367 -0
  198. package/es/point/models/image.d.ts +11 -0
  199. package/es/point/models/image.js +239 -0
  200. package/es/point/models/index.d.ts +5 -0
  201. package/es/point/models/index.js +30 -0
  202. package/es/point/models/normal.d.ts +17 -0
  203. package/es/point/models/normal.js +177 -0
  204. package/es/point/models/radar.d.ts +24 -0
  205. package/es/point/models/radar.js +297 -0
  206. package/es/point/models/simplePoint.d.ts +17 -0
  207. package/es/point/models/simplePoint.js +188 -0
  208. package/es/point/models/text.d.ts +57 -0
  209. package/es/point/models/text.js +622 -0
  210. package/es/point/models/tile.d.ts +22 -0
  211. package/es/point/models/tile.js +309 -0
  212. package/es/point/models/tileText.d.ts +56 -0
  213. package/es/point/models/tileText.js +598 -0
  214. package/es/point/shaders/animate/wave_frag.glsl +65 -0
  215. package/es/point/shaders/earth/extrude_frag.glsl +44 -0
  216. package/es/point/shaders/earth/extrude_vert.glsl +140 -0
  217. package/es/point/shaders/earth/fill_frag.glsl +86 -0
  218. package/es/point/shaders/earth/fill_vert.glsl +126 -0
  219. package/es/point/shaders/extrude/extrude_frag.glsl +44 -0
  220. package/es/point/shaders/extrude/extrude_vert.glsl +121 -0
  221. package/es/point/shaders/fill_frag.glsl +84 -0
  222. package/es/point/shaders/fill_vert.glsl +189 -0
  223. package/es/point/shaders/image/fillImage_frag.glsl +20 -0
  224. package/es/point/shaders/image/fillImage_vert.glsl +116 -0
  225. package/es/point/shaders/image_frag.glsl +39 -0
  226. package/es/point/shaders/image_vert.glsl +90 -0
  227. package/es/point/shaders/normal_frag.glsl +15 -0
  228. package/es/point/shaders/normal_vert.glsl +79 -0
  229. package/es/point/shaders/radar/radar_frag.glsl +64 -0
  230. package/es/point/shaders/radar/radar_vert.glsl +120 -0
  231. package/es/point/shaders/simplePoint_frag.glsl +53 -0
  232. package/es/point/shaders/simplePoint_vert.glsl +79 -0
  233. package/es/point/shaders/text_frag.glsl +48 -0
  234. package/es/point/shaders/text_vert.glsl +131 -0
  235. package/es/point/shaders/tile/fill_tile_frag.glsl +83 -0
  236. package/es/point/shaders/tile/fill_tile_vert.glsl +181 -0
  237. package/es/point/shape/extrude.d.ts +15 -0
  238. package/es/point/shape/extrude.js +63 -0
  239. package/es/polygon/index.d.ts +27 -0
  240. package/es/polygon/index.js +148 -0
  241. package/es/polygon/models/extrude.d.ts +28 -0
  242. package/es/polygon/models/extrude.js +306 -0
  243. package/es/polygon/models/fill.d.ts +17 -0
  244. package/es/polygon/models/fill.js +211 -0
  245. package/es/polygon/models/index.d.ts +5 -0
  246. package/es/polygon/models/index.js +28 -0
  247. package/es/polygon/models/ocean.d.ts +23 -0
  248. package/es/polygon/models/ocean.js +236 -0
  249. package/es/polygon/models/tile.d.ts +15 -0
  250. package/es/polygon/models/tile.js +133 -0
  251. package/es/polygon/models/water.d.ts +18 -0
  252. package/es/polygon/models/water.js +213 -0
  253. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
  254. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
  255. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
  256. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
  257. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
  258. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
  259. package/es/polygon/shaders/polygon_frag.glsl +12 -0
  260. package/es/polygon/shaders/polygon_linear_frag.glsl +22 -0
  261. package/es/polygon/shaders/polygon_linear_vert.glsl +74 -0
  262. package/es/polygon/shaders/polygon_vert.glsl +66 -0
  263. package/es/polygon/shaders/tile/polygon_tile_frag.glsl +12 -0
  264. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +82 -0
  265. package/es/polygon/shaders/water/polygon_ocean_frag.glsl +248 -0
  266. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +52 -0
  267. package/es/polygon/shaders/water/polygon_water_frag.glsl +73 -0
  268. package/es/polygon/shaders/water/polygon_water_vert.glsl +55 -0
  269. package/es/raster/buffers/triangulation.d.ts +6 -0
  270. package/es/raster/buffers/triangulation.js +28 -0
  271. package/es/raster/index.d.ts +19 -0
  272. package/es/raster/index.js +106 -0
  273. package/es/raster/models/index.d.ts +5 -0
  274. package/es/raster/models/index.js +8 -0
  275. package/es/raster/models/raster.d.ts +21 -0
  276. package/es/raster/models/raster.js +167 -0
  277. package/es/raster/raster.d.ts +30 -0
  278. package/es/raster/raster.js +174 -0
  279. package/es/raster/shaders/raster_2d_frag.glsl +28 -0
  280. package/es/raster/shaders/raster_2d_vert.glsl +18 -0
  281. package/es/raster/shaders/raster_frag.glsl +9 -0
  282. package/es/raster/shaders/raster_vert.glsl +44 -0
  283. package/es/tile/interface.d.ts +28 -0
  284. package/es/tile/interface.js +1 -0
  285. package/es/tile/manager/tileConfigManager.d.ts +17 -0
  286. package/es/tile/manager/tileConfigManager.js +121 -0
  287. package/es/tile/manager/tileLayerManager.d.ts +37 -0
  288. package/es/tile/manager/tileLayerManager.js +323 -0
  289. package/es/tile/manager/tilePickerManager.d.ts +21 -0
  290. package/es/tile/manager/tilePickerManager.js +190 -0
  291. package/es/tile/models/tileModel.d.ts +8 -0
  292. package/es/tile/models/tileModel.js +62 -0
  293. package/es/tile/tileFactory/base.d.ts +44 -0
  294. package/es/tile/tileFactory/base.js +444 -0
  295. package/es/tile/tileFactory/index.d.ts +5 -0
  296. package/es/tile/tileFactory/index.js +33 -0
  297. package/es/tile/tileFactory/line.d.ts +12 -0
  298. package/es/tile/tileFactory/line.js +59 -0
  299. package/es/tile/tileFactory/point.d.ts +12 -0
  300. package/es/tile/tileFactory/point.js +59 -0
  301. package/es/tile/tileFactory/polygon.d.ts +12 -0
  302. package/es/tile/tileFactory/polygon.js +59 -0
  303. package/es/tile/tileFactory/raster.d.ts +12 -0
  304. package/es/tile/tileFactory/raster.js +55 -0
  305. package/es/tile/tileFactory/rasterData.d.ts +12 -0
  306. package/es/tile/tileFactory/rasterData.js +80 -0
  307. package/es/tile/tileFactory/rasterDataLayer.d.ts +19 -0
  308. package/es/tile/tileFactory/rasterDataLayer.js +87 -0
  309. package/es/tile/tileFactory/test.d.ts +12 -0
  310. package/es/tile/tileFactory/test.js +82 -0
  311. package/es/tile/tileFactory/vectorLayer.d.ts +29 -0
  312. package/es/tile/tileFactory/vectorLayer.js +161 -0
  313. package/es/tile/tileLayer/baseTileLayer.d.ts +47 -0
  314. package/es/tile/tileLayer/baseTileLayer.js +438 -0
  315. package/es/tile/tileTest.d.ts +14 -0
  316. package/es/tile/tileTest.js +63 -0
  317. package/es/tile/tmsTileLayer.d.ts +7 -0
  318. package/es/tile/tmsTileLayer.js +101 -0
  319. package/es/tile/utils.d.ts +13 -0
  320. package/es/tile/utils.js +131 -0
  321. package/es/utils/blend.d.ts +2 -0
  322. package/es/utils/blend.js +54 -0
  323. package/es/utils/collision-index.d.ts +47 -0
  324. package/es/utils/collision-index.js +102 -0
  325. package/es/utils/dataMappingStyle.d.ts +31 -0
  326. package/es/utils/dataMappingStyle.js +147 -0
  327. package/es/utils/extrude_polyline.d.ts +67 -0
  328. package/es/utils/extrude_polyline.js +611 -0
  329. package/es/utils/grid-index.d.ts +28 -0
  330. package/es/utils/grid-index.js +179 -0
  331. package/es/utils/layerData.d.ts +2 -0
  332. package/es/utils/layerData.js +176 -0
  333. package/es/utils/multiPassRender.d.ts +16 -0
  334. package/es/utils/multiPassRender.js +50 -0
  335. package/es/utils/polylineNormal.d.ts +9 -0
  336. package/es/utils/polylineNormal.js +191 -0
  337. package/es/utils/simpleLine.d.ts +23 -0
  338. package/es/utils/simpleLine.js +103 -0
  339. package/es/utils/symbol-layout.d.ts +43 -0
  340. package/es/utils/symbol-layout.js +299 -0
  341. package/es/utils/updateShape.d.ts +2 -0
  342. package/es/utils/updateShape.js +20 -0
  343. package/es/wind/index.d.ts +20 -0
  344. package/es/wind/index.js +100 -0
  345. package/es/wind/models/index.d.ts +5 -0
  346. package/es/wind/models/index.js +5 -0
  347. package/es/wind/models/utils.d.ts +19 -0
  348. package/es/wind/models/utils.js +226 -0
  349. package/es/wind/models/wind.d.ts +33 -0
  350. package/es/wind/models/wind.js +331 -0
  351. package/es/wind/models/windRender.d.ts +104 -0
  352. package/es/wind/models/windRender.js +357 -0
  353. package/es/wind/models/windShader.d.ts +12 -0
  354. package/es/wind/models/windShader.js +12 -0
  355. package/es/wind/shaders/wind_frag.glsl +9 -0
  356. package/es/wind/shaders/wind_vert.glsl +17 -0
  357. package/lib/Geometry/index.js +119 -0
  358. package/lib/Geometry/models/billboard.js +246 -0
  359. package/lib/Geometry/models/index.js +22 -0
  360. package/lib/Geometry/models/plane.js +436 -0
  361. package/lib/Geometry/models/sprite.js +318 -0
  362. package/lib/Geometry/shaders/billboard_frag.glsl +13 -0
  363. package/lib/Geometry/shaders/billboard_vert.glsl +50 -0
  364. package/lib/Geometry/shaders/plane_frag.glsl +22 -0
  365. package/lib/Geometry/shaders/plane_vert.glsl +53 -0
  366. package/lib/Geometry/shaders/sprite_frag.glsl +21 -0
  367. package/lib/Geometry/shaders/sprite_vert.glsl +28 -0
  368. package/lib/canvas/index.js +104 -0
  369. package/lib/canvas/models/canvas.js +221 -0
  370. package/lib/canvas/models/index.js +16 -0
  371. package/lib/citybuliding/building.js +101 -0
  372. package/lib/citybuliding/models/build.js +203 -0
  373. package/lib/citybuliding/shaders/build_frag.glsl +117 -0
  374. package/lib/citybuliding/shaders/build_vert.glsl +54 -0
  375. package/lib/core/BaseLayer.js +1408 -0
  376. package/lib/core/BaseModel.js +503 -0
  377. package/lib/core/interface.js +41 -0
  378. package/lib/core/schema.js +33 -0
  379. package/lib/core/shape/Path.js +88 -0
  380. package/lib/core/shape/extrude.js +180 -0
  381. package/lib/core/triangulation.js +555 -0
  382. package/lib/earth/index.js +107 -0
  383. package/lib/earth/models/atmosphere.js +152 -0
  384. package/lib/earth/models/base.js +222 -0
  385. package/lib/earth/models/bloomsphere.js +152 -0
  386. package/lib/earth/shaders/atmosphere_frag.glsl +17 -0
  387. package/lib/earth/shaders/atmosphere_vert.glsl +26 -0
  388. package/lib/earth/shaders/base_frag.glsl +13 -0
  389. package/lib/earth/shaders/base_vert.glsl +52 -0
  390. package/lib/earth/shaders/bloomsphere_frag.glsl +15 -0
  391. package/lib/earth/shaders/bloomsphere_vert.glsl +20 -0
  392. package/lib/earth/utils.js +136 -0
  393. package/lib/heatmap/index.js +158 -0
  394. package/lib/heatmap/models/grid.js +122 -0
  395. package/lib/heatmap/models/grid3d.js +161 -0
  396. package/lib/heatmap/models/heatmap.js +487 -0
  397. package/lib/heatmap/models/hexagon.js +125 -0
  398. package/lib/heatmap/models/index.js +26 -0
  399. package/lib/heatmap/shaders/grid_vert.glsl +42 -0
  400. package/lib/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
  401. package/lib/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
  402. package/lib/heatmap/shaders/heatmap_frag.glsl +47 -0
  403. package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
  404. package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
  405. package/lib/heatmap/shaders/heatmap_vert.glsl +10 -0
  406. package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  407. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
  408. package/lib/heatmap/shaders/hexagon_frag.glsl +12 -0
  409. package/lib/heatmap/shaders/hexagon_vert.glsl +41 -0
  410. package/lib/heatmap/triangulation.js +45 -0
  411. package/lib/image/index.js +116 -0
  412. package/lib/image/models/dataImage.js +240 -0
  413. package/lib/image/models/image.js +183 -0
  414. package/lib/image/models/index.js +19 -0
  415. package/lib/image/shaders/dataImage_frag.glsl +38 -0
  416. package/lib/image/shaders/image_frag.glsl +9 -0
  417. package/lib/image/shaders/image_vert.glsl +17 -0
  418. package/lib/index.js +275 -0
  419. package/lib/line/index.js +153 -0
  420. package/lib/line/models/arc.js +373 -0
  421. package/lib/line/models/arc_3d.js +353 -0
  422. package/lib/line/models/earthArc_3d.js +356 -0
  423. package/lib/line/models/great_circle.js +310 -0
  424. package/lib/line/models/half.js +299 -0
  425. package/lib/line/models/index.js +46 -0
  426. package/lib/line/models/line.js +459 -0
  427. package/lib/line/models/linearline.js +293 -0
  428. package/lib/line/models/simpleLine.js +248 -0
  429. package/lib/line/models/tile.js +368 -0
  430. package/lib/line/models/wall.js +345 -0
  431. package/lib/line/shaders/arc_chunks.vert.glsl +21 -0
  432. package/lib/line/shaders/dash/arc_dash_frag.glsl +28 -0
  433. package/lib/line/shaders/dash/arc_dash_vert.glsl +148 -0
  434. package/lib/line/shaders/dash/line_dash_frag.glsl +31 -0
  435. package/lib/line/shaders/dash/line_dash_vert.glsl +93 -0
  436. package/lib/line/shaders/half/line_half_frag.glsl +53 -0
  437. package/lib/line/shaders/half/line_half_vert.glsl +169 -0
  438. package/lib/line/shaders/line_arc2d_vert.glsl +114 -0
  439. package/lib/line/shaders/line_arc_3d_frag.glsl +103 -0
  440. package/lib/line/shaders/line_arc_3d_vert.glsl +207 -0
  441. package/lib/line/shaders/line_arc_frag.glsl +89 -0
  442. package/lib/line/shaders/line_arc_great_circle_frag.glsl +101 -0
  443. package/lib/line/shaders/line_arc_great_circle_vert.glsl +215 -0
  444. package/lib/line/shaders/line_arc_vert.glsl +176 -0
  445. package/lib/line/shaders/line_bezier_vert.glsl +85 -0
  446. package/lib/line/shaders/line_frag.glsl +100 -0
  447. package/lib/line/shaders/line_vert.glsl +192 -0
  448. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +47 -0
  449. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +207 -0
  450. package/lib/line/shaders/linear/arc_linear_frag.glsl +38 -0
  451. package/lib/line/shaders/linear/arc_linear_vert.glsl +138 -0
  452. package/lib/line/shaders/linear/line_linear_frag.glsl +27 -0
  453. package/lib/line/shaders/linearLine/line_linear_frag.glsl +20 -0
  454. package/lib/line/shaders/linearLine/line_linear_vert.glsl +112 -0
  455. package/lib/line/shaders/simple/simpleline_frag.glsl +10 -0
  456. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
  457. package/lib/line/shaders/simple/simpleline_vert.glsl +79 -0
  458. package/lib/line/shaders/tile/line_tile_frag.glsl +79 -0
  459. package/lib/line/shaders/tile/line_tile_vert.glsl +210 -0
  460. package/lib/line/shaders/wall_frag.glsl +93 -0
  461. package/lib/line/shaders/wall_vert.glsl +111 -0
  462. package/lib/mask/index.js +95 -0
  463. package/lib/mask/models/fill.js +137 -0
  464. package/lib/mask/models/index.js +16 -0
  465. package/lib/mask/shaders/mask_frag.glsl +7 -0
  466. package/lib/mask/shaders/mask_vert.glsl +22 -0
  467. package/lib/plugins/DataMappingPlugin.js +360 -0
  468. package/lib/plugins/DataSourcePlugin.js +96 -0
  469. package/lib/plugins/FeatureScalePlugin.js +404 -0
  470. package/lib/plugins/LayerAnimateStylePlugin.js +64 -0
  471. package/lib/plugins/LayerModelPlugin.js +82 -0
  472. package/lib/plugins/LayerStylePlugin.js +50 -0
  473. package/lib/plugins/LightingPlugin.js +125 -0
  474. package/lib/plugins/MultiPassRendererPlugin.js +93 -0
  475. package/lib/plugins/PixelPickingPlugin.js +159 -0
  476. package/lib/plugins/RegisterStyleAttributePlugin.js +117 -0
  477. package/lib/plugins/ShaderUniformPlugin.js +120 -0
  478. package/lib/plugins/UpdateModelPlugin.js +42 -0
  479. package/lib/plugins/UpdateStyleAttributePlugin.js +98 -0
  480. package/lib/point/index.js +247 -0
  481. package/lib/point/models/earthExtrude.js +295 -0
  482. package/lib/point/models/earthFill.js +293 -0
  483. package/lib/point/models/extrude.js +315 -0
  484. package/lib/point/models/fill.js +420 -0
  485. package/lib/point/models/fillmage.js +383 -0
  486. package/lib/point/models/image.js +255 -0
  487. package/lib/point/models/index.js +53 -0
  488. package/lib/point/models/normal.js +194 -0
  489. package/lib/point/models/radar.js +314 -0
  490. package/lib/point/models/simplePoint.js +205 -0
  491. package/lib/point/models/text.js +637 -0
  492. package/lib/point/models/tile.js +325 -0
  493. package/lib/point/models/tileText.js +613 -0
  494. package/lib/point/shaders/animate/wave_frag.glsl +65 -0
  495. package/lib/point/shaders/earth/extrude_frag.glsl +44 -0
  496. package/lib/point/shaders/earth/extrude_vert.glsl +140 -0
  497. package/lib/point/shaders/earth/fill_frag.glsl +86 -0
  498. package/lib/point/shaders/earth/fill_vert.glsl +126 -0
  499. package/lib/point/shaders/extrude/extrude_frag.glsl +44 -0
  500. package/lib/point/shaders/extrude/extrude_vert.glsl +121 -0
  501. package/lib/point/shaders/fill_frag.glsl +84 -0
  502. package/lib/point/shaders/fill_vert.glsl +189 -0
  503. package/lib/point/shaders/image/fillImage_frag.glsl +20 -0
  504. package/lib/point/shaders/image/fillImage_vert.glsl +116 -0
  505. package/lib/point/shaders/image_frag.glsl +39 -0
  506. package/lib/point/shaders/image_vert.glsl +90 -0
  507. package/lib/point/shaders/normal_frag.glsl +15 -0
  508. package/lib/point/shaders/normal_vert.glsl +79 -0
  509. package/lib/point/shaders/radar/radar_frag.glsl +64 -0
  510. package/lib/point/shaders/radar/radar_vert.glsl +120 -0
  511. package/lib/point/shaders/simplePoint_frag.glsl +53 -0
  512. package/lib/point/shaders/simplePoint_vert.glsl +79 -0
  513. package/lib/point/shaders/text_frag.glsl +48 -0
  514. package/lib/point/shaders/text_vert.glsl +131 -0
  515. package/lib/point/shaders/tile/fill_tile_frag.glsl +83 -0
  516. package/lib/point/shaders/tile/fill_tile_vert.glsl +181 -0
  517. package/lib/point/shape/extrude.js +78 -0
  518. package/lib/polygon/index.js +162 -0
  519. package/lib/polygon/models/extrude.js +322 -0
  520. package/lib/polygon/models/fill.js +226 -0
  521. package/lib/polygon/models/index.js +50 -0
  522. package/lib/polygon/models/ocean.js +252 -0
  523. package/lib/polygon/models/tile.js +147 -0
  524. package/lib/polygon/models/water.js +229 -0
  525. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
  526. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
  527. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
  528. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
  529. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
  530. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
  531. package/lib/polygon/shaders/polygon_frag.glsl +12 -0
  532. package/lib/polygon/shaders/polygon_linear_frag.glsl +22 -0
  533. package/lib/polygon/shaders/polygon_linear_vert.glsl +74 -0
  534. package/lib/polygon/shaders/polygon_vert.glsl +66 -0
  535. package/lib/polygon/shaders/tile/polygon_tile_frag.glsl +12 -0
  536. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +82 -0
  537. package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +248 -0
  538. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +52 -0
  539. package/lib/polygon/shaders/water/polygon_water_frag.glsl +73 -0
  540. package/lib/polygon/shaders/water/polygon_water_vert.glsl +55 -0
  541. package/lib/raster/buffers/triangulation.js +38 -0
  542. package/lib/raster/index.js +119 -0
  543. package/lib/raster/models/index.js +20 -0
  544. package/lib/raster/models/raster.js +182 -0
  545. package/lib/raster/raster.js +191 -0
  546. package/lib/raster/shaders/raster_2d_frag.glsl +28 -0
  547. package/lib/raster/shaders/raster_2d_vert.glsl +18 -0
  548. package/lib/raster/shaders/raster_frag.glsl +9 -0
  549. package/lib/raster/shaders/raster_vert.glsl +44 -0
  550. package/lib/tile/interface.js +5 -0
  551. package/lib/tile/manager/tileConfigManager.js +133 -0
  552. package/lib/tile/manager/tileLayerManager.js +341 -0
  553. package/lib/tile/manager/tilePickerManager.js +201 -0
  554. package/lib/tile/models/tileModel.js +74 -0
  555. package/lib/tile/tileFactory/base.js +466 -0
  556. package/lib/tile/tileFactory/index.js +64 -0
  557. package/lib/tile/tileFactory/line.js +70 -0
  558. package/lib/tile/tileFactory/point.js +70 -0
  559. package/lib/tile/tileFactory/polygon.js +70 -0
  560. package/lib/tile/tileFactory/raster.js +68 -0
  561. package/lib/tile/tileFactory/rasterData.js +93 -0
  562. package/lib/tile/tileFactory/rasterDataLayer.js +100 -0
  563. package/lib/tile/tileFactory/test.js +95 -0
  564. package/lib/tile/tileFactory/vectorLayer.js +176 -0
  565. package/lib/tile/tileLayer/baseTileLayer.js +447 -0
  566. package/lib/tile/tileTest.js +75 -0
  567. package/lib/tile/tmsTileLayer.js +117 -0
  568. package/lib/tile/utils.js +158 -0
  569. package/lib/utils/blend.js +65 -0
  570. package/lib/utils/collision-index.js +118 -0
  571. package/lib/utils/dataMappingStyle.js +151 -0
  572. package/lib/utils/extrude_polyline.js +653 -0
  573. package/lib/utils/grid-index.js +188 -0
  574. package/lib/utils/layerData.js +187 -0
  575. package/lib/utils/multiPassRender.js +61 -0
  576. package/lib/utils/polylineNormal.js +230 -0
  577. package/lib/utils/simpleLine.js +116 -0
  578. package/lib/utils/symbol-layout.js +308 -0
  579. package/lib/utils/updateShape.js +27 -0
  580. package/lib/wind/index.js +113 -0
  581. package/lib/wind/models/index.js +16 -0
  582. package/lib/wind/models/utils.js +253 -0
  583. package/lib/wind/models/wind.js +346 -0
  584. package/lib/wind/models/windRender.js +373 -0
  585. package/lib/wind/models/windShader.js +25 -0
  586. package/lib/wind/shaders/wind_frag.glsl +9 -0
  587. package/lib/wind/shaders/wind_vert.glsl +17 -0
  588. package/package.json +6 -7
@@ -0,0 +1,26 @@
1
+ export declare const EARTH_RADIUS = 100;
2
+ export declare const EARTH_SEGMENTS = 36;
3
+ export declare const EARTH_RADIUS_OUTER = 40;
4
+ /**
5
+ * 经纬度转xyz
6
+ * @param longitude 经度
7
+ * @param latitude 纬度
8
+ * @param radius 半径
9
+ */
10
+ export declare function lglt2xyz(lnglat: [number, number]): number[];
11
+ /**
12
+ * 构建地球球体网格
13
+ * @param radius
14
+ * @param opt
15
+ * @returns
16
+ */
17
+ export declare function primitiveSphere(radius: number, opt: {
18
+ segments: number;
19
+ }): {
20
+ cells: number[][];
21
+ positions: (number[] | Float32Array)[];
22
+ uvs: number[][];
23
+ positionsArr: number[];
24
+ indicesArr: number[];
25
+ normalArr: number[];
26
+ };
@@ -0,0 +1,104 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import { mat4, vec3 } from 'gl-matrix'; // 该文件专门记录地球模式的数值
3
+ // 地球网格半径
4
+
5
+ export var EARTH_RADIUS = 100;
6
+ export var EARTH_SEGMENTS = 36;
7
+ export var EARTH_RADIUS_OUTER = 40;
8
+ /**
9
+ * 角度转弧度
10
+ * @param deg
11
+ * @returns
12
+ */
13
+
14
+ function torad(deg) {
15
+ return deg / 180 * Math.acos(-1);
16
+ }
17
+ /**
18
+ * 经纬度转xyz
19
+ * @param longitude 经度
20
+ * @param latitude 纬度
21
+ * @param radius 半径
22
+ */
23
+
24
+
25
+ export function lglt2xyz(lnglat) {
26
+ // TODO: + Math.PI/2 是为了对齐坐标
27
+ var lng = torad(lnglat[0]) + Math.PI / 2;
28
+ var lat = torad(lnglat[1]); // TODO: 手动增加一些偏移,减轻面的冲突
29
+
30
+ var radius = EARTH_RADIUS + Math.random() * 0.4;
31
+ var z = radius * Math.cos(lat) * Math.cos(lng);
32
+ var x = radius * Math.cos(lat) * Math.sin(lng);
33
+ var y = radius * Math.sin(lat);
34
+ return [x, y, z];
35
+ }
36
+ /**
37
+ * 构建地球球体网格
38
+ * @param radius
39
+ * @param opt
40
+ * @returns
41
+ */
42
+
43
+ export function primitiveSphere(radius, opt) {
44
+ var matRotY = mat4.create();
45
+ var matRotZ = mat4.create();
46
+ var up = vec3.fromValues(0, 1, 0);
47
+ var tmpVec3 = vec3.fromValues(0, 0, 0);
48
+ opt = opt || {};
49
+ radius = typeof radius !== 'undefined' ? radius : 1;
50
+ var segments = typeof opt.segments !== 'undefined' ? opt.segments : 32;
51
+ var totalZRotationSteps = 2 + segments;
52
+ var totalYRotationSteps = 2 * totalZRotationSteps;
53
+ var indices = [];
54
+ var indicesArr = [];
55
+ var positions = [];
56
+ var positionsArr = [];
57
+ var normalArr = [];
58
+ var uvs = [];
59
+
60
+ for (var zRotationStep = 0; zRotationStep <= totalZRotationSteps; zRotationStep++) {
61
+ var normalizedZ = zRotationStep / totalZRotationSteps;
62
+ var angleZ = normalizedZ * Math.PI;
63
+
64
+ for (var yRotationStep = 0; yRotationStep <= totalYRotationSteps; yRotationStep++) {
65
+ var normalizedY = yRotationStep / totalYRotationSteps;
66
+ var angleY = normalizedY * Math.PI * 2;
67
+ mat4.identity(matRotZ);
68
+ mat4.rotateZ(matRotZ, matRotZ, -angleZ);
69
+ mat4.identity(matRotY);
70
+ mat4.rotateY(matRotY, matRotY, angleY);
71
+ vec3.transformMat4(tmpVec3, up, matRotZ);
72
+ vec3.transformMat4(tmpVec3, tmpVec3, matRotY);
73
+ vec3.scale(tmpVec3, tmpVec3, -radius);
74
+ positions.push(tmpVec3.slice());
75
+ positionsArr.push.apply(positionsArr, _toConsumableArray(tmpVec3.slice()));
76
+ vec3.normalize(tmpVec3, tmpVec3);
77
+ normalArr.push.apply(normalArr, _toConsumableArray(tmpVec3.slice()));
78
+ uvs.push([normalizedY, 1 - normalizedZ]); // position 和 uv 一起存储
79
+
80
+ positionsArr.push(normalizedY, 1 - normalizedZ);
81
+ }
82
+
83
+ if (zRotationStep > 0) {
84
+ var verticesCount = positions.length;
85
+ var firstIndex = verticesCount - 2 * (totalYRotationSteps + 1);
86
+
87
+ for (; firstIndex + totalYRotationSteps + 2 < verticesCount; firstIndex++) {
88
+ indices.push([firstIndex, firstIndex + 1, firstIndex + totalYRotationSteps + 1]);
89
+ indicesArr.push(firstIndex, firstIndex + 1, firstIndex + totalYRotationSteps + 1);
90
+ indices.push([firstIndex + totalYRotationSteps + 1, firstIndex + 1, firstIndex + totalYRotationSteps + 2]);
91
+ indicesArr.push(firstIndex + totalYRotationSteps + 1, firstIndex + 1, firstIndex + totalYRotationSteps + 2);
92
+ }
93
+ }
94
+ }
95
+
96
+ return {
97
+ cells: indices,
98
+ positions: positions,
99
+ uvs: uvs,
100
+ positionsArr: positionsArr,
101
+ indicesArr: indicesArr,
102
+ normalArr: normalArr
103
+ };
104
+ }
@@ -0,0 +1,21 @@
1
+ import { IAttrubuteAndElements } from '@antv/l7-core';
2
+ import BaseLayer from '../core/BaseLayer';
3
+ import { IHeatMapLayerStyleOptions } from '../core/interface';
4
+ import { HeatMapModelType } from './models';
5
+ export default class HeatMapLayer extends BaseLayer<IHeatMapLayerStyleOptions> {
6
+ type: string;
7
+ buildModels(): void;
8
+ rebuildModels(): void;
9
+ renderModels(): this;
10
+ updateModelData(data: IAttrubuteAndElements): void;
11
+ protected getConfigSchema(): {
12
+ properties: {
13
+ opacity: {
14
+ type: string;
15
+ minimum: number;
16
+ maximum: number;
17
+ };
18
+ };
19
+ };
20
+ protected getModelType(): HeatMapModelType;
21
+ }
@@ -0,0 +1,145 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+
13
+ import BaseLayer from "../core/BaseLayer";
14
+ import HeatMapModels from "./models";
15
+
16
+ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
17
+ _inherits(HeatMapLayer, _BaseLayer);
18
+
19
+ var _super = _createSuper(HeatMapLayer);
20
+
21
+ function HeatMapLayer() {
22
+ var _this;
23
+
24
+ _classCallCheck(this, HeatMapLayer);
25
+
26
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
+ args[_key] = arguments[_key];
28
+ }
29
+
30
+ _this = _super.call.apply(_super, [this].concat(args));
31
+
32
+ _defineProperty(_assertThisInitialized(_this), "type", 'HeatMapLayer');
33
+
34
+ return _this;
35
+ }
36
+
37
+ _createClass(HeatMapLayer, [{
38
+ key: "buildModels",
39
+ value: function buildModels() {
40
+ var _this2 = this;
41
+
42
+ var shape = this.getModelType();
43
+ this.layerModel = new HeatMapModels[shape](this);
44
+ this.layerModel.initModels(function (models) {
45
+ _this2.models = models;
46
+
47
+ _this2.renderLayers();
48
+ });
49
+ }
50
+ }, {
51
+ key: "rebuildModels",
52
+ value: function rebuildModels() {
53
+ var _this3 = this;
54
+
55
+ this.layerModel.buildModels(function (models) {
56
+ return _this3.models = models;
57
+ });
58
+ }
59
+ }, {
60
+ key: "renderModels",
61
+ value: function renderModels() {
62
+ var _this4 = this;
63
+
64
+ var shape = this.getModelType();
65
+
66
+ if (shape === 'heatmap') {
67
+ if (this.layerModel) {
68
+ this.layerModel.render(); // 独立的渲染流程
69
+ }
70
+
71
+ return this;
72
+ }
73
+
74
+ if (this.layerModelNeedUpdate) {
75
+ this.layerModel.buildModels(function (models) {
76
+ return _this4.models = models;
77
+ }); // @ts-ignore
78
+ // this.models = this.layerModel.buildModels();
79
+
80
+ this.layerModelNeedUpdate = false;
81
+ }
82
+
83
+ this.models.forEach(function (model) {
84
+ return model.draw({
85
+ uniforms: _this4.layerModel.getUninforms()
86
+ });
87
+ });
88
+ return this;
89
+ }
90
+ }, {
91
+ key: "updateModelData",
92
+ value: function updateModelData(data) {
93
+ if (data.attributes && data.elements) {
94
+ this.models[0].updateAttributesAndElements(data.attributes, data.elements);
95
+ } else {
96
+ console.warn('data error');
97
+ }
98
+ }
99
+ }, {
100
+ key: "getConfigSchema",
101
+ value: function getConfigSchema() {
102
+ return {
103
+ properties: {
104
+ opacity: {
105
+ type: 'number',
106
+ minimum: 0,
107
+ maximum: 1
108
+ }
109
+ }
110
+ };
111
+ }
112
+ }, {
113
+ key: "getModelType",
114
+ value: function getModelType() {
115
+ var _shapeAttribute$scale;
116
+
117
+ var shapeAttribute = this.styleAttributeService.getLayerStyleAttribute('shape');
118
+
119
+ var _this$getLayerConfig = this.getLayerConfig(),
120
+ shape3d = _this$getLayerConfig.shape3d;
121
+
122
+ var source = this.getSource();
123
+ var sourceType = source.data.type;
124
+ var shape = (shapeAttribute === null || shapeAttribute === void 0 ? void 0 : (_shapeAttribute$scale = shapeAttribute.scale) === null || _shapeAttribute$scale === void 0 ? void 0 : _shapeAttribute$scale.field) || 'heatmap';
125
+
126
+ if (shape === 'heatmap' || shape === 'heatmap3d') {
127
+ return 'heatmap';
128
+ }
129
+
130
+ if (sourceType === 'hexagon') {
131
+ return (shape3d === null || shape3d === void 0 ? void 0 : shape3d.indexOf(shape)) === -1 ? 'hexagon' : 'grid3d';
132
+ }
133
+
134
+ if (sourceType === 'grid') {
135
+ return (shape3d === null || shape3d === void 0 ? void 0 : shape3d.indexOf(shape)) === -1 ? 'grid' : 'grid3d';
136
+ }
137
+
138
+ return 'heatmap';
139
+ }
140
+ }]);
141
+
142
+ return HeatMapLayer;
143
+ }(BaseLayer);
144
+
145
+ export { HeatMapLayer as default };
@@ -0,0 +1,8 @@
1
+ import { IModel, IModelUniform } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ export default class GridModel extends BaseModel {
4
+ getUninforms(): IModelUniform;
5
+ initModels(callbackModel: (models: IModel[]) => void): void;
6
+ buildModels(callbackModel: (models: IModel[]) => void): void;
7
+ protected registerBuiltinAttributes(): void;
8
+ }
@@ -0,0 +1,108 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+
11
+ import { AttributeType, gl } from '@antv/l7-core';
12
+ import { getMask } from '@antv/l7-utils';
13
+ import BaseModel from "../../core/BaseModel";
14
+ import { HeatmapGridTriangulation } from "../../core/triangulation";
15
+
16
+ /* babel-plugin-inline-import '../shaders/grid_vert.glsl' */
17
+ var heatmapGridVert = "precision highp float;\r\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\r\nattribute vec3 a_Position;\r\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\r\nattribute vec3 a_Pos;\r\nattribute float a_Size;\r\nattribute vec4 a_Color;\r\nuniform vec2 u_radius;\r\nuniform float u_coverage: 0.9;\r\nuniform float u_angle: 0;\r\nuniform mat4 u_ModelMatrix;\r\nuniform mat4 u_Mvp;\r\nvarying vec4 v_color;\r\n\r\nuniform vec2 u_SceneCenterMKT;\r\n\r\n#pragma include \"projection\"\r\n#pragma include \"project\"\r\n#pragma include \"picking\"\r\n\r\nvoid main() {\r\n v_color = a_Color;\r\n\r\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r\n vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r\n // vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n // gl_Position = project_common_position_to_clipspace(project_pos);\r\n\r\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec2 customLnglat = customProject(lnglat) - u_SceneCenterMKT; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\r\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r\n gl_Position = u_Mvp * (project_pos);\r\n } else {\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n gl_Position = project_common_position_to_clipspace(project_pos);\r\n }\r\n\r\n setPickingColor(a_PickingColor);\r\n}\r\n";
18
+
19
+ /* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
20
+ var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
21
+
22
+ var GridModel = /*#__PURE__*/function (_BaseModel) {
23
+ _inherits(GridModel, _BaseModel);
24
+
25
+ var _super = _createSuper(GridModel);
26
+
27
+ function GridModel() {
28
+ _classCallCheck(this, GridModel);
29
+
30
+ return _super.apply(this, arguments);
31
+ }
32
+
33
+ _createClass(GridModel, [{
34
+ key: "getUninforms",
35
+ value: function getUninforms() {
36
+ var _ref = this.layer.getLayerConfig(),
37
+ opacity = _ref.opacity,
38
+ coverage = _ref.coverage,
39
+ angle = _ref.angle;
40
+
41
+ return {
42
+ u_opacity: opacity || 1.0,
43
+ u_coverage: coverage || 0.9,
44
+ u_angle: angle || 0,
45
+ u_radius: [this.layer.getSource().data.xOffset, this.layer.getSource().data.yOffset]
46
+ };
47
+ }
48
+ }, {
49
+ key: "initModels",
50
+ value: function initModels(callbackModel) {
51
+ this.buildModels(callbackModel);
52
+ }
53
+ }, {
54
+ key: "buildModels",
55
+ value: function buildModels(callbackModel) {
56
+ var _ref2 = this.layer.getLayerConfig(),
57
+ _ref2$mask = _ref2.mask,
58
+ mask = _ref2$mask === void 0 ? false : _ref2$mask,
59
+ _ref2$maskInside = _ref2.maskInside,
60
+ maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
61
+
62
+ this.layer.buildLayerModel({
63
+ moduleName: 'heatmapGrid',
64
+ vertexShader: heatmapGridVert,
65
+ fragmentShader: heatmapGridFrag,
66
+ triangulation: HeatmapGridTriangulation,
67
+ primitive: gl.TRIANGLES,
68
+ depth: {
69
+ enable: false
70
+ },
71
+ stencil: getMask(mask, maskInside)
72
+ }).then(function (model) {
73
+ callbackModel([model]);
74
+ }).catch(function (err) {
75
+ console.warn(err);
76
+ callbackModel([]);
77
+ });
78
+ }
79
+ }, {
80
+ key: "registerBuiltinAttributes",
81
+ value: function registerBuiltinAttributes() {
82
+ this.styleAttributeService.registerStyleAttribute({
83
+ name: 'pos',
84
+ // 顶点经纬度位置
85
+ type: AttributeType.Attribute,
86
+ descriptor: {
87
+ name: 'a_Pos',
88
+ buffer: {
89
+ // give the WebGL driver a hint that this buffer may change
90
+ usage: gl.DYNAMIC_DRAW,
91
+ data: [],
92
+ type: gl.FLOAT
93
+ },
94
+ size: 3,
95
+ update: function update(feature, featureIdx) {
96
+ // const coordinates = feature.coordinates as number[];
97
+ var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
98
+ return [coordinates[0], coordinates[1], 0];
99
+ }
100
+ }
101
+ });
102
+ }
103
+ }]);
104
+
105
+ return GridModel;
106
+ }(BaseModel);
107
+
108
+ export { GridModel as default };
@@ -0,0 +1,8 @@
1
+ import { IModel, IModelUniform } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ export default class Grid3DModel extends BaseModel {
4
+ getUninforms(): IModelUniform;
5
+ initModels(callbackModel: (models: IModel[]) => void): void;
6
+ buildModels(callbackModel: (models: IModel[]) => void): void;
7
+ protected registerBuiltinAttributes(): void;
8
+ }
@@ -0,0 +1,147 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+
11
+ import { AttributeType, gl } from '@antv/l7-core';
12
+ import { getMask } from '@antv/l7-utils';
13
+ import BaseModel from "../../core/BaseModel";
14
+ import { PointExtrudeTriangulation } from "../../core/triangulation";
15
+
16
+ /* babel-plugin-inline-import '../shaders/hexagon_3d_vert.glsl' */
17
+ var heatmapGrid3dVert = "precision highp float;\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\nattribute vec3 a_Position;\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\nattribute vec3 a_Pos;\n\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform vec2 u_SceneCenterMKT;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n // vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6\n // vec2 lnglat = (a_Pos.xy + offset); \n // vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n // gl_Position = project_common_position_to_clipspace(project_pos);\n // float lightWeight = calc_lighting(project_pos);\n // v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // vec2 lnglat = (a_Pos.xy + offset); \n // vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n\n // float lightWeight = calc_lighting(project_pos);\n // v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n // gl_Position = u_Mvp * vec4(lnglat , a_Position.z * a_Size, 1.0);\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u7ECF\u7EAC\u5EA6\n vec2 customLnglat = customProject(lnglat) - u_SceneCenterMKT; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\n vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0));\n\n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0);\n } else {\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6\n vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n \n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = project_common_position_to_clipspace(project_pos);\n }\n\n\n\n setPickingColor(a_PickingColor);\n}\n";
18
+
19
+ /* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
20
+ var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
21
+
22
+ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
23
+ _inherits(Grid3DModel, _BaseModel);
24
+
25
+ var _super = _createSuper(Grid3DModel);
26
+
27
+ function Grid3DModel() {
28
+ _classCallCheck(this, Grid3DModel);
29
+
30
+ return _super.apply(this, arguments);
31
+ }
32
+
33
+ _createClass(Grid3DModel, [{
34
+ key: "getUninforms",
35
+ value: function getUninforms() {
36
+ var _ref = this.layer.getLayerConfig(),
37
+ opacity = _ref.opacity,
38
+ coverage = _ref.coverage,
39
+ angle = _ref.angle;
40
+
41
+ return {
42
+ u_opacity: opacity || 1.0,
43
+ u_coverage: coverage || 1.0,
44
+ u_angle: angle || 0,
45
+ u_radius: [this.layer.getSource().data.xOffset, this.layer.getSource().data.yOffset]
46
+ };
47
+ }
48
+ }, {
49
+ key: "initModels",
50
+ value: function initModels(callbackModel) {
51
+ this.buildModels(callbackModel);
52
+ }
53
+ }, {
54
+ key: "buildModels",
55
+ value: function buildModels(callbackModel) {
56
+ var _ref2 = this.layer.getLayerConfig(),
57
+ _ref2$mask = _ref2.mask,
58
+ mask = _ref2$mask === void 0 ? false : _ref2$mask,
59
+ _ref2$maskInside = _ref2.maskInside,
60
+ maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside;
61
+
62
+ this.layer.buildLayerModel({
63
+ moduleName: 'heatmapGrid3d',
64
+ vertexShader: heatmapGrid3dVert,
65
+ fragmentShader: heatmapGridFrag,
66
+ triangulation: PointExtrudeTriangulation,
67
+ primitive: gl.TRIANGLES,
68
+ depth: {
69
+ enable: true
70
+ },
71
+ blend: this.getBlend(),
72
+ stencil: getMask(mask, maskInside)
73
+ }).then(function (model) {
74
+ callbackModel([model]);
75
+ }).catch(function (err) {
76
+ console.warn(err);
77
+ callbackModel([]);
78
+ });
79
+ }
80
+ }, {
81
+ key: "registerBuiltinAttributes",
82
+ value: function registerBuiltinAttributes() {
83
+ // point layer size;
84
+ this.styleAttributeService.registerStyleAttribute({
85
+ name: 'size',
86
+ type: AttributeType.Attribute,
87
+ descriptor: {
88
+ name: 'a_Size',
89
+ buffer: {
90
+ // give the WebGL driver a hint that this buffer may change
91
+ usage: gl.DYNAMIC_DRAW,
92
+ data: [],
93
+ type: gl.FLOAT
94
+ },
95
+ size: 1,
96
+ update: function update(feature, featureIdx, vertex, attributeIdx) {
97
+ var size = feature.size;
98
+ return Array.isArray(size) ? [size[0]] : [size];
99
+ }
100
+ }
101
+ }); // point layer size;
102
+
103
+ this.styleAttributeService.registerStyleAttribute({
104
+ name: 'normal',
105
+ type: AttributeType.Attribute,
106
+ descriptor: {
107
+ name: 'a_Normal',
108
+ buffer: {
109
+ // give the WebGL driver a hint that this buffer may change
110
+ usage: gl.STATIC_DRAW,
111
+ data: [],
112
+ type: gl.FLOAT
113
+ },
114
+ size: 3,
115
+ update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
116
+ return normal;
117
+ }
118
+ }
119
+ });
120
+ this.styleAttributeService.registerStyleAttribute({
121
+ name: 'pos',
122
+ // 顶点经纬度位置
123
+ type: AttributeType.Attribute,
124
+ descriptor: {
125
+ name: 'a_Pos',
126
+ buffer: {
127
+ // give the WebGL driver a hint that this buffer may change
128
+ usage: gl.DYNAMIC_DRAW,
129
+ data: [],
130
+ type: gl.FLOAT
131
+ },
132
+ size: 3,
133
+ update: function update(feature, featureIdx) {
134
+ var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates; // const coordinates = feature.coordinates as number[];
135
+ // const coordinates = feature.originCoordinates as number[];
136
+
137
+ return [coordinates[0], coordinates[1], 0];
138
+ }
139
+ }
140
+ });
141
+ }
142
+ }]);
143
+
144
+ return Grid3DModel;
145
+ }(BaseModel);
146
+
147
+ export { Grid3DModel as default };
@@ -0,0 +1,24 @@
1
+ import { IFramebuffer, IModel, IModelUniform, ITexture2D } from '@antv/l7-core';
2
+ import 'reflect-metadata';
3
+ import BaseModel from '../../core/BaseModel';
4
+ export default class HeatMapModel extends BaseModel {
5
+ protected texture: ITexture2D;
6
+ protected colorTexture: ITexture2D;
7
+ protected heatmapFramerBuffer: IFramebuffer;
8
+ private intensityModel;
9
+ private colorModel;
10
+ private shapeType;
11
+ render(): void;
12
+ getUninforms(): IModelUniform;
13
+ initModels(callbackModel: (models: IModel[]) => void): Promise<void>;
14
+ buildModels(callbackModel: (models: IModel[]) => void): void;
15
+ protected registerBuiltinAttributes(): void;
16
+ private buildHeatMapIntensity;
17
+ private buildHeatmapColor;
18
+ private drawIntensityMode;
19
+ private drawColorMode;
20
+ private draw3DHeatMap;
21
+ private build3dHeatMap;
22
+ private updateStyle;
23
+ private updateColorTexture;
24
+ }