@antv/l7-layers 2.16.1 → 2.16.2

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 (386) hide show
  1. package/es/Geometry/index.js +9 -31
  2. package/es/Geometry/models/billboard.js +51 -89
  3. package/es/Geometry/models/plane.js +81 -143
  4. package/es/Geometry/models/sprite.js +60 -118
  5. package/es/canvas/index.js +10 -33
  6. package/es/canvas/models/canvas.js +41 -97
  7. package/es/citybuliding/building.js +8 -27
  8. package/es/citybuliding/models/build.js +57 -82
  9. package/es/core/BaseLayer.d.ts +3 -0
  10. package/es/core/BaseLayer.js +360 -528
  11. package/es/core/BaseModel.d.ts +9 -71
  12. package/es/core/BaseModel.js +118 -429
  13. package/es/core/CommonStyleAttribute.d.ts +2 -0
  14. package/es/core/CommonStyleAttribute.js +66 -0
  15. package/es/core/LayerPickService.js +21 -32
  16. package/es/core/TextureService.js +0 -13
  17. package/es/core/interface.d.ts +13 -3
  18. package/es/core/interface.js +17 -24
  19. package/es/core/shape/Path.js +13 -20
  20. package/es/core/shape/extrude.js +27 -36
  21. package/es/core/triangulation.d.ts +12 -0
  22. package/es/core/triangulation.js +124 -114
  23. package/es/earth/index.js +9 -33
  24. package/es/earth/models/atmosphere.js +30 -54
  25. package/es/earth/models/base.js +47 -85
  26. package/es/earth/models/bloomsphere.js +30 -54
  27. package/es/earth/utils.js +9 -13
  28. package/es/heatmap/index.js +10 -40
  29. package/es/heatmap/models/grid.js +29 -53
  30. package/es/heatmap/models/grid3d.js +29 -53
  31. package/es/heatmap/models/heatmap.d.ts +1 -0
  32. package/es/heatmap/models/heatmap.js +99 -150
  33. package/es/heatmap/models/hexagon.js +29 -53
  34. package/es/heatmap/shaders/grid_vert.glsl +2 -2
  35. package/es/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
  36. package/es/heatmap/shaders/hexagon_vert.glsl +2 -2
  37. package/es/heatmap/triangulation.js +0 -4
  38. package/es/image/index.js +9 -28
  39. package/es/image/models/image.js +66 -100
  40. package/es/index.js +9 -17
  41. package/es/line/index.d.ts +1 -0
  42. package/es/line/index.js +12 -36
  43. package/es/line/models/arc.js +72 -160
  44. package/es/line/models/arc_3d.js +67 -148
  45. package/es/line/models/earthArc_3d.js +66 -148
  46. package/es/line/models/{half.d.ts → flow.d.ts} +1 -11
  47. package/es/line/models/flow.js +167 -0
  48. package/es/line/models/great_circle.js +57 -135
  49. package/es/line/models/index.d.ts +1 -1
  50. package/es/line/models/index.js +3 -3
  51. package/es/line/models/line.js +98 -186
  52. package/es/line/models/linearline.js +46 -115
  53. package/es/line/models/simpleLine.d.ts +0 -1
  54. package/es/line/models/simpleLine.js +42 -114
  55. package/es/line/models/wall.js +52 -92
  56. package/es/line/shaders/dash/arc_dash_frag.glsl +3 -6
  57. package/es/line/shaders/dash/arc_dash_vert.glsl +6 -46
  58. package/es/line/shaders/dash/line_dash_frag.glsl +4 -7
  59. package/es/line/shaders/dash/line_dash_vert.glsl +3 -33
  60. package/es/line/shaders/flow/flow_line_frag.glsl +13 -0
  61. package/es/line/shaders/flow/flow_line_vert.glsl +83 -0
  62. package/es/line/shaders/line_arc_3d_frag.glsl +6 -6
  63. package/es/line/shaders/line_arc_3d_vert.glsl +4 -34
  64. package/es/line/shaders/line_arc_frag.glsl +7 -11
  65. package/es/line/shaders/line_arc_great_circle_frag.glsl +5 -6
  66. package/es/line/shaders/line_arc_great_circle_vert.glsl +4 -32
  67. package/es/line/shaders/line_arc_vert.glsl +9 -45
  68. package/es/line/shaders/line_frag.glsl +15 -17
  69. package/es/line/shaders/line_vert.glsl +3 -34
  70. package/es/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
  71. package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
  72. package/es/line/shaders/linear/arc_linear_frag.glsl +2 -30
  73. package/es/line/shaders/linear/arc_linear_vert.glsl +9 -45
  74. package/es/line/shaders/linear/line_linear_frag.glsl +5 -6
  75. package/es/line/shaders/linearLine/line_linear_frag.glsl +2 -14
  76. package/es/line/shaders/linearLine/line_linear_vert.glsl +14 -32
  77. package/es/line/shaders/simple/simpleline_frag.glsl +1 -5
  78. package/es/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
  79. package/es/line/shaders/simple/simpleline_vert.glsl +7 -33
  80. package/es/mask/index.js +9 -28
  81. package/es/mask/models/fill.js +29 -54
  82. package/es/plugins/DataMappingPlugin.js +90 -141
  83. package/es/plugins/DataSourcePlugin.js +45 -68
  84. package/es/plugins/FeatureScalePlugin.js +67 -122
  85. package/es/plugins/LayerAnimateStylePlugin.js +0 -5
  86. package/es/plugins/LayerMaskPlugin.js +3 -11
  87. package/es/plugins/LayerModelPlugin.js +79 -104
  88. package/es/plugins/LayerStylePlugin.js +3 -9
  89. package/es/plugins/LightingPlugin.js +12 -18
  90. package/es/plugins/MultiPassRendererPlugin.js +11 -16
  91. package/es/plugins/PixelPickingPlugin.js +12 -21
  92. package/es/plugins/RegisterStyleAttributePlugin.js +5 -12
  93. package/es/plugins/ShaderUniformPlugin.js +15 -29
  94. package/es/plugins/UpdateModelPlugin.js +0 -5
  95. package/es/plugins/UpdateStyleAttributePlugin.js +5 -11
  96. package/es/point/index.d.ts +1 -0
  97. package/es/point/index.js +27 -77
  98. package/es/point/models/earthExtrude.d.ts +0 -3
  99. package/es/point/models/earthExtrude.js +60 -139
  100. package/es/point/models/earthFill.d.ts +0 -1
  101. package/es/point/models/earthFill.js +59 -140
  102. package/es/point/models/extrude.d.ts +0 -3
  103. package/es/point/models/extrude.js +60 -140
  104. package/es/point/models/fill.d.ts +0 -1
  105. package/es/point/models/fill.js +67 -158
  106. package/es/point/models/fillmage.js +66 -147
  107. package/es/point/models/image.js +52 -126
  108. package/es/point/models/index.js +2 -2
  109. package/es/point/models/normal.js +32 -56
  110. package/es/point/models/radar.d.ts +0 -1
  111. package/es/point/models/radar.js +42 -75
  112. package/es/point/models/simplePoint.d.ts +0 -1
  113. package/es/point/models/simplePoint.js +46 -115
  114. package/es/point/models/text.js +211 -344
  115. package/es/point/shaders/animate/wave_frag.glsl +1 -11
  116. package/es/point/shaders/earth/extrude_frag.glsl +5 -17
  117. package/es/point/shaders/earth/extrude_vert.glsl +14 -29
  118. package/es/point/shaders/earth/fill_frag.glsl +5 -14
  119. package/es/point/shaders/earth/fill_vert.glsl +1 -75
  120. package/es/point/shaders/extrude/extrude_frag.glsl +3 -29
  121. package/es/point/shaders/extrude/extrude_vert.glsl +27 -35
  122. package/es/point/shaders/fill_frag.glsl +9 -20
  123. package/es/point/shaders/fill_vert.glsl +16 -101
  124. package/es/point/shaders/image/fillImage_frag.glsl +2 -5
  125. package/es/point/shaders/image/fillImage_vert.glsl +4 -47
  126. package/es/point/shaders/image_frag.glsl +1 -5
  127. package/es/point/shaders/image_vert.glsl +1 -44
  128. package/es/point/shaders/normal_frag.glsl +0 -2
  129. package/es/point/shaders/normal_vert.glsl +2 -1
  130. package/es/point/shaders/radar/radar_vert.glsl +2 -2
  131. package/es/point/shaders/simplePoint_frag.glsl +0 -7
  132. package/es/point/shaders/simplePoint_vert.glsl +3 -45
  133. package/es/point/shaders/text_frag.glsl +6 -19
  134. package/es/point/shaders/text_vert.glsl +5 -66
  135. package/es/point/shape/extrude.js +4 -13
  136. package/es/polygon/index.d.ts +1 -0
  137. package/es/polygon/index.js +12 -40
  138. package/es/polygon/models/extrude.d.ts +0 -3
  139. package/es/polygon/models/extrude.js +122 -162
  140. package/es/polygon/models/fill.d.ts +0 -4
  141. package/es/polygon/models/fill.js +57 -130
  142. package/es/polygon/models/index.js +3 -2
  143. package/es/polygon/models/ocean.js +42 -76
  144. package/es/polygon/models/water.js +37 -71
  145. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
  146. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
  147. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
  148. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
  149. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
  150. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
  151. package/es/polygon/shaders/polygon_frag.glsl +0 -5
  152. package/es/polygon/shaders/polygon_linear_frag.glsl +0 -8
  153. package/es/polygon/shaders/polygon_linear_vert.glsl +0 -32
  154. package/es/polygon/shaders/polygon_vert.glsl +1 -27
  155. package/es/raster/buffers/triangulation.js +2 -4
  156. package/es/raster/index.js +9 -32
  157. package/es/raster/models/raster.js +80 -116
  158. package/es/raster/models/rasterRgb.js +84 -127
  159. package/es/raster/models/rasterTerrainRgb.js +56 -84
  160. package/es/tile/interaction/getRasterData.js +14 -20
  161. package/es/tile/interaction/utils.js +7 -9
  162. package/es/tile/manager/base.js +63 -96
  163. package/es/tile/service/TileLayerService.js +33 -55
  164. package/es/tile/service/TilePickService.js +26 -40
  165. package/es/tile/service/TileSourceService.js +3 -7
  166. package/es/tile/tileFactory/DebugTile.js +29 -46
  167. package/es/tile/tileFactory/ImageTile.js +20 -38
  168. package/es/tile/tileFactory/MaskTile.js +22 -43
  169. package/es/tile/tileFactory/RasterRGBTile.js +22 -42
  170. package/es/tile/tileFactory/RasterTerrainRGBTile.js +20 -38
  171. package/es/tile/tileFactory/RasterTile.js +30 -53
  172. package/es/tile/tileFactory/Tile.js +63 -97
  173. package/es/tile/tileFactory/VectorTile.js +41 -68
  174. package/es/tile/tileFactory/index.js +0 -11
  175. package/es/tile/tileFactory/layers/TileDebugLayer.js +6 -27
  176. package/es/tile/tileFactory/util.js +0 -3
  177. package/es/tile/tileLayer/BaseLayer.js +105 -146
  178. package/es/tile/utils.js +1 -1
  179. package/es/utils/blend.js +0 -2
  180. package/es/utils/collision-index.js +9 -16
  181. package/es/utils/extrude_polyline.js +101 -149
  182. package/es/utils/grid-index.js +2 -27
  183. package/es/utils/identityScale.js +0 -8
  184. package/es/utils/layerData.js +32 -46
  185. package/es/utils/multiPassRender.js +11 -13
  186. package/es/utils/polylineNormal.js +31 -37
  187. package/es/utils/simpleLine.js +2 -16
  188. package/es/utils/stencil.js +2 -3
  189. package/es/utils/symbol-layout.js +27 -53
  190. package/es/wind/index.js +9 -29
  191. package/es/wind/models/utils.js +26 -51
  192. package/es/wind/models/wind.js +101 -147
  193. package/es/wind/models/windRender.js +53 -66
  194. package/lib/Geometry/index.js +9 -38
  195. package/lib/Geometry/models/billboard.js +51 -97
  196. package/lib/Geometry/models/index.js +0 -5
  197. package/lib/Geometry/models/plane.js +79 -151
  198. package/lib/Geometry/models/sprite.js +60 -127
  199. package/lib/canvas/index.js +10 -40
  200. package/lib/canvas/models/canvas.js +41 -101
  201. package/lib/canvas/models/index.js +0 -3
  202. package/lib/citybuliding/building.js +8 -35
  203. package/lib/citybuliding/models/build.js +57 -92
  204. package/lib/core/BaseLayer.js +358 -520
  205. package/lib/core/BaseModel.js +117 -441
  206. package/lib/core/CommonStyleAttribute.js +72 -0
  207. package/lib/core/LayerPickService.js +21 -37
  208. package/lib/core/TextureService.js +0 -16
  209. package/lib/core/interface.js +21 -31
  210. package/lib/core/schema.js +0 -1
  211. package/lib/core/shape/Path.js +14 -31
  212. package/lib/core/shape/extrude.js +27 -59
  213. package/lib/core/triangulation.js +125 -153
  214. package/lib/earth/index.js +9 -43
  215. package/lib/earth/models/atmosphere.js +30 -63
  216. package/lib/earth/models/base.js +47 -90
  217. package/lib/earth/models/bloomsphere.js +30 -63
  218. package/lib/earth/utils.js +7 -31
  219. package/lib/heatmap/index.js +10 -48
  220. package/lib/heatmap/models/grid.js +29 -61
  221. package/lib/heatmap/models/grid3d.js +29 -61
  222. package/lib/heatmap/models/heatmap.js +99 -166
  223. package/lib/heatmap/models/hexagon.js +29 -61
  224. package/lib/heatmap/models/index.js +0 -6
  225. package/lib/heatmap/shaders/grid_vert.glsl +2 -2
  226. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +2 -2
  227. package/lib/heatmap/shaders/hexagon_vert.glsl +2 -2
  228. package/lib/heatmap/triangulation.js +0 -5
  229. package/lib/image/index.js +9 -36
  230. package/lib/image/models/image.js +66 -109
  231. package/lib/image/models/index.js +0 -3
  232. package/lib/index.js +7 -61
  233. package/lib/line/index.js +12 -42
  234. package/lib/line/models/arc.js +70 -170
  235. package/lib/line/models/arc_3d.js +65 -159
  236. package/lib/line/models/earthArc_3d.js +64 -159
  237. package/lib/line/models/flow.js +174 -0
  238. package/lib/line/models/great_circle.js +57 -146
  239. package/lib/line/models/index.js +3 -14
  240. package/lib/line/models/line.js +96 -194
  241. package/lib/line/models/linearline.js +46 -127
  242. package/lib/line/models/simpleLine.js +42 -124
  243. package/lib/line/models/wall.js +52 -103
  244. package/lib/line/shaders/dash/arc_dash_frag.glsl +3 -6
  245. package/lib/line/shaders/dash/arc_dash_vert.glsl +6 -46
  246. package/lib/line/shaders/dash/line_dash_frag.glsl +4 -7
  247. package/lib/line/shaders/dash/line_dash_vert.glsl +3 -33
  248. package/lib/line/shaders/flow/flow_line_frag.glsl +13 -0
  249. package/lib/line/shaders/flow/flow_line_vert.glsl +83 -0
  250. package/lib/line/shaders/line_arc_3d_frag.glsl +6 -6
  251. package/lib/line/shaders/line_arc_3d_vert.glsl +4 -34
  252. package/lib/line/shaders/line_arc_frag.glsl +7 -11
  253. package/lib/line/shaders/line_arc_great_circle_frag.glsl +5 -6
  254. package/lib/line/shaders/line_arc_great_circle_vert.glsl +4 -32
  255. package/lib/line/shaders/line_arc_vert.glsl +9 -45
  256. package/lib/line/shaders/line_frag.glsl +15 -17
  257. package/lib/line/shaders/line_vert.glsl +3 -34
  258. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +5 -19
  259. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -48
  260. package/lib/line/shaders/linear/arc_linear_frag.glsl +2 -30
  261. package/lib/line/shaders/linear/arc_linear_vert.glsl +9 -45
  262. package/lib/line/shaders/linear/line_linear_frag.glsl +5 -6
  263. package/lib/line/shaders/linearLine/line_linear_frag.glsl +2 -14
  264. package/lib/line/shaders/linearLine/line_linear_vert.glsl +14 -32
  265. package/lib/line/shaders/simple/simpleline_frag.glsl +1 -5
  266. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +2 -6
  267. package/lib/line/shaders/simple/simpleline_vert.glsl +7 -33
  268. package/lib/mask/index.js +9 -36
  269. package/lib/mask/models/fill.js +29 -63
  270. package/lib/mask/models/index.js +0 -3
  271. package/lib/plugins/DataMappingPlugin.js +90 -152
  272. package/lib/plugins/DataSourcePlugin.js +45 -76
  273. package/lib/plugins/FeatureScalePlugin.js +67 -138
  274. package/lib/plugins/LayerAnimateStylePlugin.js +0 -10
  275. package/lib/plugins/LayerMaskPlugin.js +4 -17
  276. package/lib/plugins/LayerModelPlugin.js +80 -113
  277. package/lib/plugins/LayerStylePlugin.js +4 -14
  278. package/lib/plugins/LightingPlugin.js +12 -25
  279. package/lib/plugins/MultiPassRendererPlugin.js +11 -22
  280. package/lib/plugins/PixelPickingPlugin.js +12 -27
  281. package/lib/plugins/RegisterStyleAttributePlugin.js +5 -19
  282. package/lib/plugins/ShaderUniformPlugin.js +15 -36
  283. package/lib/plugins/UpdateModelPlugin.js +1 -10
  284. package/lib/plugins/UpdateStyleAttributePlugin.js +5 -16
  285. package/lib/point/index.js +27 -83
  286. package/lib/point/models/earthExtrude.js +60 -150
  287. package/lib/point/models/earthFill.js +59 -170
  288. package/lib/point/models/extrude.js +60 -150
  289. package/lib/point/models/fill.js +65 -167
  290. package/lib/point/models/fillmage.js +64 -155
  291. package/lib/point/models/image.js +52 -136
  292. package/lib/point/models/index.js +1 -12
  293. package/lib/point/models/normal.js +32 -66
  294. package/lib/point/models/radar.js +42 -85
  295. package/lib/point/models/simplePoint.js +46 -125
  296. package/lib/point/models/text.js +209 -350
  297. package/lib/point/shaders/animate/wave_frag.glsl +1 -11
  298. package/lib/point/shaders/earth/extrude_frag.glsl +5 -17
  299. package/lib/point/shaders/earth/extrude_vert.glsl +14 -29
  300. package/lib/point/shaders/earth/fill_frag.glsl +5 -14
  301. package/lib/point/shaders/earth/fill_vert.glsl +1 -75
  302. package/lib/point/shaders/extrude/extrude_frag.glsl +3 -29
  303. package/lib/point/shaders/extrude/extrude_vert.glsl +27 -35
  304. package/lib/point/shaders/fill_frag.glsl +9 -20
  305. package/lib/point/shaders/fill_vert.glsl +16 -101
  306. package/lib/point/shaders/image/fillImage_frag.glsl +2 -5
  307. package/lib/point/shaders/image/fillImage_vert.glsl +4 -47
  308. package/lib/point/shaders/image_frag.glsl +1 -5
  309. package/lib/point/shaders/image_vert.glsl +1 -44
  310. package/lib/point/shaders/normal_frag.glsl +0 -2
  311. package/lib/point/shaders/normal_vert.glsl +2 -1
  312. package/lib/point/shaders/radar/radar_vert.glsl +2 -2
  313. package/lib/point/shaders/simplePoint_frag.glsl +0 -7
  314. package/lib/point/shaders/simplePoint_vert.glsl +3 -45
  315. package/lib/point/shaders/text_frag.glsl +6 -19
  316. package/lib/point/shaders/text_vert.glsl +5 -66
  317. package/lib/point/shape/extrude.js +4 -20
  318. package/lib/polygon/index.js +12 -48
  319. package/lib/polygon/models/extrude.js +122 -173
  320. package/lib/polygon/models/fill.js +57 -140
  321. package/lib/polygon/models/index.js +2 -14
  322. package/lib/polygon/models/ocean.js +42 -88
  323. package/lib/polygon/models/water.js +37 -82
  324. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +2 -23
  325. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -5
  326. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +7 -32
  327. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +33 -38
  328. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +12 -9
  329. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +16 -44
  330. package/lib/polygon/shaders/polygon_frag.glsl +0 -5
  331. package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -8
  332. package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -32
  333. package/lib/polygon/shaders/polygon_vert.glsl +1 -27
  334. package/lib/raster/buffers/triangulation.js +3 -7
  335. package/lib/raster/index.js +9 -40
  336. package/lib/raster/models/index.js +0 -5
  337. package/lib/raster/models/raster.js +80 -125
  338. package/lib/raster/models/rasterRgb.js +84 -139
  339. package/lib/raster/models/rasterTerrainRgb.js +56 -93
  340. package/lib/tile/interaction/getRasterData.js +14 -25
  341. package/lib/tile/interaction/utils.js +7 -19
  342. package/lib/tile/manager/base.js +63 -104
  343. package/lib/tile/service/TileLayerService.js +33 -60
  344. package/lib/tile/service/TilePickService.js +26 -48
  345. package/lib/tile/service/TileSourceService.js +2 -16
  346. package/lib/tile/style/utils.js +0 -3
  347. package/lib/tile/tileFactory/DebugTile.js +29 -54
  348. package/lib/tile/tileFactory/ImageTile.js +20 -46
  349. package/lib/tile/tileFactory/MaskTile.js +22 -51
  350. package/lib/tile/tileFactory/RasterRGBTile.js +22 -50
  351. package/lib/tile/tileFactory/RasterTerrainRGBTile.js +20 -46
  352. package/lib/tile/tileFactory/RasterTile.js +30 -63
  353. package/lib/tile/tileFactory/Tile.js +63 -102
  354. package/lib/tile/tileFactory/VectorTile.js +41 -76
  355. package/lib/tile/tileFactory/index.js +0 -25
  356. package/lib/tile/tileFactory/layers/TileDebugLayer.js +6 -32
  357. package/lib/tile/tileFactory/util.js +0 -9
  358. package/lib/tile/tileLayer/BaseLayer.js +105 -153
  359. package/lib/tile/utils.js +1 -5
  360. package/lib/utils/blend.js +0 -5
  361. package/lib/utils/collision-index.js +9 -25
  362. package/lib/utils/extrude_polyline.js +101 -181
  363. package/lib/utils/grid-index.js +2 -28
  364. package/lib/utils/identityScale.js +0 -9
  365. package/lib/utils/layerData.js +32 -51
  366. package/lib/utils/multiPassRender.js +11 -16
  367. package/lib/utils/polylineNormal.js +31 -66
  368. package/lib/utils/simpleLine.js +2 -21
  369. package/lib/utils/stencil.js +0 -4
  370. package/lib/utils/symbol-layout.js +27 -55
  371. package/lib/wind/index.js +9 -37
  372. package/lib/wind/models/index.js +0 -3
  373. package/lib/wind/models/utils.js +26 -62
  374. package/lib/wind/models/wind.js +101 -157
  375. package/lib/wind/models/windRender.js +53 -71
  376. package/lib/wind/models/windShader.js +0 -1
  377. package/package.json +7 -7
  378. package/es/line/models/half.js +0 -298
  379. package/es/line/shaders/half/line_half_frag.glsl +0 -53
  380. package/es/line/shaders/half/line_half_vert.glsl +0 -169
  381. package/es/utils/dataMappingStyle.d.ts +0 -31
  382. package/es/utils/dataMappingStyle.js +0 -147
  383. package/lib/line/models/half.js +0 -315
  384. package/lib/line/shaders/half/line_half_frag.glsl +0 -53
  385. package/lib/line/shaders/half/line_half_vert.glsl +0 -169
  386. package/lib/utils/dataMappingStyle.js +0 -151
@@ -1,14 +1,15 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import { calculateCentroid, calculatePointsCenterAndRadius, lngLatToMeters } from '@antv/l7-utils';
4
- import earcut from 'earcut'; // @ts-ignore
5
-
4
+ import earcut from 'earcut';
5
+ // @ts-ignore
6
6
  import { vec3 } from 'gl-matrix';
7
7
  import { EARTH_RADIUS, EARTH_RADIUS_OUTER, EARTH_SEGMENTS, lglt2xyz, primitiveSphere } from "../earth/utils";
8
8
  import ExtrudePolyline from "../utils/extrude_polyline";
9
9
  import extrudePolygon, { extrude_PolygonNormal, fillPolygon } from "./shape/extrude";
10
10
  import { geometryShape } from "./shape/Path";
11
11
  var GeometryCache = {};
12
+
12
13
  /**
13
14
  * 计算2D 填充点图顶点
14
15
  * @param feature 映射feature
@@ -26,7 +27,6 @@ export function PointFillTriangulation(feature) {
26
27
  * 计算2D 填充点图顶点 (地球模式)
27
28
  * @param feature 映射feature
28
29
  */
29
-
30
30
  export function GlobelPointFillTriangulation(feature) {
31
31
  var coordinates = calculateCentroid(feature.coordinates);
32
32
  var xyz = lglt2xyz(coordinates);
@@ -36,19 +36,17 @@ export function GlobelPointFillTriangulation(feature) {
36
36
  size: xyz.length
37
37
  };
38
38
  }
39
+
39
40
  /**
40
41
  * 计算3D 拉伸点图
41
42
  * @param feature 映射feature
42
43
  */
43
-
44
44
  export function PointExtrudeTriangulation(feature) {
45
45
  var shape = feature.shape;
46
-
47
46
  var _getGeometry = getGeometry(shape, false),
48
- positions = _getGeometry.positions,
49
- index = _getGeometry.index,
50
- normals = _getGeometry.normals;
51
-
47
+ positions = _getGeometry.positions,
48
+ index = _getGeometry.index,
49
+ normals = _getGeometry.normals;
52
50
  return {
53
51
  vertices: positions,
54
52
  indices: index,
@@ -56,11 +54,11 @@ export function PointExtrudeTriangulation(feature) {
56
54
  size: 5
57
55
  };
58
56
  }
57
+
59
58
  /**
60
59
  * 计算图片标注
61
60
  * @param feature 映射feature
62
61
  */
63
-
64
62
  export function PointImageTriangulation(feature) {
65
63
  var coordinates = calculateCentroid(feature.coordinates);
66
64
  return {
@@ -69,15 +67,16 @@ export function PointImageTriangulation(feature) {
69
67
  size: coordinates.length
70
68
  };
71
69
  }
70
+
72
71
  /**
73
72
  * 线三角化
74
73
  * @param feature 映射feature
75
74
  */
76
-
77
75
  export function LineTriangulation(feature) {
78
76
  var coordinates = feature.coordinates,
79
- originCoordinates = feature.originCoordinates,
80
- version = feature.version; // let path = coordinates as number[][][] | number[][];
77
+ originCoordinates = feature.originCoordinates,
78
+ version = feature.version;
79
+ // let path = coordinates as number[][][] | number[][];
81
80
  // if (!Array.isArray(path[0][0])) {
82
81
  // path = [coordinates] as number[][][];
83
82
  // }
@@ -86,21 +85,16 @@ export function LineTriangulation(feature) {
86
85
  dash: true,
87
86
  join: 'bevel'
88
87
  });
89
-
90
88
  if (version === 'GAODE2.x') {
91
89
  // 处理高德2.0几何体构建
92
90
  var path1 = coordinates; // 计算位置
93
-
94
91
  if (!Array.isArray(path1[0][0])) {
95
92
  path1 = [coordinates];
96
93
  }
97
-
98
94
  var path2 = originCoordinates; // 计算法线
99
-
100
95
  if (!Array.isArray(path2[0][0])) {
101
96
  path2 = [originCoordinates];
102
97
  }
103
-
104
98
  for (var i = 0; i < path1.length; i++) {
105
99
  // 高德2.0在计算线时,需要使用经纬度计算发现,使用 customCoords.lnglatToCoords 计算的数据来计算顶点的位置
106
100
  var item1 = path1[i];
@@ -110,16 +104,13 @@ export function LineTriangulation(feature) {
110
104
  } else {
111
105
  // 处理非高德2.0的几何体构建
112
106
  var path = coordinates;
113
-
114
107
  if (path[0] && !Array.isArray(path[0][0])) {
115
108
  path = [coordinates];
116
109
  }
117
-
118
110
  path.forEach(function (item) {
119
111
  line.extrude(item);
120
112
  });
121
113
  }
122
-
123
114
  var linebuffer = line.complex;
124
115
  return {
125
116
  vertices: linebuffer.positions,
@@ -130,10 +121,79 @@ export function LineTriangulation(feature) {
130
121
  size: 6
131
122
  };
132
123
  }
124
+ export function FlowLineFillTriangulation(feature) {
125
+ // @ts-ignore
126
+ var coord = feature.coordinates.flat();
127
+ var tin = 1;
128
+ var tout = 1.0;
129
+ return {
130
+ vertices: [1, 0, 0].concat(_toConsumableArray(coord), [
131
+ // 0
132
+ 1, 2, -3], _toConsumableArray(coord), [
133
+ // 1
134
+ 1, 1, -3], _toConsumableArray(coord), [
135
+ // 2
136
+ 0, 1, 0], _toConsumableArray(coord), [
137
+ // 3
138
+ 0, 0, 0], _toConsumableArray(coord), [
139
+ // 4
140
+ 1, 0, 0], _toConsumableArray(coord), [
141
+ // 0
142
+ 1, 2, -3], _toConsumableArray(coord), [
143
+ // 1
144
+ 1, 1, -3], _toConsumableArray(coord), [
145
+ // 2
146
+ 0, 1, 0], _toConsumableArray(coord), [
147
+ // 3
148
+ 0, 0, 0], _toConsumableArray(coord)),
149
+ normals: [-tin, 2 * tout, 1,
150
+ // 0
151
+ 2 * tout, -tout, 1,
152
+ // 1
153
+ tout, -tout, 1,
154
+ // 2
155
+ tout, -tout, 1,
156
+ // 3
157
+ -tin, -tout, 1,
158
+ // 4
159
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
160
+ indices: [0, 1, 2, 0, 2, 3, 0, 3, 4, 5, 6, 7, 5, 7, 8, 5, 8, 9],
161
+ size: 7
162
+ };
163
+ }
164
+ export function FlowLineStrokeTriangulation(feature) {
165
+ // @ts-ignore
166
+ var coord = feature.coordinates.flat();
167
+ var tin = 1;
168
+ var tout = 1;
169
+ return {
170
+ vertices: [1, 0, 0].concat(_toConsumableArray(coord), [
171
+ // 0
172
+ 1, 2, -3], _toConsumableArray(coord), [
173
+ // 1
174
+ 1, 1, -3], _toConsumableArray(coord), [
175
+ // 2
176
+ 0, 1, 0], _toConsumableArray(coord), [
177
+ // 3
178
+ 0, 0, 0], _toConsumableArray(coord)),
179
+ normals: [-tin, 2 * tout, 1,
180
+ // 0
181
+ 2 * tout, -tout, 1,
182
+ // 1
183
+ tout, -tout, 1,
184
+ // 2
185
+ tout, -tout, 1,
186
+ // 3
187
+ -tin, -tout, 1 // 4
188
+ ],
189
+
190
+ indices: [0, 1, 1, 2, 2, 3, 3, 4, 4, 0],
191
+ size: 7
192
+ };
193
+ }
133
194
  export function SimpleLineTriangulation(feature) {
134
195
  var coordinates = feature.coordinates;
135
196
  var pos = [];
136
-
137
197
  if (!Array.isArray(coordinates[0])) {
138
198
  return {
139
199
  vertices: [],
@@ -143,11 +203,9 @@ export function SimpleLineTriangulation(feature) {
143
203
  count: 0
144
204
  };
145
205
  }
146
-
147
206
  var _getSimpleLineVertice = getSimpleLineVertices(coordinates),
148
- results = _getSimpleLineVertice.results,
149
- totalDistance = _getSimpleLineVertice.totalDistance;
150
-
207
+ results = _getSimpleLineVertice.results,
208
+ totalDistance = _getSimpleLineVertice.totalDistance;
151
209
  results.map(function (point) {
152
210
  pos.push(point[0], point[1], point[2], point[3], 0, totalDistance);
153
211
  });
@@ -162,7 +220,6 @@ export function SimpleLineTriangulation(feature) {
162
220
  export function TileSimpleLineTriangulation(feature) {
163
221
  var coordinates = feature.coordinates;
164
222
  var pos = [];
165
-
166
223
  if (!Array.isArray(coordinates[0])) {
167
224
  return {
168
225
  vertices: [],
@@ -171,10 +228,8 @@ export function TileSimpleLineTriangulation(feature) {
171
228
  count: 0
172
229
  };
173
230
  }
174
-
175
231
  var _getTileSimpleLineVer = getTileSimpleLineVertices(coordinates),
176
- results = _getTileSimpleLineVer.results;
177
-
232
+ results = _getTileSimpleLineVer.results;
178
233
  results.map(function (point) {
179
234
  pos.push(point[0], point[1], point[2], point[3]);
180
235
  });
@@ -185,35 +240,27 @@ export function TileSimpleLineTriangulation(feature) {
185
240
  count: results.length
186
241
  };
187
242
  }
188
-
189
243
  function lineSegmentDistance(b1, a1) {
190
244
  var dx = a1[0] - b1[0];
191
245
  var dy = a1[1] - b1[1];
192
246
  return Math.sqrt(dx * dx + dy * dy);
193
247
  }
194
-
195
248
  function pushDis(point, n) {
196
249
  if (point.length < 3) {
197
250
  point.push(0);
198
251
  }
199
-
200
252
  if (n !== undefined) {
201
253
  point.push(n);
202
254
  }
203
-
204
255
  return point;
205
256
  }
206
-
207
257
  function getSimpleLineVertices(coordinates) {
208
258
  var points = coordinates;
209
-
210
259
  if (Array.isArray(points) && Array.isArray(points[0]) && Array.isArray(points[0][0])) {
211
260
  // @ts-ignore
212
261
  points = coordinates.flat();
213
262
  }
214
-
215
263
  var distance = 0;
216
-
217
264
  if (points.length < 2) {
218
265
  return {
219
266
  results: points,
@@ -223,7 +270,6 @@ function getSimpleLineVertices(coordinates) {
223
270
  var results = [];
224
271
  var point = pushDis(points[0], distance);
225
272
  results.push(point);
226
-
227
273
  for (var i = 1; i < points.length - 1; i++) {
228
274
  var subDistance = lineSegmentDistance(points[i - 1], points[i]);
229
275
  distance += subDistance;
@@ -231,7 +277,6 @@ function getSimpleLineVertices(coordinates) {
231
277
  results.push(mulPoint);
232
278
  results.push(mulPoint);
233
279
  }
234
-
235
280
  var pointDistance = lineSegmentDistance(points[points.length - 2], points[points.length - 1]);
236
281
  distance += pointDistance;
237
282
  results.push(pushDis(points[points.length - 1], distance));
@@ -241,7 +286,6 @@ function getSimpleLineVertices(coordinates) {
241
286
  };
242
287
  }
243
288
  }
244
-
245
289
  function getTileSimpleLineVertices(points) {
246
290
  if (points.length < 2) {
247
291
  return {
@@ -251,70 +295,61 @@ function getTileSimpleLineVertices(points) {
251
295
  var results = [];
252
296
  var point = pushDis(points[0]);
253
297
  results.push(point);
254
-
255
298
  for (var i = 1; i < points.length - 1; i++) {
256
299
  var mulPoint = pushDis(points[i]);
257
300
  results.push(mulPoint);
258
301
  results.push(mulPoint);
259
302
  }
260
-
261
303
  results.push(pushDis(points[points.length - 1]));
262
304
  return {
263
305
  results: results
264
306
  };
265
307
  }
266
308
  }
267
-
268
309
  export function polygonTriangulation(feature) {
269
310
  var coordinates = feature.coordinates;
270
311
  var flattengeo = earcut.flatten(coordinates);
271
312
  var vertices = flattengeo.vertices,
272
- dimensions = flattengeo.dimensions,
273
- holes = flattengeo.holes;
313
+ dimensions = flattengeo.dimensions,
314
+ holes = flattengeo.holes;
274
315
  return {
275
316
  indices: earcut(vertices, holes, dimensions),
276
317
  vertices: vertices,
277
318
  size: dimensions
278
319
  };
279
- } // 构建几何图形(带有中心点和大小)
320
+ }
280
321
 
322
+ // 构建几何图形(带有中心点和大小)
281
323
  export function polygonTriangulationWithCenter(feature) {
282
324
  var coordinates = feature.coordinates;
283
325
  var flattengeo = earcut.flatten(coordinates);
284
326
  var vertices = flattengeo.vertices,
285
- dimensions = flattengeo.dimensions,
286
- holes = flattengeo.holes;
327
+ dimensions = flattengeo.dimensions,
328
+ holes = flattengeo.holes;
287
329
  return {
288
330
  indices: earcut(vertices, holes, dimensions),
289
331
  vertices: getVerticesWithCenter(vertices),
290
332
  size: dimensions + 4
291
333
  };
292
334
  }
293
-
294
335
  function getVerticesWithCenter(vertices) {
295
336
  var verticesWithCenter = [];
296
-
297
337
  var _calculatePointsCente = calculatePointsCenterAndRadius(vertices),
298
- center = _calculatePointsCente.center,
299
- radius = _calculatePointsCente.radius;
300
-
338
+ center = _calculatePointsCente.center,
339
+ radius = _calculatePointsCente.radius;
301
340
  for (var i = 0; i < vertices.length; i += 2) {
302
341
  var lng = vertices[i];
303
342
  var lat = vertices[i + 1];
304
343
  verticesWithCenter.push.apply(verticesWithCenter, [lng, lat, 0].concat(_toConsumableArray(center), [radius]));
305
344
  }
306
-
307
345
  return verticesWithCenter;
308
346
  }
309
-
310
347
  export function PolygonExtrudeTriangulation(feature) {
311
348
  var coordinates = feature.coordinates;
312
-
313
349
  var _extrude_PolygonNorma = extrude_PolygonNormal(coordinates, true),
314
- positions = _extrude_PolygonNorma.positions,
315
- index = _extrude_PolygonNorma.index,
316
- normals = _extrude_PolygonNorma.normals;
317
-
350
+ positions = _extrude_PolygonNorma.positions,
351
+ index = _extrude_PolygonNorma.index,
352
+ normals = _extrude_PolygonNorma.normals;
318
353
  return {
319
354
  vertices: positions,
320
355
  // [ x, y, z, uv.x,uv.y ]
@@ -325,11 +360,9 @@ export function PolygonExtrudeTriangulation(feature) {
325
360
  }
326
361
  export function HeatmapGridTriangulation(feature) {
327
362
  var shape = feature.shape;
328
-
329
363
  var _getHeatmapGeometry = getHeatmapGeometry(shape),
330
- positions = _getHeatmapGeometry.positions,
331
- index = _getHeatmapGeometry.index;
332
-
364
+ positions = _getHeatmapGeometry.positions,
365
+ index = _getHeatmapGeometry.index;
333
366
  return {
334
367
  vertices: positions,
335
368
  // [ x, y, z ] 多边形顶点
@@ -337,14 +370,14 @@ export function HeatmapGridTriangulation(feature) {
337
370
  size: 3
338
371
  };
339
372
  }
373
+
340
374
  /**
341
375
  * 图片图层顶点构造
342
376
  * @param feature 数据
343
377
  */
344
-
345
378
  export function RasterImageTriangulation(feature) {
346
- var coordinates = feature.coordinates; // [ x, y, z. uv.x, uv.y]
347
-
379
+ var coordinates = feature.coordinates;
380
+ // [ x, y, z. uv.x, uv.y]
348
381
  var positions = [].concat(_toConsumableArray(coordinates[0]), [0, 0, 1, coordinates[1][0], coordinates[0][1], 0, 1, 1], _toConsumableArray(coordinates[1]), [0, 1, 0], _toConsumableArray(coordinates[0]), [0, 0, 1], _toConsumableArray(coordinates[1]), [0, 1, 0, coordinates[0][0], coordinates[1][1], 0, 0, 0]);
349
382
  var indexs = [0, 1, 2, 3, 4, 5];
350
383
  return {
@@ -353,58 +386,52 @@ export function RasterImageTriangulation(feature) {
353
386
  size: 5
354
387
  };
355
388
  }
389
+
356
390
  /**
357
391
  * 计算3D弧线顶点
358
392
  * @param feature 映射数据
359
393
  * @param segNum 弧线线段数
360
394
  */
361
-
362
395
  export function LineArcTriangulation(feature, segmentNumber) {
363
396
  var segNum = segmentNumber ? segmentNumber : 30;
364
397
  var coordinates = feature.coordinates;
365
398
  var positions = [];
366
399
  var indexArray = [];
367
-
368
400
  var _loop = function _loop(i) {
369
401
  // 上线两个顶点
370
402
  // [ x, y, z, sx,sy, tx,ty]
371
403
  positions.push(i, 1, i, coordinates[0][0], coordinates[0][1], coordinates[1][0], coordinates[1][1], i, -1, i, coordinates[0][0], coordinates[0][1], coordinates[1][0], coordinates[1][1]);
372
-
373
404
  if (i !== segNum - 1) {
374
405
  indexArray.push.apply(indexArray, _toConsumableArray([0, 1, 2, 1, 3, 2].map(function (v) {
375
406
  return i * 2 + v;
376
407
  })));
377
408
  }
378
409
  };
379
-
380
410
  for (var i = 0; i < segNum; i++) {
381
411
  _loop(i);
382
412
  }
383
-
384
413
  return {
385
414
  vertices: positions,
386
415
  indices: indexArray,
387
416
  size: 7
388
417
  };
389
418
  }
419
+
390
420
  /**
391
421
  * 构建热力图密度图的顶点
392
422
  * @param feature
393
423
  * @returns
394
424
  */
395
-
396
425
  export function HeatmapTriangulation(feature) {
397
426
  var coordinates = feature.coordinates;
398
-
399
427
  if (coordinates.length === 2) {
400
428
  coordinates.push(0);
401
429
  }
402
-
403
430
  var dir = addDir(-1, 1);
404
431
  var dir1 = addDir(1, 1);
405
432
  var dir2 = addDir(-1, -1);
406
- var dir3 = addDir(1, -1); // [x,y,z, dirx ,diry, weight]
407
-
433
+ var dir3 = addDir(1, -1);
434
+ // [x,y,z, dirx ,diry, weight]
408
435
  var positions = [].concat(_toConsumableArray(coordinates), _toConsumableArray(dir), _toConsumableArray(coordinates), _toConsumableArray(dir2), _toConsumableArray(coordinates), _toConsumableArray(dir3), _toConsumableArray(coordinates), _toConsumableArray(dir1));
409
436
  var indexArray = [0, 1, 2, 3, 0, 2];
410
437
  return {
@@ -413,24 +440,21 @@ export function HeatmapTriangulation(feature) {
413
440
  size: 5
414
441
  };
415
442
  }
443
+
416
444
  /**
417
445
  * 点图层3d geomerty
418
446
  * @param shape 3D形状
419
447
  */
420
-
421
448
  function getGeometry(shape) {
422
449
  var needFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
423
-
424
450
  if (GeometryCache && GeometryCache[shape]) {
425
451
  return GeometryCache[shape];
426
452
  }
427
-
428
453
  var path = geometryShape[shape] ? geometryShape[shape]() : geometryShape.cylinder();
429
454
  var geometry = extrude_PolygonNormal([path], needFlat);
430
455
  GeometryCache[shape] = geometry;
431
456
  return geometry;
432
457
  }
433
-
434
458
  export function computeVertexNormals(positions, indexArray) {
435
459
  var dim = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
436
460
  var needFlat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
@@ -441,7 +465,6 @@ export function computeVertexNormals(positions, indexArray) {
441
465
  var cb = vec3.create();
442
466
  var ab = vec3.create();
443
467
  var normal = vec3.create();
444
-
445
468
  for (var i = 0, li = indexArray.length; i < li; i += 3) {
446
469
  vA = indexArray[i + 0] * 3;
447
470
  vB = indexArray[i + 1] * 3;
@@ -449,32 +472,25 @@ export function computeVertexNormals(positions, indexArray) {
449
472
  var p1 = [positions[vA], positions[vA + 1]];
450
473
  var p2 = [positions[vB], positions[vB + 1]];
451
474
  var p3 = [positions[vC], positions[vC + 1]];
452
-
453
475
  if (needFlat) {
454
476
  p1 = lngLatToMeters(p1);
455
477
  p2 = lngLatToMeters(p2);
456
478
  p3 = lngLatToMeters(p3);
457
479
  }
458
-
459
480
  var _p = p1,
460
- _p2 = _slicedToArray(_p, 2),
461
- ax = _p2[0],
462
- ay = _p2[1];
463
-
481
+ _p2 = _slicedToArray(_p, 2),
482
+ ax = _p2[0],
483
+ ay = _p2[1];
464
484
  var pA = vec3.fromValues(ax, ay, positions[vA + 2]);
465
-
466
485
  var _p3 = p2,
467
- _p4 = _slicedToArray(_p3, 2),
468
- bx = _p4[0],
469
- by = _p4[1];
470
-
486
+ _p4 = _slicedToArray(_p3, 2),
487
+ bx = _p4[0],
488
+ by = _p4[1];
471
489
  var pB = vec3.fromValues(bx, by, positions[vB + 2]);
472
-
473
490
  var _p5 = p3,
474
- _p6 = _slicedToArray(_p5, 2),
475
- cx = _p6[0],
476
- cy = _p6[1];
477
-
491
+ _p6 = _slicedToArray(_p5, 2),
492
+ cx = _p6[0],
493
+ cy = _p6[1];
478
494
  var pC = vec3.fromValues(cx, cy, positions[vC + 2]);
479
495
  vec3.sub(cb, pC, pB);
480
496
  vec3.sub(ab, pA, pB);
@@ -489,11 +505,9 @@ export function computeVertexNormals(positions, indexArray) {
489
505
  normals[vC + 1] += cb[1];
490
506
  normals[vC + 2] += cb[2];
491
507
  }
492
-
493
508
  normalizeNormals(normals);
494
509
  return normals;
495
510
  }
496
-
497
511
  function normalizeNormals(normals) {
498
512
  for (var i = 0, li = normals.length; i < li; i += 3) {
499
513
  var normal = vec3.fromValues(normals[i], normals[i + 1], normals[i + 2]);
@@ -502,40 +516,36 @@ function normalizeNormals(normals) {
502
516
  normals.set(newNormal, i);
503
517
  }
504
518
  }
505
-
506
519
  export function checkIsClosed(points) {
507
520
  var p1 = points[0][0];
508
521
  var p2 = points[0][points[0].length - 1];
509
522
  return p1[0] === p2[0] && p1[1] === p2[1];
510
523
  }
511
-
512
524
  function getHeatmapGeometry(shape) {
513
525
  var shape3d = ['cylinder', 'triangleColumn', 'hexagonColumn', 'squareColumn'];
514
526
  var path = geometryShape[shape] ? geometryShape[shape]() : geometryShape.circle();
515
- var geometry = shape3d.indexOf(shape) === -1 ? fillPolygon([path]) : extrudePolygon([path]); // const geometry = fillPolygon([path]);
516
-
527
+ var geometry = shape3d.indexOf(shape) === -1 ? fillPolygon([path]) : extrudePolygon([path]);
528
+ // const geometry = fillPolygon([path]);
517
529
  return geometry;
518
- } // 热力图计算范围
519
-
520
-
530
+ }
531
+ // 热力图计算范围
521
532
  function addDir(dirX, dirY) {
522
533
  var x = (dirX + 1) / 2;
523
534
  var y = (dirY + 1) / 2;
524
535
  return [x, y];
525
536
  }
537
+
526
538
  /**
527
539
  * 构建地球三角网格
528
540
  * @returns
529
541
  */
530
-
531
-
532
542
  export function earthTriangulation() {
533
543
  var earthmesh = primitiveSphere(EARTH_RADIUS, {
534
544
  segments: EARTH_SEGMENTS
535
545
  });
536
546
  var positionsArr = earthmesh.positionsArr,
537
- indicesArr = earthmesh.indicesArr,
538
- normalArr = earthmesh.normalArr;
547
+ indicesArr = earthmesh.indicesArr,
548
+ normalArr = earthmesh.normalArr;
539
549
  return {
540
550
  vertices: positionsArr,
541
551
  indices: indicesArr,
@@ -548,8 +558,8 @@ export function earthOuterTriangulation() {
548
558
  segments: EARTH_SEGMENTS
549
559
  });
550
560
  var positionsArr = earthmesh.positionsArr,
551
- indicesArr = earthmesh.indicesArr,
552
- normalArr = earthmesh.normalArr;
561
+ indicesArr = earthmesh.indicesArr,
562
+ normalArr = earthmesh.normalArr;
553
563
  return {
554
564
  vertices: positionsArr,
555
565
  indices: indicesArr,