@antv/l7-layers 2.9.32-alpha.3 → 2.9.32-alpha.5

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 (633) hide show
  1. package/es/Geometry/index.d.ts +32 -0
  2. package/es/Geometry/index.js +118 -0
  3. package/es/Geometry/models/billboard.d.ts +26 -0
  4. package/es/Geometry/models/billboard.js +228 -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 +419 -0
  9. package/es/Geometry/models/sprite.d.ts +47 -0
  10. package/es/Geometry/models/sprite.js +301 -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 +23 -0
  18. package/es/canvas/index.js +121 -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 +86 -0
  25. package/es/citybuliding/models/build.d.ts +22 -0
  26. package/es/citybuliding/models/build.js +187 -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 +225 -0
  30. package/es/core/BaseLayer.js +1432 -0
  31. package/es/core/BaseModel.d.ts +140 -0
  32. package/es/core/BaseModel.js +489 -0
  33. package/es/core/interface.d.ts +225 -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 +128 -0
  42. package/es/core/triangulation.js +553 -0
  43. package/es/earth/index.d.ts +22 -0
  44. package/es/earth/index.js +98 -0
  45. package/es/earth/models/atmosphere.d.ts +9 -0
  46. package/es/earth/models/atmosphere.js +135 -0
  47. package/es/earth/models/base.d.ts +16 -0
  48. package/es/earth/models/base.js +206 -0
  49. package/es/earth/models/bloomsphere.d.ts +9 -0
  50. package/es/earth/models/bloomsphere.js +134 -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/glsl.d.ts +5 -0
  60. package/es/heatmap/index.d.ts +21 -0
  61. package/es/heatmap/index.js +141 -0
  62. package/es/heatmap/models/grid.d.ts +8 -0
  63. package/es/heatmap/models/grid.js +106 -0
  64. package/es/heatmap/models/grid3d.d.ts +8 -0
  65. package/es/heatmap/models/grid3d.js +140 -0
  66. package/es/heatmap/models/heatmap.d.ts +24 -0
  67. package/es/heatmap/models/heatmap.js +463 -0
  68. package/es/heatmap/models/hexagon.d.ts +8 -0
  69. package/es/heatmap/models/hexagon.js +107 -0
  70. package/es/heatmap/models/index.d.ts +5 -0
  71. package/es/heatmap/models/index.js +12 -0
  72. package/es/heatmap/shaders/grid_vert.glsl +42 -0
  73. package/es/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
  74. package/es/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
  75. package/es/heatmap/shaders/heatmap_frag.glsl +47 -0
  76. package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
  77. package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
  78. package/es/heatmap/shaders/heatmap_vert.glsl +10 -0
  79. package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  80. package/es/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
  81. package/es/heatmap/shaders/hexagon_frag.glsl +12 -0
  82. package/es/heatmap/shaders/hexagon_vert.glsl +41 -0
  83. package/es/heatmap/triangulation.d.ts +5 -0
  84. package/es/heatmap/triangulation.js +37 -0
  85. package/es/image/index.d.ts +19 -0
  86. package/es/image/index.js +104 -0
  87. package/es/image/models/dataImage.d.ts +22 -0
  88. package/es/image/models/dataImage.js +200 -0
  89. package/es/image/models/image.d.ts +19 -0
  90. package/es/image/models/image.js +164 -0
  91. package/es/image/models/index.d.ts +5 -0
  92. package/es/image/models/index.js +9 -0
  93. package/es/image/models/tileDataImage.d.ts +19 -0
  94. package/es/image/models/tileDataImage.js +174 -0
  95. package/es/image/shaders/dataImage_frag.glsl +38 -0
  96. package/es/image/shaders/image_frag.glsl +9 -0
  97. package/es/image/shaders/image_vert.glsl +17 -0
  98. package/es/index.d.ts +17 -0
  99. package/es/index.js +107 -0
  100. package/es/line/index.d.ts +43 -0
  101. package/es/line/index.js +140 -0
  102. package/es/line/models/arc.d.ts +17 -0
  103. package/es/line/models/arc.js +356 -0
  104. package/es/line/models/arc_3d.d.ts +17 -0
  105. package/es/line/models/arc_3d.js +333 -0
  106. package/es/line/models/earthArc_3d.d.ts +17 -0
  107. package/es/line/models/earthArc_3d.js +336 -0
  108. package/es/line/models/great_circle.d.ts +12 -0
  109. package/es/line/models/great_circle.js +294 -0
  110. package/es/line/models/half.d.ts +18 -0
  111. package/es/line/models/half.js +281 -0
  112. package/es/line/models/index.d.ts +5 -0
  113. package/es/line/models/index.js +25 -0
  114. package/es/line/models/line.d.ts +21 -0
  115. package/es/line/models/line.js +443 -0
  116. package/es/line/models/linearline.d.ts +11 -0
  117. package/es/line/models/linearline.js +275 -0
  118. package/es/line/models/simpleLine.d.ts +14 -0
  119. package/es/line/models/simpleLine.js +234 -0
  120. package/es/line/models/simpleTileLine.d.ts +9 -0
  121. package/es/line/models/simpleTileLine.js +100 -0
  122. package/es/line/models/tile.d.ts +8 -0
  123. package/es/line/models/tile.js +178 -0
  124. package/es/line/models/wall.d.ts +12 -0
  125. package/es/line/models/wall.js +293 -0
  126. package/es/line/shaders/arc_chunks.vert.glsl +21 -0
  127. package/es/line/shaders/dash/arc_dash_frag.glsl +28 -0
  128. package/es/line/shaders/dash/arc_dash_vert.glsl +150 -0
  129. package/es/line/shaders/dash/line_dash_frag.glsl +31 -0
  130. package/es/line/shaders/dash/line_dash_vert.glsl +93 -0
  131. package/es/line/shaders/half/line_half_frag.glsl +53 -0
  132. package/es/line/shaders/half/line_half_vert.glsl +169 -0
  133. package/es/line/shaders/line_arc2d_vert.glsl +114 -0
  134. package/es/line/shaders/line_arc_3d_frag.glsl +103 -0
  135. package/es/line/shaders/line_arc_3d_vert.glsl +206 -0
  136. package/es/line/shaders/line_arc_frag.glsl +88 -0
  137. package/es/line/shaders/line_arc_great_circle_frag.glsl +101 -0
  138. package/es/line/shaders/line_arc_great_circle_vert.glsl +214 -0
  139. package/es/line/shaders/line_arc_vert.glsl +178 -0
  140. package/es/line/shaders/line_bezier_vert.glsl +85 -0
  141. package/es/line/shaders/line_frag.glsl +99 -0
  142. package/es/line/shaders/line_vert.glsl +192 -0
  143. package/es/line/shaders/linear/arc3d_linear_frag.glsl +46 -0
  144. package/es/line/shaders/linear/arc3d_linear_vert.glsl +206 -0
  145. package/es/line/shaders/linear/arc_linear_frag.glsl +38 -0
  146. package/es/line/shaders/linear/arc_linear_vert.glsl +138 -0
  147. package/es/line/shaders/linear/line_linear_frag.glsl +27 -0
  148. package/es/line/shaders/linearLine/line_linear_frag.glsl +20 -0
  149. package/es/line/shaders/linearLine/line_linear_vert.glsl +112 -0
  150. package/es/line/shaders/simple/simpleline_frag.glsl +10 -0
  151. package/es/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
  152. package/es/line/shaders/simple/simpleline_vert.glsl +79 -0
  153. package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  154. package/es/line/shaders/tile/line_tile_vert.glsl +52 -0
  155. package/es/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  156. package/es/line/shaders/tile/simpleline_vert.glsl +21 -0
  157. package/es/line/shaders/wall/wall_frag.glsl +89 -0
  158. package/es/line/shaders/wall/wall_vert.glsl +77 -0
  159. package/es/mask/index.d.ts +27 -0
  160. package/es/mask/index.js +160 -0
  161. package/es/mask/models/fill.d.ts +12 -0
  162. package/es/mask/models/fill.js +124 -0
  163. package/es/mask/models/index.d.ts +5 -0
  164. package/es/mask/models/index.js +7 -0
  165. package/es/mask/shaders/mask_vert.glsl +16 -0
  166. package/es/plugins/DataMappingPlugin.d.ts +18 -0
  167. package/es/plugins/DataMappingPlugin.js +413 -0
  168. package/es/plugins/DataSourcePlugin.d.ts +7 -0
  169. package/es/plugins/DataSourcePlugin.js +84 -0
  170. package/es/plugins/FeatureScalePlugin.d.ts +24 -0
  171. package/es/plugins/FeatureScalePlugin.js +340 -0
  172. package/es/plugins/LayerAnimateStylePlugin.d.ts +5 -0
  173. package/es/plugins/LayerAnimateStylePlugin.js +29 -0
  174. package/es/plugins/LayerModelPlugin.d.ts +10 -0
  175. package/es/plugins/LayerModelPlugin.js +72 -0
  176. package/es/plugins/LayerStylePlugin.d.ts +8 -0
  177. package/es/plugins/LayerStylePlugin.js +39 -0
  178. package/es/plugins/LightingPlugin.d.ts +36 -0
  179. package/es/plugins/LightingPlugin.js +104 -0
  180. package/es/plugins/MultiPassRendererPlugin.d.ts +23 -0
  181. package/es/plugins/MultiPassRendererPlugin.js +65 -0
  182. package/es/plugins/PixelPickingPlugin.d.ts +8 -0
  183. package/es/plugins/PixelPickingPlugin.js +126 -0
  184. package/es/plugins/RegisterStyleAttributePlugin.d.ts +15 -0
  185. package/es/plugins/RegisterStyleAttributePlugin.js +156 -0
  186. package/es/plugins/ShaderUniformPlugin.d.ts +21 -0
  187. package/es/plugins/ShaderUniformPlugin.js +106 -0
  188. package/es/plugins/UpdateModelPlugin.d.ts +8 -0
  189. package/es/plugins/UpdateModelPlugin.js +31 -0
  190. package/es/plugins/UpdateStyleAttributePlugin.d.ts +12 -0
  191. package/es/plugins/UpdateStyleAttributePlugin.js +83 -0
  192. package/es/point/index.d.ts +40 -0
  193. package/es/point/index.js +229 -0
  194. package/es/point/models/earthExtrude.d.ts +24 -0
  195. package/es/point/models/earthExtrude.js +274 -0
  196. package/es/point/models/earthFill.d.ts +11 -0
  197. package/es/point/models/earthFill.js +258 -0
  198. package/es/point/models/extrude.d.ts +24 -0
  199. package/es/point/models/extrude.js +295 -0
  200. package/es/point/models/fill.d.ts +40 -0
  201. package/es/point/models/fill.js +403 -0
  202. package/es/point/models/fillmage.d.ts +25 -0
  203. package/es/point/models/fillmage.js +366 -0
  204. package/es/point/models/image.d.ts +11 -0
  205. package/es/point/models/image.js +239 -0
  206. package/es/point/models/index.d.ts +5 -0
  207. package/es/point/models/index.js +30 -0
  208. package/es/point/models/normal.d.ts +16 -0
  209. package/es/point/models/normal.js +124 -0
  210. package/es/point/models/radar.d.ts +24 -0
  211. package/es/point/models/radar.js +232 -0
  212. package/es/point/models/simplePoint.d.ts +16 -0
  213. package/es/point/models/simplePoint.js +179 -0
  214. package/es/point/models/text.d.ts +57 -0
  215. package/es/point/models/text.js +619 -0
  216. package/es/point/models/tile.d.ts +15 -0
  217. package/es/point/models/tile.js +175 -0
  218. package/es/point/models/tileText.d.ts +52 -0
  219. package/es/point/models/tileText.js +509 -0
  220. package/es/point/shaders/animate/wave_frag.glsl +65 -0
  221. package/es/point/shaders/earth/extrude_frag.glsl +44 -0
  222. package/es/point/shaders/earth/extrude_vert.glsl +140 -0
  223. package/es/point/shaders/earth/fill_frag.glsl +86 -0
  224. package/es/point/shaders/earth/fill_vert.glsl +125 -0
  225. package/es/point/shaders/extrude/extrude_frag.glsl +44 -0
  226. package/es/point/shaders/extrude/extrude_vert.glsl +121 -0
  227. package/es/point/shaders/fill_frag.glsl +84 -0
  228. package/es/point/shaders/fill_vert.glsl +188 -0
  229. package/es/point/shaders/image/fillImage_frag.glsl +20 -0
  230. package/es/point/shaders/image/fillImage_vert.glsl +116 -0
  231. package/es/point/shaders/image_frag.glsl +39 -0
  232. package/es/point/shaders/image_vert.glsl +90 -0
  233. package/es/point/shaders/normal_frag.glsl +6 -0
  234. package/es/point/shaders/normal_vert.glsl +24 -0
  235. package/es/point/shaders/radar/radar_frag.glsl +53 -0
  236. package/es/point/shaders/radar/radar_vert.glsl +70 -0
  237. package/es/point/shaders/simplePoint_frag.glsl +53 -0
  238. package/es/point/shaders/simplePoint_vert.glsl +79 -0
  239. package/es/point/shaders/text_frag.glsl +48 -0
  240. package/es/point/shaders/text_vert.glsl +131 -0
  241. package/es/point/shaders/tile/fill_tile_frag.glsl +76 -0
  242. package/es/point/shaders/tile/fill_tile_vert.glsl +78 -0
  243. package/es/point/shaders/tile/text_frag.glsl +33 -0
  244. package/es/point/shaders/tile/text_map_frag.glsl +31 -0
  245. package/es/point/shaders/tile/text_map_vert.glsl +38 -0
  246. package/es/point/shaders/tile/text_vert.glsl +48 -0
  247. package/es/point/shape/extrude.d.ts +15 -0
  248. package/es/point/shape/extrude.js +63 -0
  249. package/es/polygon/index.d.ts +27 -0
  250. package/es/polygon/index.js +146 -0
  251. package/es/polygon/models/extrude.d.ts +28 -0
  252. package/es/polygon/models/extrude.js +302 -0
  253. package/es/polygon/models/fill.d.ts +17 -0
  254. package/es/polygon/models/fill.js +210 -0
  255. package/es/polygon/models/index.d.ts +5 -0
  256. package/es/polygon/models/index.js +28 -0
  257. package/es/polygon/models/ocean.d.ts +21 -0
  258. package/es/polygon/models/ocean.js +202 -0
  259. package/es/polygon/models/tile.d.ts +12 -0
  260. package/es/polygon/models/tile.js +101 -0
  261. package/es/polygon/models/water.d.ts +16 -0
  262. package/es/polygon/models/water.js +179 -0
  263. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
  264. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
  265. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
  266. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
  267. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
  268. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
  269. package/es/polygon/shaders/polygon_frag.glsl +12 -0
  270. package/es/polygon/shaders/polygon_linear_frag.glsl +22 -0
  271. package/es/polygon/shaders/polygon_linear_vert.glsl +74 -0
  272. package/es/polygon/shaders/polygon_vert.glsl +66 -0
  273. package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  274. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +42 -0
  275. package/es/polygon/shaders/water/polygon_ocean_frag.glsl +247 -0
  276. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +21 -0
  277. package/es/polygon/shaders/water/polygon_water_frag.glsl +71 -0
  278. package/es/polygon/shaders/water/polygon_water_vert.glsl +26 -0
  279. package/es/raster/buffers/triangulation.d.ts +6 -0
  280. package/es/raster/buffers/triangulation.js +25 -0
  281. package/es/raster/index.d.ts +19 -0
  282. package/es/raster/index.js +107 -0
  283. package/es/raster/models/index.d.ts +5 -0
  284. package/es/raster/models/index.js +10 -0
  285. package/es/raster/models/raster.d.ts +22 -0
  286. package/es/raster/models/raster.js +242 -0
  287. package/es/raster/models/rasterRgb.d.ts +20 -0
  288. package/es/raster/models/rasterRgb.js +226 -0
  289. package/es/raster/models/rasterTile.d.ts +18 -0
  290. package/es/raster/models/rasterTile.js +140 -0
  291. package/es/raster/raster.d.ts +30 -0
  292. package/es/raster/raster.js +174 -0
  293. package/es/raster/shaders/raster_2d_frag.glsl +64 -0
  294. package/es/raster/shaders/raster_2d_vert.glsl +17 -0
  295. package/es/raster/shaders/raster_frag.glsl +9 -0
  296. package/es/raster/shaders/raster_rgb_frag.glsl +12 -0
  297. package/es/raster/shaders/raster_vert.glsl +44 -0
  298. package/es/shader/minify_frag.glsl +7 -0
  299. package/es/shader/minify_picking_frag.glsl +10 -0
  300. package/es/tile/interface.d.ts +29 -0
  301. package/es/tile/interface.js +1 -0
  302. package/es/tile/manager/baseMapTileLayerManager.d.ts +7 -0
  303. package/es/tile/manager/baseMapTileLayerManager.js +119 -0
  304. package/es/tile/manager/baseTileManager.d.ts +27 -0
  305. package/es/tile/manager/baseTileManager.js +107 -0
  306. package/es/tile/manager/tileConfigManager.d.ts +17 -0
  307. package/es/tile/manager/tileConfigManager.js +121 -0
  308. package/es/tile/manager/tileLayerManager.d.ts +15 -0
  309. package/es/tile/manager/tileLayerManager.js +255 -0
  310. package/es/tile/manager/tilePickerManager.d.ts +21 -0
  311. package/es/tile/manager/tilePickerManager.js +194 -0
  312. package/es/tile/models/tileModel.d.ts +10 -0
  313. package/es/tile/models/tileModel.js +81 -0
  314. package/es/tile/tileFactory/base.d.ts +44 -0
  315. package/es/tile/tileFactory/base.js +474 -0
  316. package/es/tile/tileFactory/index.d.ts +5 -0
  317. package/es/tile/tileFactory/index.js +38 -0
  318. package/es/tile/tileFactory/line.d.ts +12 -0
  319. package/es/tile/tileFactory/line.js +62 -0
  320. package/es/tile/tileFactory/mask.d.ts +12 -0
  321. package/es/tile/tileFactory/mask.js +63 -0
  322. package/es/tile/tileFactory/point.d.ts +12 -0
  323. package/es/tile/tileFactory/point.js +63 -0
  324. package/es/tile/tileFactory/polygon.d.ts +12 -0
  325. package/es/tile/tileFactory/polygon.js +62 -0
  326. package/es/tile/tileFactory/raster.d.ts +12 -0
  327. package/es/tile/tileFactory/raster.js +58 -0
  328. package/es/tile/tileFactory/rasterData.d.ts +12 -0
  329. package/es/tile/tileFactory/rasterData.js +86 -0
  330. package/es/tile/tileFactory/rasterDataLayer.d.ts +20 -0
  331. package/es/tile/tileFactory/rasterDataLayer.js +90 -0
  332. package/es/tile/tileFactory/test.d.ts +12 -0
  333. package/es/tile/tileFactory/test.js +105 -0
  334. package/es/tile/tileFactory/vectorLayer.d.ts +38 -0
  335. package/es/tile/tileFactory/vectorLayer.js +264 -0
  336. package/es/tile/tileLayer/baseMapTileLayer.d.ts +30 -0
  337. package/es/tile/tileLayer/baseMapTileLayer.js +195 -0
  338. package/es/tile/tileLayer/baseTileLayer.d.ts +48 -0
  339. package/es/tile/tileLayer/baseTileLayer.js +420 -0
  340. package/es/tile/tileTest.d.ts +15 -0
  341. package/es/tile/tileTest.js +62 -0
  342. package/es/tile/tmsMapTileLayer.d.ts +7 -0
  343. package/es/tile/tmsMapTileLayer.js +97 -0
  344. package/es/tile/tmsTileLayer.d.ts +7 -0
  345. package/es/tile/tmsTileLayer.js +101 -0
  346. package/es/tile/utils.d.ts +19 -0
  347. package/es/tile/utils.js +209 -0
  348. package/es/utils/blend.d.ts +2 -0
  349. package/es/utils/blend.js +54 -0
  350. package/es/utils/collision-index.d.ts +47 -0
  351. package/es/utils/collision-index.js +102 -0
  352. package/es/utils/dataMappingStyle.d.ts +31 -0
  353. package/es/utils/dataMappingStyle.js +150 -0
  354. package/es/utils/extrude_polyline.d.ts +67 -0
  355. package/es/utils/extrude_polyline.js +611 -0
  356. package/es/utils/grid-index.d.ts +28 -0
  357. package/es/utils/grid-index.js +179 -0
  358. package/es/utils/layerData.d.ts +2 -0
  359. package/es/utils/layerData.js +179 -0
  360. package/es/utils/multiPassRender.d.ts +16 -0
  361. package/es/utils/multiPassRender.js +50 -0
  362. package/es/utils/polylineNormal.d.ts +9 -0
  363. package/es/utils/polylineNormal.js +191 -0
  364. package/es/utils/simpleLine.d.ts +23 -0
  365. package/es/utils/simpleLine.js +103 -0
  366. package/es/utils/symbol-layout.d.ts +43 -0
  367. package/es/utils/symbol-layout.js +299 -0
  368. package/es/utils/updateShape.d.ts +2 -0
  369. package/es/utils/updateShape.js +20 -0
  370. package/es/wind/index.d.ts +20 -0
  371. package/es/wind/index.js +98 -0
  372. package/es/wind/models/index.d.ts +5 -0
  373. package/es/wind/models/index.js +5 -0
  374. package/es/wind/models/utils.d.ts +19 -0
  375. package/es/wind/models/utils.js +226 -0
  376. package/es/wind/models/wind.d.ts +33 -0
  377. package/es/wind/models/wind.js +331 -0
  378. package/es/wind/models/windRender.d.ts +104 -0
  379. package/es/wind/models/windRender.js +357 -0
  380. package/es/wind/models/windShader.d.ts +12 -0
  381. package/es/wind/models/windShader.js +12 -0
  382. package/es/wind/shaders/wind_frag.glsl +9 -0
  383. package/es/wind/shaders/wind_vert.glsl +17 -0
  384. package/lib/Geometry/index.js +130 -0
  385. package/lib/Geometry/models/billboard.js +242 -0
  386. package/lib/Geometry/models/index.js +22 -0
  387. package/lib/Geometry/models/plane.js +434 -0
  388. package/lib/Geometry/models/sprite.js +315 -0
  389. package/lib/Geometry/shaders/billboard_frag.glsl +13 -0
  390. package/lib/Geometry/shaders/billboard_vert.glsl +50 -0
  391. package/lib/Geometry/shaders/plane_frag.glsl +22 -0
  392. package/lib/Geometry/shaders/plane_vert.glsl +53 -0
  393. package/lib/Geometry/shaders/sprite_frag.glsl +21 -0
  394. package/lib/Geometry/shaders/sprite_vert.glsl +28 -0
  395. package/lib/canvas/index.js +133 -0
  396. package/lib/canvas/models/canvas.js +221 -0
  397. package/lib/canvas/models/index.js +16 -0
  398. package/lib/citybuliding/building.js +99 -0
  399. package/lib/citybuliding/models/build.js +202 -0
  400. package/lib/citybuliding/shaders/build_frag.glsl +117 -0
  401. package/lib/citybuliding/shaders/build_vert.glsl +54 -0
  402. package/lib/core/BaseLayer.js +1427 -0
  403. package/lib/core/BaseModel.js +506 -0
  404. package/lib/core/interface.js +41 -0
  405. package/lib/core/schema.js +33 -0
  406. package/lib/core/shape/Path.js +88 -0
  407. package/lib/core/shape/extrude.js +180 -0
  408. package/lib/core/triangulation.js +619 -0
  409. package/lib/earth/index.js +113 -0
  410. package/lib/earth/models/atmosphere.js +149 -0
  411. package/lib/earth/models/base.js +216 -0
  412. package/lib/earth/models/bloomsphere.js +148 -0
  413. package/lib/earth/shaders/atmosphere_frag.glsl +17 -0
  414. package/lib/earth/shaders/atmosphere_vert.glsl +26 -0
  415. package/lib/earth/shaders/base_frag.glsl +13 -0
  416. package/lib/earth/shaders/base_vert.glsl +52 -0
  417. package/lib/earth/shaders/bloomsphere_frag.glsl +15 -0
  418. package/lib/earth/shaders/bloomsphere_vert.glsl +20 -0
  419. package/lib/earth/utils.js +136 -0
  420. package/lib/glsl.d.ts +5 -0
  421. package/lib/heatmap/index.js +154 -0
  422. package/lib/heatmap/models/grid.js +120 -0
  423. package/lib/heatmap/models/grid3d.js +154 -0
  424. package/lib/heatmap/models/heatmap.js +486 -0
  425. package/lib/heatmap/models/hexagon.js +121 -0
  426. package/lib/heatmap/models/index.js +26 -0
  427. package/lib/heatmap/shaders/grid_vert.glsl +42 -0
  428. package/lib/heatmap/shaders/heatmap_3d_frag.glsl +14 -0
  429. package/lib/heatmap/shaders/heatmap_3d_vert.glsl +46 -0
  430. package/lib/heatmap/shaders/heatmap_frag.glsl +47 -0
  431. package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +10 -0
  432. package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +35 -0
  433. package/lib/heatmap/shaders/heatmap_vert.glsl +10 -0
  434. package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  435. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +64 -0
  436. package/lib/heatmap/shaders/hexagon_frag.glsl +12 -0
  437. package/lib/heatmap/shaders/hexagon_vert.glsl +41 -0
  438. package/lib/heatmap/triangulation.js +44 -0
  439. package/lib/image/index.js +117 -0
  440. package/lib/image/models/dataImage.js +215 -0
  441. package/lib/image/models/image.js +178 -0
  442. package/lib/image/models/index.js +22 -0
  443. package/lib/image/models/tileDataImage.js +188 -0
  444. package/lib/image/shaders/dataImage_frag.glsl +38 -0
  445. package/lib/image/shaders/image_frag.glsl +9 -0
  446. package/lib/image/shaders/image_vert.glsl +17 -0
  447. package/lib/index.js +275 -0
  448. package/lib/line/index.js +152 -0
  449. package/lib/line/models/arc.js +373 -0
  450. package/lib/line/models/arc_3d.js +351 -0
  451. package/lib/line/models/earthArc_3d.js +354 -0
  452. package/lib/line/models/great_circle.js +310 -0
  453. package/lib/line/models/half.js +298 -0
  454. package/lib/line/models/index.js +46 -0
  455. package/lib/line/models/line.js +460 -0
  456. package/lib/line/models/linearline.js +292 -0
  457. package/lib/line/models/simpleLine.js +249 -0
  458. package/lib/line/models/simpleTileLine.js +115 -0
  459. package/lib/line/models/tile.js +194 -0
  460. package/lib/line/models/wall.js +309 -0
  461. package/lib/line/shaders/arc_chunks.vert.glsl +21 -0
  462. package/lib/line/shaders/dash/arc_dash_frag.glsl +28 -0
  463. package/lib/line/shaders/dash/arc_dash_vert.glsl +150 -0
  464. package/lib/line/shaders/dash/line_dash_frag.glsl +31 -0
  465. package/lib/line/shaders/dash/line_dash_vert.glsl +93 -0
  466. package/lib/line/shaders/half/line_half_frag.glsl +53 -0
  467. package/lib/line/shaders/half/line_half_vert.glsl +169 -0
  468. package/lib/line/shaders/line_arc2d_vert.glsl +114 -0
  469. package/lib/line/shaders/line_arc_3d_frag.glsl +103 -0
  470. package/lib/line/shaders/line_arc_3d_vert.glsl +206 -0
  471. package/lib/line/shaders/line_arc_frag.glsl +88 -0
  472. package/lib/line/shaders/line_arc_great_circle_frag.glsl +101 -0
  473. package/lib/line/shaders/line_arc_great_circle_vert.glsl +214 -0
  474. package/lib/line/shaders/line_arc_vert.glsl +178 -0
  475. package/lib/line/shaders/line_bezier_vert.glsl +85 -0
  476. package/lib/line/shaders/line_frag.glsl +99 -0
  477. package/lib/line/shaders/line_vert.glsl +192 -0
  478. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +46 -0
  479. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +206 -0
  480. package/lib/line/shaders/linear/arc_linear_frag.glsl +38 -0
  481. package/lib/line/shaders/linear/arc_linear_vert.glsl +138 -0
  482. package/lib/line/shaders/linear/line_linear_frag.glsl +27 -0
  483. package/lib/line/shaders/linearLine/line_linear_frag.glsl +20 -0
  484. package/lib/line/shaders/linearLine/line_linear_vert.glsl +112 -0
  485. package/lib/line/shaders/simple/simpleline_frag.glsl +10 -0
  486. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +11 -0
  487. package/lib/line/shaders/simple/simpleline_vert.glsl +79 -0
  488. package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  489. package/lib/line/shaders/tile/line_tile_vert.glsl +52 -0
  490. package/lib/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  491. package/lib/line/shaders/tile/simpleline_vert.glsl +21 -0
  492. package/lib/line/shaders/wall/wall_frag.glsl +89 -0
  493. package/lib/line/shaders/wall/wall_vert.glsl +77 -0
  494. package/lib/mask/index.js +176 -0
  495. package/lib/mask/models/fill.js +141 -0
  496. package/lib/mask/models/index.js +19 -0
  497. package/lib/mask/shaders/mask_vert.glsl +16 -0
  498. package/lib/plugins/DataMappingPlugin.js +427 -0
  499. package/lib/plugins/DataSourcePlugin.js +97 -0
  500. package/lib/plugins/FeatureScalePlugin.js +363 -0
  501. package/lib/plugins/LayerAnimateStylePlugin.js +41 -0
  502. package/lib/plugins/LayerModelPlugin.js +83 -0
  503. package/lib/plugins/LayerStylePlugin.js +50 -0
  504. package/lib/plugins/LightingPlugin.js +119 -0
  505. package/lib/plugins/MultiPassRendererPlugin.js +77 -0
  506. package/lib/plugins/PixelPickingPlugin.js +139 -0
  507. package/lib/plugins/RegisterStyleAttributePlugin.js +168 -0
  508. package/lib/plugins/ShaderUniformPlugin.js +119 -0
  509. package/lib/plugins/UpdateModelPlugin.js +42 -0
  510. package/lib/plugins/UpdateStyleAttributePlugin.js +94 -0
  511. package/lib/point/index.js +242 -0
  512. package/lib/point/models/earthExtrude.js +290 -0
  513. package/lib/point/models/earthFill.js +293 -0
  514. package/lib/point/models/extrude.js +312 -0
  515. package/lib/point/models/fill.js +419 -0
  516. package/lib/point/models/fillmage.js +382 -0
  517. package/lib/point/models/image.js +255 -0
  518. package/lib/point/models/index.js +53 -0
  519. package/lib/point/models/normal.js +141 -0
  520. package/lib/point/models/radar.js +249 -0
  521. package/lib/point/models/simplePoint.js +196 -0
  522. package/lib/point/models/text.js +634 -0
  523. package/lib/point/models/tile.js +189 -0
  524. package/lib/point/models/tileText.js +524 -0
  525. package/lib/point/shaders/animate/wave_frag.glsl +65 -0
  526. package/lib/point/shaders/earth/extrude_frag.glsl +44 -0
  527. package/lib/point/shaders/earth/extrude_vert.glsl +140 -0
  528. package/lib/point/shaders/earth/fill_frag.glsl +86 -0
  529. package/lib/point/shaders/earth/fill_vert.glsl +125 -0
  530. package/lib/point/shaders/extrude/extrude_frag.glsl +44 -0
  531. package/lib/point/shaders/extrude/extrude_vert.glsl +121 -0
  532. package/lib/point/shaders/fill_frag.glsl +84 -0
  533. package/lib/point/shaders/fill_vert.glsl +188 -0
  534. package/lib/point/shaders/image/fillImage_frag.glsl +20 -0
  535. package/lib/point/shaders/image/fillImage_vert.glsl +116 -0
  536. package/lib/point/shaders/image_frag.glsl +39 -0
  537. package/lib/point/shaders/image_vert.glsl +90 -0
  538. package/lib/point/shaders/normal_frag.glsl +6 -0
  539. package/lib/point/shaders/normal_vert.glsl +24 -0
  540. package/lib/point/shaders/radar/radar_frag.glsl +53 -0
  541. package/lib/point/shaders/radar/radar_vert.glsl +70 -0
  542. package/lib/point/shaders/simplePoint_frag.glsl +53 -0
  543. package/lib/point/shaders/simplePoint_vert.glsl +79 -0
  544. package/lib/point/shaders/text_frag.glsl +48 -0
  545. package/lib/point/shaders/text_vert.glsl +131 -0
  546. package/lib/point/shaders/tile/fill_tile_frag.glsl +76 -0
  547. package/lib/point/shaders/tile/fill_tile_vert.glsl +78 -0
  548. package/lib/point/shaders/tile/text_frag.glsl +33 -0
  549. package/lib/point/shaders/tile/text_map_frag.glsl +31 -0
  550. package/lib/point/shaders/tile/text_map_vert.glsl +38 -0
  551. package/lib/point/shaders/tile/text_vert.glsl +48 -0
  552. package/lib/point/shape/extrude.js +78 -0
  553. package/lib/polygon/index.js +160 -0
  554. package/lib/polygon/models/extrude.js +318 -0
  555. package/lib/polygon/models/fill.js +225 -0
  556. package/lib/polygon/models/index.js +50 -0
  557. package/lib/polygon/models/ocean.js +219 -0
  558. package/lib/polygon/models/tile.js +114 -0
  559. package/lib/polygon/models/water.js +196 -0
  560. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +44 -0
  561. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +44 -0
  562. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +85 -0
  563. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +90 -0
  564. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +48 -0
  565. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +93 -0
  566. package/lib/polygon/shaders/polygon_frag.glsl +12 -0
  567. package/lib/polygon/shaders/polygon_linear_frag.glsl +22 -0
  568. package/lib/polygon/shaders/polygon_linear_vert.glsl +74 -0
  569. package/lib/polygon/shaders/polygon_vert.glsl +66 -0
  570. package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  571. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +42 -0
  572. package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +247 -0
  573. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +21 -0
  574. package/lib/polygon/shaders/water/polygon_water_frag.glsl +71 -0
  575. package/lib/polygon/shaders/water/polygon_water_vert.glsl +26 -0
  576. package/lib/raster/buffers/triangulation.js +35 -0
  577. package/lib/raster/index.js +120 -0
  578. package/lib/raster/models/index.js +23 -0
  579. package/lib/raster/models/raster.js +259 -0
  580. package/lib/raster/models/rasterRgb.js +241 -0
  581. package/lib/raster/models/rasterTile.js +154 -0
  582. package/lib/raster/raster.js +191 -0
  583. package/lib/raster/shaders/raster_2d_frag.glsl +64 -0
  584. package/lib/raster/shaders/raster_2d_vert.glsl +17 -0
  585. package/lib/raster/shaders/raster_frag.glsl +9 -0
  586. package/lib/raster/shaders/raster_rgb_frag.glsl +12 -0
  587. package/lib/raster/shaders/raster_vert.glsl +44 -0
  588. package/lib/shader/minify_frag.glsl +7 -0
  589. package/lib/shader/minify_picking_frag.glsl +10 -0
  590. package/lib/tile/interface.js +5 -0
  591. package/lib/tile/manager/baseMapTileLayerManager.js +134 -0
  592. package/lib/tile/manager/baseTileManager.js +121 -0
  593. package/lib/tile/manager/tileConfigManager.js +133 -0
  594. package/lib/tile/manager/tileLayerManager.js +273 -0
  595. package/lib/tile/manager/tilePickerManager.js +205 -0
  596. package/lib/tile/models/tileModel.js +94 -0
  597. package/lib/tile/tileFactory/base.js +497 -0
  598. package/lib/tile/tileFactory/index.js +71 -0
  599. package/lib/tile/tileFactory/line.js +73 -0
  600. package/lib/tile/tileFactory/mask.js +74 -0
  601. package/lib/tile/tileFactory/point.js +74 -0
  602. package/lib/tile/tileFactory/polygon.js +73 -0
  603. package/lib/tile/tileFactory/raster.js +71 -0
  604. package/lib/tile/tileFactory/rasterData.js +99 -0
  605. package/lib/tile/tileFactory/rasterDataLayer.js +104 -0
  606. package/lib/tile/tileFactory/test.js +118 -0
  607. package/lib/tile/tileFactory/vectorLayer.js +280 -0
  608. package/lib/tile/tileLayer/baseMapTileLayer.js +202 -0
  609. package/lib/tile/tileLayer/baseTileLayer.js +429 -0
  610. package/lib/tile/tileTest.js +74 -0
  611. package/lib/tile/tmsMapTileLayer.js +114 -0
  612. package/lib/tile/tmsTileLayer.js +118 -0
  613. package/lib/tile/utils.js +248 -0
  614. package/lib/utils/blend.js +65 -0
  615. package/lib/utils/collision-index.js +118 -0
  616. package/lib/utils/dataMappingStyle.js +154 -0
  617. package/lib/utils/extrude_polyline.js +653 -0
  618. package/lib/utils/grid-index.js +188 -0
  619. package/lib/utils/layerData.js +191 -0
  620. package/lib/utils/multiPassRender.js +61 -0
  621. package/lib/utils/polylineNormal.js +230 -0
  622. package/lib/utils/simpleLine.js +116 -0
  623. package/lib/utils/symbol-layout.js +308 -0
  624. package/lib/utils/updateShape.js +27 -0
  625. package/lib/wind/index.js +111 -0
  626. package/lib/wind/models/index.js +16 -0
  627. package/lib/wind/models/utils.js +253 -0
  628. package/lib/wind/models/wind.js +346 -0
  629. package/lib/wind/models/windRender.js +373 -0
  630. package/lib/wind/models/windShader.js +25 -0
  631. package/lib/wind/shaders/wind_frag.glsl +9 -0
  632. package/lib/wind/shaders/wind_vert.glsl +17 -0
  633. package/package.json +6 -6
@@ -0,0 +1,12 @@
1
+ import { ILayer, ILayerPlugin, IStyleAttributeService } from '@antv/l7-core';
2
+ import 'reflect-metadata';
3
+ /**
4
+ * 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
5
+ */
6
+ export default class UpdateStyleAttributePlugin implements ILayerPlugin {
7
+ apply(layer: ILayer, { styleAttributeService, }: {
8
+ styleAttributeService: IStyleAttributeService;
9
+ }): void;
10
+ private updateStyleAttribute;
11
+ private initStyleAttribute;
12
+ }
@@ -0,0 +1,83 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+
4
+ var _dec, _class;
5
+
6
+ import { injectable } from 'inversify';
7
+ import 'reflect-metadata';
8
+ /**
9
+ * 在初始化阶段完成属性的注册,以及首次根据 Layer 指定的三角化方法完成 indices 和 attribute 的创建
10
+ */
11
+
12
+ var UpdateStyleAttributePlugin = (_dec = injectable(), _dec(_class = /*#__PURE__*/function () {
13
+ function UpdateStyleAttributePlugin() {
14
+ _classCallCheck(this, UpdateStyleAttributePlugin);
15
+ }
16
+
17
+ _createClass(UpdateStyleAttributePlugin, [{
18
+ key: "apply",
19
+ value: function apply(layer, _ref) {
20
+ var _this = this;
21
+
22
+ var styleAttributeService = _ref.styleAttributeService;
23
+ layer.hooks.init.tap('UpdateStyleAttributePlugin', function () {
24
+ _this.initStyleAttribute(layer, {
25
+ styleAttributeService: styleAttributeService
26
+ });
27
+ });
28
+ layer.hooks.beforeRender.tap('UpdateStyleAttributePlugin', function () {
29
+ var _layer$getLayerConfig = layer.getLayerConfig(),
30
+ usage = _layer$getLayerConfig.usage;
31
+
32
+ if (layer.layerModelNeedUpdate || layer.tileLayer || usage === 'basemap') {
33
+ return;
34
+ }
35
+
36
+ layer.modelLoaded && _this.updateStyleAttribute(layer, {
37
+ styleAttributeService: styleAttributeService
38
+ });
39
+ });
40
+ }
41
+ }, {
42
+ key: "updateStyleAttribute",
43
+ value: function updateStyleAttribute(layer, _ref2) {
44
+ var styleAttributeService = _ref2.styleAttributeService;
45
+ var attributes = styleAttributeService.getLayerStyleAttributes() || [];
46
+ var filter = styleAttributeService.getLayerStyleAttribute('filter');
47
+
48
+ if (filter && filter.needRegenerateVertices) {
49
+ layer.layerModelNeedUpdate = true;
50
+ attributes.forEach(function (attr) {
51
+ return attr.needRegenerateVertices = false;
52
+ });
53
+ return;
54
+ }
55
+
56
+ attributes.filter(function (attribute) {
57
+ return attribute.needRegenerateVertices;
58
+ }).forEach(function (attribute) {
59
+ // 精确更新某个/某些 feature(s),需要传入 featureIdx d
60
+ styleAttributeService.updateAttributeByFeatureRange(attribute.name, layer.getEncodedData(), // 获取经过 mapping 最新的数据
61
+ attribute.featureRange.startIndex, attribute.featureRange.endIndex);
62
+ attribute.needRegenerateVertices = false;
63
+ });
64
+ }
65
+ }, {
66
+ key: "initStyleAttribute",
67
+ value: function initStyleAttribute(layer, _ref3) {
68
+ var styleAttributeService = _ref3.styleAttributeService;
69
+ var attributes = styleAttributeService.getLayerStyleAttributes() || [];
70
+ attributes.filter(function (attribute) {
71
+ return attribute.needRegenerateVertices;
72
+ }).forEach(function (attribute) {
73
+ // 精确更新某个/某些 feature(s),需要传入 featureIdx d
74
+ styleAttributeService.updateAttributeByFeatureRange(attribute.name, layer.getEncodedData(), // 获取经过 mapping 最新的数据
75
+ attribute.featureRange.startIndex, attribute.featureRange.endIndex);
76
+ attribute.needRegenerateVertices = false;
77
+ });
78
+ }
79
+ }]);
80
+
81
+ return UpdateStyleAttributePlugin;
82
+ }()) || _class);
83
+ export { UpdateStyleAttributePlugin as default };
@@ -0,0 +1,40 @@
1
+ import BaseLayer from '../core/BaseLayer';
2
+ import { IPointLayerStyleOptions } from '../core/interface';
3
+ import { PointType } from './models/index';
4
+ export default class PointLayer extends BaseLayer<IPointLayerStyleOptions> {
5
+ type: string;
6
+ defaultSourceConfig: {
7
+ data: never[];
8
+ options: {
9
+ parser: {
10
+ type: string;
11
+ x: string;
12
+ y: string;
13
+ };
14
+ };
15
+ };
16
+ buildModels(): void;
17
+ rebuildModels(): void;
18
+ /**
19
+ * 在未传入数据的时候判断点图层的 shape 类型
20
+ * @returns
21
+ */
22
+ getModelTypeWillEmptyData(): PointType;
23
+ protected getConfigSchema(): {
24
+ properties: {
25
+ opacity: {
26
+ type: string;
27
+ minimum: number;
28
+ maximum: number;
29
+ };
30
+ };
31
+ };
32
+ protected getDefaultConfig(): {} | {
33
+ blend: string;
34
+ } | {} | {} | {
35
+ blend: string;
36
+ } | {} | {} | {
37
+ blend: string;
38
+ } | {} | {} | {} | {} | {};
39
+ protected getModelType(): PointType;
40
+ }
@@ -0,0 +1,229 @@
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 _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
+
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+
15
+ 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); }; }
16
+
17
+ 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; } }
18
+
19
+ import BaseLayer from "../core/BaseLayer";
20
+ import PointModels from "./models/index";
21
+ import { isVectorTile } from "../tile/utils";
22
+
23
+ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
24
+ _inherits(PointLayer, _BaseLayer);
25
+
26
+ var _super = _createSuper(PointLayer);
27
+
28
+ function PointLayer() {
29
+ var _this;
30
+
31
+ _classCallCheck(this, PointLayer);
32
+
33
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
34
+ args[_key] = arguments[_key];
35
+ }
36
+
37
+ _this = _super.call.apply(_super, [this].concat(args));
38
+
39
+ _defineProperty(_assertThisInitialized(_this), "type", 'PointLayer');
40
+
41
+ _defineProperty(_assertThisInitialized(_this), "defaultSourceConfig", {
42
+ data: [],
43
+ options: {
44
+ parser: {
45
+ type: 'json',
46
+ x: 'lng',
47
+ y: 'lat'
48
+ }
49
+ }
50
+ });
51
+
52
+ return _this;
53
+ }
54
+
55
+ _createClass(PointLayer, [{
56
+ key: "buildModels",
57
+ value: function buildModels() {
58
+ var _this2 = this;
59
+
60
+ var modelType = this.getModelType();
61
+ this.layerModel = new PointModels[modelType](this);
62
+ this.layerModel.initModels(function (models) {
63
+ _this2.dispatchModelLoad(models);
64
+ });
65
+ }
66
+ }, {
67
+ key: "rebuildModels",
68
+ value: function rebuildModels() {
69
+ var _this3 = this;
70
+
71
+ this.layerModel.buildModels(function (models) {
72
+ _this3.dispatchModelLoad(models);
73
+ });
74
+ }
75
+ /**
76
+ * 在未传入数据的时候判断点图层的 shape 类型
77
+ * @returns
78
+ */
79
+
80
+ }, {
81
+ key: "getModelTypeWillEmptyData",
82
+ value: function getModelTypeWillEmptyData() {
83
+ if (this.shapeOption) {
84
+ var _this$shapeOption = this.shapeOption,
85
+ field = _this$shapeOption.field,
86
+ values = _this$shapeOption.values;
87
+
88
+ var _this$getLayerConfig = this.getLayerConfig(),
89
+ shape2d = _this$getLayerConfig.shape2d;
90
+
91
+ var iconMap = this.iconService.getIconMap();
92
+
93
+ if (field && (shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(field)) !== -1) {
94
+ return 'fill';
95
+ }
96
+
97
+ if (values && values instanceof Array) {
98
+ var _iterator = _createForOfIteratorHelper(values),
99
+ _step;
100
+
101
+ try {
102
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
103
+ var v = _step.value;
104
+
105
+ if (typeof v === 'string' && iconMap.hasOwnProperty(v)) {
106
+ return 'image';
107
+ }
108
+ }
109
+ } catch (err) {
110
+ _iterator.e(err);
111
+ } finally {
112
+ _iterator.f();
113
+ }
114
+ }
115
+ }
116
+
117
+ return 'normal';
118
+ }
119
+ }, {
120
+ key: "getConfigSchema",
121
+ value: function getConfigSchema() {
122
+ return {
123
+ properties: {
124
+ opacity: {
125
+ type: 'number',
126
+ minimum: 0,
127
+ maximum: 1
128
+ }
129
+ }
130
+ };
131
+ }
132
+ }, {
133
+ key: "getDefaultConfig",
134
+ value: function getDefaultConfig() {
135
+ var type = this.getModelType();
136
+ var defaultConfig = {
137
+ fillImage: {},
138
+ normal: {
139
+ blend: 'additive'
140
+ },
141
+ radar: {},
142
+ simplePoint: {},
143
+ fill: {
144
+ blend: 'normal'
145
+ },
146
+ extrude: {},
147
+ image: {},
148
+ text: {
149
+ blend: 'normal'
150
+ },
151
+ vectorPoint: {},
152
+ tile: {},
153
+ tileText: {},
154
+ earthFill: {},
155
+ earthExtrude: {}
156
+ };
157
+ return defaultConfig[type];
158
+ }
159
+ }, {
160
+ key: "getModelType",
161
+ value: function getModelType() {
162
+ var parserType = this.layerSource.getParserType();
163
+
164
+ if (isVectorTile(parserType)) {
165
+ return 'vectorPoint';
166
+ } // 2D、 3d、 shape、image、text、normal、
167
+
168
+
169
+ var layerData = this.getEncodedData();
170
+
171
+ var _this$getLayerConfig2 = this.getLayerConfig(),
172
+ shape2d = _this$getLayerConfig2.shape2d,
173
+ shape3d = _this$getLayerConfig2.shape3d;
174
+
175
+ var iconMap = this.iconService.getIconMap();
176
+ var item = layerData.find(function (fe) {
177
+ return fe.hasOwnProperty('shape');
178
+ });
179
+
180
+ if (!item) {
181
+ return this.getModelTypeWillEmptyData();
182
+ } else {
183
+ var shape = item.shape;
184
+
185
+ if (shape === 'dot') {
186
+ return 'normal';
187
+ }
188
+
189
+ if (shape === 'simple') {
190
+ return 'simplePoint';
191
+ }
192
+
193
+ if (shape === 'radar') {
194
+ return 'radar';
195
+ }
196
+
197
+ if (this.layerType === 'fillImage') {
198
+ return 'fillImage';
199
+ }
200
+
201
+ if ((shape2d === null || shape2d === void 0 ? void 0 : shape2d.indexOf(shape)) !== -1) {
202
+ if (this.mapService.version === 'GLOBEL') {
203
+ return 'earthFill';
204
+ } else {
205
+ return 'fill';
206
+ }
207
+ }
208
+
209
+ if ((shape3d === null || shape3d === void 0 ? void 0 : shape3d.indexOf(shape)) !== -1) {
210
+ if (this.mapService.version === 'GLOBEL') {
211
+ return 'earthExtrude';
212
+ } else {
213
+ return 'extrude';
214
+ }
215
+ }
216
+
217
+ if (iconMap.hasOwnProperty(shape)) {
218
+ return 'image';
219
+ }
220
+
221
+ return 'text';
222
+ }
223
+ }
224
+ }]);
225
+
226
+ return PointLayer;
227
+ }(BaseLayer);
228
+
229
+ export { PointLayer as default };
@@ -0,0 +1,24 @@
1
+ import { IModel } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ export default class ExtrudeModel extends BaseModel {
4
+ private raiseCount;
5
+ private raiseRepeat;
6
+ getUninforms(): {
7
+ u_pickLight: number;
8
+ u_heightfixed: number;
9
+ u_r: number;
10
+ u_dataTexture: import("@antv/l7-core").ITexture2D;
11
+ u_cellTypeLayout: number[];
12
+ u_opacity: number;
13
+ u_linearColor: number;
14
+ u_sourceColor: number[];
15
+ u_targetColor: number[];
16
+ u_opacitylinear: number;
17
+ u_opacitylinear_dir: number;
18
+ u_lightEnable: number;
19
+ };
20
+ initModels(callbackModel: (models: IModel[]) => void): void;
21
+ buildModels(callbackModel: (models: IModel[]) => void): void;
22
+ clearModels(): void;
23
+ protected registerBuiltinAttributes(): void;
24
+ }
@@ -0,0 +1,274 @@
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 { AttributeType, gl } from '@antv/l7-core';
14
+ import { calculateCentroid, getCullFace, rgb2arr } from '@antv/l7-utils';
15
+ import { isNumber } from 'lodash';
16
+ import BaseModel from "../../core/BaseModel";
17
+ import { PointExtrudeTriangulation } from "../../core/triangulation";
18
+ import { lglt2xyz } from "../../earth/utils";
19
+
20
+ /* babel-plugin-inline-import '../shaders/earth/extrude_frag.glsl' */
21
+ var pointExtrudeFrag = "varying vec4 v_color;\nuniform float u_opacity: 1.0;\n\nuniform float u_pickLight: 0.0;\n\n#pragma include \"picking\"\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nuniform float u_opacitylinear: 0.0;\nuniform float u_opacitylinear_dir: 1.0;\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float lightWeight = styleMappingMat[1][3];\n float barLinearZ = styleMappingMat[2][3];\n\n // \u8BBE\u7F6E\u5706\u67F1\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, barLinearZ);\n gl_FragColor.rgb *= lightWeight;\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n // \u5E94\u7528\u900F\u660E\u5EA6\n gl_FragColor.a *= opacity;\n\n // \u5F00\u542F\u900F\u660E\u5EA6\u6E10\u53D8\n if(u_opacitylinear > 0.0) {\n gl_FragColor.a *= u_opacitylinear_dir > 0.0 ? (1.0 - barLinearZ): barLinearZ;\n }\n\n // picking\n if(u_pickLight > 0.0) {\n gl_FragColor = filterColorAlpha(gl_FragColor, lightWeight);\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
22
+
23
+ /* babel-plugin-inline-import '../shaders/earth/extrude_vert.glsl' */
24
+ var pointExtrudeVert = "precision highp float;\n\n#define pi 3.1415926535\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec3 a_Position;\nattribute vec3 a_Pos;\nattribute vec4 a_Color;\nattribute vec3 a_Size;\nattribute vec3 a_Normal;\n\nuniform float u_heightfixed: 0.0; // \u9ED8\u8BA4\u4E0D\u56FA\u5B9A\nuniform float u_globel;\nuniform float u_r;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform float u_lightEnable: 1;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\nfloat getYRadian(float x, float z) {\n if(x > 0.0 && z > 0.0) {\n return atan(x/z);\n } else if(x > 0.0 && z <= 0.0){\n return atan(-z/x) + pi/2.0;\n } else if(x <= 0.0 && z <= 0.0) {\n return pi + atan(x/z); //atan(x/z) + \n } else {\n return atan(z/-x) + pi*3.0/2.0;\n }\n}\n\nfloat getXRadian(float y, float r) {\n return atan(y/r);\n}\n\nvoid main() {\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA - lightWeight\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1] - linearZ(\u5782\u76F4\u65B9\u5411 0 - 1 \u7684\u503C)\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n vec3 size = a_Size * a_Position;\n\n // a_Position.z \u662F\u5728\u6784\u5EFA\u7F51\u683C\u7684\u65F6\u5019\u4F20\u5165\u7684\u6807\u51C6\u503C 0 - 1\uFF0C\u5728\u63D2\u503C\u5668\u63D2\u503C\u53EF\u4EE5\u83B7\u53D6 0\uFF5E1 \u7EBF\u6027\u6E10\u53D8\u7684\u503C\n styleMappingMat[2][3] = a_Position.z;\n\n vec3 offset = size; // \u63A7\u5236\u5706\u67F1\u4F53\u7684\u5927\u5C0F - \u4ECE\u6807\u51C6\u5355\u4F4D\u5706\u67F1\u4F53\u8FDB\u884C\u504F\u79FB\n if(u_heightfixed < 1.0) { // \u5706\u67F1\u4F53\u4E0D\u56FA\u5B9A\u9AD8\u5EA6\n \n if (u_CoordinateSystem == COORDINATE_SYSTEM_P20 || u_CoordinateSystem == COORDINATE_SYSTEM_P20_OFFSET) {\n // P20 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF1\n offset = offset * pow(2.0, (19.0 - u_Zoom));\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {\n // P20_2 \u5750\u6807\u7CFB\u4E0B\uFF0C\u4E3A\u4E86\u548C Web \u58A8\u5361\u6258\u5750\u6807\u7CFB\u7EDF\u4E00\uFF0Czoom \u9ED8\u8BA4\u51CF3\n offset = offset * pow(2.0, (19.0 - 3.0 - u_Zoom));\n }\n } else {// \u5706\u67F1\u4F53\u56FA\u5B9A\u9AD8\u5EA6 \uFF08 \u5904\u7406 mapbox \uFF09\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n offset *= 4.0/pow(2.0, 21.0 - u_Zoom);\n }\n }\n\n\n vec4 project_pos = project_position(vec4(a_Pos.xy, 0., 1.0));\n\n // u_r \u63A7\u5236\u5706\u67F1\u7684\u751F\u957F\n vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);\n\n // \u5706\u67F1\u5149\u7167\u6548\u679C\n float lightWeight = 1.0;\n if(u_lightEnable > 0.0) { // \u53D6\u6D88\u4E09\u5143\u8868\u8FBE\u5F0F\uFF0C\u589E\u5F3A\u5065\u58EE\u6027\n lightWeight = calc_lighting(pos);\n }\n styleMappingMat[1][3] = lightWeight;\n\n v_color =vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n \n // \u5728\u5730\u7403\u6A21\u5F0F\u4E0B\uFF0C\u5C06\u539F\u672C\u5782\u76F4\u4E8E xy \u5E73\u9762\u7684\u5706\u67F1\u8C03\u6574\u59FF\u6001\u5230\u9002\u5E94\u5706\u7684\u89D2\u5EA6\n //\u65CB\u8F6C\u77E9\u9635mx\uFF0C\u521B\u5EFA\u7ED5x\u8F74\u65CB\u8F6C\u77E9\u9635\n float r = sqrt(a_Pos.z*a_Pos.z + a_Pos.x*a_Pos.x);\n float xRadian = getXRadian(a_Pos.y, r);\n float xcos = cos(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C\n float xsin = sin(xRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C\n mat4 mx = mat4(\n 1,0,0,0, \n 0,xcos,-xsin,0, \n 0,xsin,xcos,0, \n 0,0,0,1);\n\n //\u65CB\u8F6C\u77E9\u9635my\uFF0C\u521B\u5EFA\u7ED5y\u8F74\u65CB\u8F6C\u77E9\u9635\n float yRadian = getYRadian(a_Pos.x, a_Pos.z);\n float ycos = cos(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u4F59\u5F26\u503C\n float ysin = sin(yRadian);//\u6C42\u89E3\u65CB\u8F6C\u89D2\u5EA6\u6B63\u5F26\u503C\n mat4 my = mat4(\n ycos,0,-ysin,0, \n 0,1,0,0, \n ysin,0,ycos,0, \n 0,0,0,1);\n\n gl_Position = u_ViewProjectionMatrix * vec4(( my * mx * vec4(a_Position * a_Size, 1.0)).xyz + a_Pos, 1.0);\n \n\n setPickingColor(a_PickingColor);\n}\n";
25
+
26
+ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
27
+ _inherits(ExtrudeModel, _BaseModel);
28
+
29
+ var _super = _createSuper(ExtrudeModel);
30
+
31
+ function ExtrudeModel() {
32
+ var _this;
33
+
34
+ _classCallCheck(this, ExtrudeModel);
35
+
36
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
37
+ args[_key] = arguments[_key];
38
+ }
39
+
40
+ _this = _super.call.apply(_super, [this].concat(args));
41
+
42
+ _defineProperty(_assertThisInitialized(_this), "raiseCount", 0);
43
+
44
+ _defineProperty(_assertThisInitialized(_this), "raiseRepeat", 0);
45
+
46
+ return _this;
47
+ }
48
+
49
+ _createClass(ExtrudeModel, [{
50
+ key: "getUninforms",
51
+ value: function getUninforms() {
52
+ var _ref = this.layer.getLayerConfig(),
53
+ _ref$animateOption = _ref.animateOption,
54
+ animateOption = _ref$animateOption === void 0 ? {
55
+ enable: false,
56
+ speed: 0.01,
57
+ repeat: false
58
+ } : _ref$animateOption,
59
+ _ref$opacity = _ref.opacity,
60
+ opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
61
+ sourceColor = _ref.sourceColor,
62
+ targetColor = _ref.targetColor,
63
+ _ref$pickLight = _ref.pickLight,
64
+ pickLight = _ref$pickLight === void 0 ? false : _ref$pickLight,
65
+ _ref$heightfixed = _ref.heightfixed,
66
+ heightfixed = _ref$heightfixed === void 0 ? false : _ref$heightfixed,
67
+ _ref$opacityLinear = _ref.opacityLinear,
68
+ opacityLinear = _ref$opacityLinear === void 0 ? {
69
+ enable: false,
70
+ dir: 'up'
71
+ } : _ref$opacityLinear,
72
+ _ref$lightEnable = _ref.lightEnable,
73
+ lightEnable = _ref$lightEnable === void 0 ? true : _ref$lightEnable;
74
+
75
+ if (this.dataTextureTest && this.dataTextureNeedUpdate({
76
+ opacity: opacity
77
+ })) {
78
+ this.judgeStyleAttributes({
79
+ opacity: opacity
80
+ });
81
+ var encodeData = this.layer.getEncodedData();
82
+
83
+ var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
84
+ data = _this$calDataFrame.data,
85
+ width = _this$calDataFrame.width,
86
+ height = _this$calDataFrame.height;
87
+
88
+ this.rowCount = height; // 当前数据纹理有多少行
89
+
90
+ this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
91
+ flipY: true,
92
+ data: data,
93
+ format: gl.LUMINANCE,
94
+ type: gl.FLOAT,
95
+ width: width,
96
+ height: height
97
+ }) : this.createTexture2D({
98
+ flipY: true,
99
+ data: [1],
100
+ format: gl.LUMINANCE,
101
+ type: gl.FLOAT,
102
+ width: 1,
103
+ height: 1
104
+ });
105
+ } // 转化渐变色
106
+
107
+
108
+ var useLinearColor = 0; // 默认不生效
109
+
110
+ var sourceColorArr = [0, 0, 0, 0];
111
+ var targetColorArr = [0, 0, 0, 0];
112
+
113
+ if (sourceColor && targetColor) {
114
+ sourceColorArr = rgb2arr(sourceColor);
115
+ targetColorArr = rgb2arr(targetColor);
116
+ useLinearColor = 1;
117
+ }
118
+
119
+ if (this.raiseCount < 1 && this.raiseRepeat > 0) {
120
+ if (animateOption.enable) {
121
+ var _animateOption$speed = animateOption.speed,
122
+ speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed;
123
+ this.raiseCount += speed;
124
+
125
+ if (this.raiseCount >= 1) {
126
+ if (this.raiseRepeat > 1) {
127
+ this.raiseCount = 0;
128
+ this.raiseRepeat--;
129
+ } else {
130
+ this.raiseCount = 1;
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ return {
137
+ // 圆柱体的拾取高亮是否要计算光照
138
+ u_pickLight: Number(pickLight),
139
+ // 圆柱体是否固定高度
140
+ u_heightfixed: Number(heightfixed),
141
+ u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
142
+ u_dataTexture: this.dataTexture,
143
+ // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
144
+ u_cellTypeLayout: this.getCellTypeLayout(),
145
+ u_opacity: isNumber(opacity) ? opacity : 1.0,
146
+ // 渐变色支持参数
147
+ u_linearColor: useLinearColor,
148
+ u_sourceColor: sourceColorArr,
149
+ u_targetColor: targetColorArr,
150
+ // 透明度渐变
151
+ u_opacitylinear: Number(opacityLinear.enable),
152
+ u_opacitylinear_dir: opacityLinear.dir === 'up' ? 1.0 : 0.0,
153
+ // 光照计算开关
154
+ u_lightEnable: Number(lightEnable)
155
+ };
156
+ }
157
+ }, {
158
+ key: "initModels",
159
+ value: function initModels(callbackModel) {
160
+ this.buildModels(callbackModel);
161
+ }
162
+ }, {
163
+ key: "buildModels",
164
+ value: function buildModels(callbackModel) {
165
+ // GAODE1.x GAODE2.x MAPBOX
166
+ var _ref2 = this.layer.getLayerConfig(),
167
+ _ref2$animateOption$r = _ref2.animateOption.repeat,
168
+ repeat = _ref2$animateOption$r === void 0 ? 1 : _ref2$animateOption$r;
169
+
170
+ this.raiseRepeat = repeat;
171
+ this.layer.buildLayerModel({
172
+ moduleName: 'pointEarthExtrude',
173
+ vertexShader: pointExtrudeVert,
174
+ fragmentShader: pointExtrudeFrag,
175
+ triangulation: PointExtrudeTriangulation,
176
+ depth: {
177
+ enable: true
178
+ },
179
+ cull: {
180
+ enable: true,
181
+ face: getCullFace(this.mapService.version)
182
+ },
183
+ blend: this.getBlend()
184
+ }).then(function (model) {
185
+ callbackModel([model]);
186
+ }).catch(function (err) {
187
+ console.warn(err);
188
+ callbackModel([]);
189
+ });
190
+ }
191
+ }, {
192
+ key: "clearModels",
193
+ value: function clearModels() {
194
+ var _this$dataTexture;
195
+
196
+ (_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
197
+ }
198
+ }, {
199
+ key: "registerBuiltinAttributes",
200
+ value: function registerBuiltinAttributes() {
201
+ this.styleAttributeService.registerStyleAttribute({
202
+ name: 'size',
203
+ type: AttributeType.Attribute,
204
+ descriptor: {
205
+ name: 'a_Size',
206
+ buffer: {
207
+ usage: gl.DYNAMIC_DRAW,
208
+ data: [],
209
+ type: gl.FLOAT
210
+ },
211
+ size: 3,
212
+ update: function update(feature) {
213
+ var size = feature.size;
214
+
215
+ if (size) {
216
+ var buffersize = [];
217
+
218
+ if (Array.isArray(size)) {
219
+ buffersize = size.length === 2 ? [size[0], size[0], size[1]] : size;
220
+ }
221
+
222
+ if (!Array.isArray(size)) {
223
+ buffersize = [size, size, size];
224
+ }
225
+
226
+ return buffersize;
227
+ } else {
228
+ return [2, 2, 2];
229
+ }
230
+ }
231
+ }
232
+ }); // point layer size;
233
+
234
+ this.styleAttributeService.registerStyleAttribute({
235
+ name: 'normal',
236
+ type: AttributeType.Attribute,
237
+ descriptor: {
238
+ name: 'a_Normal',
239
+ buffer: {
240
+ // give the WebGL driver a hint that this buffer may change
241
+ usage: gl.STATIC_DRAW,
242
+ data: [],
243
+ type: gl.FLOAT
244
+ },
245
+ size: 3,
246
+ update: function update(feature, featureIdx, vertex, attributeIdx, normal) {
247
+ return normal;
248
+ }
249
+ }
250
+ });
251
+ this.styleAttributeService.registerStyleAttribute({
252
+ name: 'pos',
253
+ type: AttributeType.Attribute,
254
+ descriptor: {
255
+ name: 'a_Pos',
256
+ buffer: {
257
+ usage: gl.DYNAMIC_DRAW,
258
+ data: [],
259
+ type: gl.FLOAT
260
+ },
261
+ size: 3,
262
+ update: function update(feature) {
263
+ var coordinates = calculateCentroid(feature.coordinates);
264
+ return lglt2xyz([coordinates[0], coordinates[1]]);
265
+ }
266
+ }
267
+ });
268
+ }
269
+ }]);
270
+
271
+ return ExtrudeModel;
272
+ }(BaseModel);
273
+
274
+ export { ExtrudeModel as default };
@@ -0,0 +1,11 @@
1
+ import { IAnimateOption, IModel, IModelUniform } from '@antv/l7-core';
2
+ import BaseModel from '../../core/BaseModel';
3
+ export default class FillModel extends BaseModel {
4
+ getUninforms(): IModelUniform;
5
+ getAnimateUniforms(): IModelUniform;
6
+ initModels(callbackModel: (models: IModel[]) => void): void;
7
+ buildModels(callbackModel: (models: IModel[]) => void): void;
8
+ clearModels(): void;
9
+ protected animateOption2Array(option: Partial<IAnimateOption>): number[];
10
+ protected registerBuiltinAttributes(): void;
11
+ }