@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,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
8
+ exports.FlowLineFillTriangulation = FlowLineFillTriangulation;
9
+ exports.FlowLineStrokeTriangulation = FlowLineStrokeTriangulation;
10
10
  exports.GlobelPointFillTriangulation = GlobelPointFillTriangulation;
11
11
  exports.HeatmapGridTriangulation = HeatmapGridTriangulation;
12
12
  exports.HeatmapTriangulation = HeatmapTriangulation;
@@ -25,31 +25,21 @@ exports.earthOuterTriangulation = earthOuterTriangulation;
25
25
  exports.earthTriangulation = earthTriangulation;
26
26
  exports.polygonTriangulation = polygonTriangulation;
27
27
  exports.polygonTriangulationWithCenter = polygonTriangulationWithCenter;
28
-
29
28
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
30
-
31
29
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
32
-
33
30
  var _l7Utils = require("@antv/l7-utils");
34
-
35
31
  var _earcut = _interopRequireDefault(require("earcut"));
36
-
37
32
  var _glMatrix = require("gl-matrix");
38
-
39
33
  var _utils = require("../earth/utils");
40
-
41
34
  var _extrude_polyline = _interopRequireDefault(require("../utils/extrude_polyline"));
42
-
43
35
  var _extrude = _interopRequireWildcard(require("./shape/extrude"));
44
-
45
36
  var _Path = require("./shape/Path");
46
-
47
37
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
48
-
49
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
50
-
51
39
  // @ts-ignore
40
+
52
41
  var GeometryCache = {};
42
+
53
43
  /**
54
44
  * 计算2D 填充点图顶点
55
45
  * @param feature 映射feature
@@ -67,8 +57,6 @@ function PointFillTriangulation(feature) {
67
57
  * 计算2D 填充点图顶点 (地球模式)
68
58
  * @param feature 映射feature
69
59
  */
70
-
71
-
72
60
  function GlobelPointFillTriangulation(feature) {
73
61
  var coordinates = (0, _l7Utils.calculateCentroid)(feature.coordinates);
74
62
  var xyz = (0, _utils.lglt2xyz)(coordinates);
@@ -78,20 +66,17 @@ function GlobelPointFillTriangulation(feature) {
78
66
  size: xyz.length
79
67
  };
80
68
  }
69
+
81
70
  /**
82
71
  * 计算3D 拉伸点图
83
72
  * @param feature 映射feature
84
73
  */
85
-
86
-
87
74
  function PointExtrudeTriangulation(feature) {
88
75
  var shape = feature.shape;
89
-
90
76
  var _getGeometry = getGeometry(shape, false),
91
- positions = _getGeometry.positions,
92
- index = _getGeometry.index,
93
- normals = _getGeometry.normals;
94
-
77
+ positions = _getGeometry.positions,
78
+ index = _getGeometry.index,
79
+ normals = _getGeometry.normals;
95
80
  return {
96
81
  vertices: positions,
97
82
  indices: index,
@@ -99,12 +84,11 @@ function PointExtrudeTriangulation(feature) {
99
84
  size: 5
100
85
  };
101
86
  }
87
+
102
88
  /**
103
89
  * 计算图片标注
104
90
  * @param feature 映射feature
105
91
  */
106
-
107
-
108
92
  function PointImageTriangulation(feature) {
109
93
  var coordinates = (0, _l7Utils.calculateCentroid)(feature.coordinates);
110
94
  return {
@@ -113,16 +97,16 @@ function PointImageTriangulation(feature) {
113
97
  size: coordinates.length
114
98
  };
115
99
  }
100
+
116
101
  /**
117
102
  * 线三角化
118
103
  * @param feature 映射feature
119
104
  */
120
-
121
-
122
105
  function LineTriangulation(feature) {
123
106
  var coordinates = feature.coordinates,
124
- originCoordinates = feature.originCoordinates,
125
- version = feature.version; // let path = coordinates as number[][][] | number[][];
107
+ originCoordinates = feature.originCoordinates,
108
+ version = feature.version;
109
+ // let path = coordinates as number[][][] | number[][];
126
110
  // if (!Array.isArray(path[0][0])) {
127
111
  // path = [coordinates] as number[][][];
128
112
  // }
@@ -131,21 +115,16 @@ function LineTriangulation(feature) {
131
115
  dash: true,
132
116
  join: 'bevel'
133
117
  });
134
-
135
118
  if (version === 'GAODE2.x') {
136
119
  // 处理高德2.0几何体构建
137
120
  var path1 = coordinates; // 计算位置
138
-
139
121
  if (!Array.isArray(path1[0][0])) {
140
122
  path1 = [coordinates];
141
123
  }
142
-
143
124
  var path2 = originCoordinates; // 计算法线
144
-
145
125
  if (!Array.isArray(path2[0][0])) {
146
126
  path2 = [originCoordinates];
147
127
  }
148
-
149
128
  for (var i = 0; i < path1.length; i++) {
150
129
  // 高德2.0在计算线时,需要使用经纬度计算发现,使用 customCoords.lnglatToCoords 计算的数据来计算顶点的位置
151
130
  var item1 = path1[i];
@@ -155,16 +134,13 @@ function LineTriangulation(feature) {
155
134
  } else {
156
135
  // 处理非高德2.0的几何体构建
157
136
  var path = coordinates;
158
-
159
137
  if (path[0] && !Array.isArray(path[0][0])) {
160
138
  path = [coordinates];
161
139
  }
162
-
163
140
  path.forEach(function (item) {
164
141
  line.extrude(item);
165
142
  });
166
143
  }
167
-
168
144
  var linebuffer = line.complex;
169
145
  return {
170
146
  vertices: linebuffer.positions,
@@ -175,11 +151,79 @@ function LineTriangulation(feature) {
175
151
  size: 6
176
152
  };
177
153
  }
178
-
154
+ function FlowLineFillTriangulation(feature) {
155
+ // @ts-ignore
156
+ var coord = feature.coordinates.flat();
157
+ var tin = 1;
158
+ var tout = 1.0;
159
+ return {
160
+ vertices: [1, 0, 0].concat((0, _toConsumableArray2.default)(coord), [
161
+ // 0
162
+ 1, 2, -3], (0, _toConsumableArray2.default)(coord), [
163
+ // 1
164
+ 1, 1, -3], (0, _toConsumableArray2.default)(coord), [
165
+ // 2
166
+ 0, 1, 0], (0, _toConsumableArray2.default)(coord), [
167
+ // 3
168
+ 0, 0, 0], (0, _toConsumableArray2.default)(coord), [
169
+ // 4
170
+ 1, 0, 0], (0, _toConsumableArray2.default)(coord), [
171
+ // 0
172
+ 1, 2, -3], (0, _toConsumableArray2.default)(coord), [
173
+ // 1
174
+ 1, 1, -3], (0, _toConsumableArray2.default)(coord), [
175
+ // 2
176
+ 0, 1, 0], (0, _toConsumableArray2.default)(coord), [
177
+ // 3
178
+ 0, 0, 0], (0, _toConsumableArray2.default)(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,
188
+ // 4
189
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
190
+ indices: [0, 1, 2, 0, 2, 3, 0, 3, 4, 5, 6, 7, 5, 7, 8, 5, 8, 9],
191
+ size: 7
192
+ };
193
+ }
194
+ function FlowLineStrokeTriangulation(feature) {
195
+ // @ts-ignore
196
+ var coord = feature.coordinates.flat();
197
+ var tin = 1;
198
+ var tout = 1;
199
+ return {
200
+ vertices: [1, 0, 0].concat((0, _toConsumableArray2.default)(coord), [
201
+ // 0
202
+ 1, 2, -3], (0, _toConsumableArray2.default)(coord), [
203
+ // 1
204
+ 1, 1, -3], (0, _toConsumableArray2.default)(coord), [
205
+ // 2
206
+ 0, 1, 0], (0, _toConsumableArray2.default)(coord), [
207
+ // 3
208
+ 0, 0, 0], (0, _toConsumableArray2.default)(coord)),
209
+ normals: [-tin, 2 * tout, 1,
210
+ // 0
211
+ 2 * tout, -tout, 1,
212
+ // 1
213
+ tout, -tout, 1,
214
+ // 2
215
+ tout, -tout, 1,
216
+ // 3
217
+ -tin, -tout, 1 // 4
218
+ ],
219
+
220
+ indices: [0, 1, 1, 2, 2, 3, 3, 4, 4, 0],
221
+ size: 7
222
+ };
223
+ }
179
224
  function SimpleLineTriangulation(feature) {
180
225
  var coordinates = feature.coordinates;
181
226
  var pos = [];
182
-
183
227
  if (!Array.isArray(coordinates[0])) {
184
228
  return {
185
229
  vertices: [],
@@ -189,11 +233,9 @@ function SimpleLineTriangulation(feature) {
189
233
  count: 0
190
234
  };
191
235
  }
192
-
193
236
  var _getSimpleLineVertice = getSimpleLineVertices(coordinates),
194
- results = _getSimpleLineVertice.results,
195
- totalDistance = _getSimpleLineVertice.totalDistance;
196
-
237
+ results = _getSimpleLineVertice.results,
238
+ totalDistance = _getSimpleLineVertice.totalDistance;
197
239
  results.map(function (point) {
198
240
  pos.push(point[0], point[1], point[2], point[3], 0, totalDistance);
199
241
  });
@@ -205,11 +247,9 @@ function SimpleLineTriangulation(feature) {
205
247
  count: results.length
206
248
  };
207
249
  }
208
-
209
250
  function TileSimpleLineTriangulation(feature) {
210
251
  var coordinates = feature.coordinates;
211
252
  var pos = [];
212
-
213
253
  if (!Array.isArray(coordinates[0])) {
214
254
  return {
215
255
  vertices: [],
@@ -218,10 +258,8 @@ function TileSimpleLineTriangulation(feature) {
218
258
  count: 0
219
259
  };
220
260
  }
221
-
222
261
  var _getTileSimpleLineVer = getTileSimpleLineVertices(coordinates),
223
- results = _getTileSimpleLineVer.results;
224
-
262
+ results = _getTileSimpleLineVer.results;
225
263
  results.map(function (point) {
226
264
  pos.push(point[0], point[1], point[2], point[3]);
227
265
  });
@@ -232,35 +270,27 @@ function TileSimpleLineTriangulation(feature) {
232
270
  count: results.length
233
271
  };
234
272
  }
235
-
236
273
  function lineSegmentDistance(b1, a1) {
237
274
  var dx = a1[0] - b1[0];
238
275
  var dy = a1[1] - b1[1];
239
276
  return Math.sqrt(dx * dx + dy * dy);
240
277
  }
241
-
242
278
  function pushDis(point, n) {
243
279
  if (point.length < 3) {
244
280
  point.push(0);
245
281
  }
246
-
247
282
  if (n !== undefined) {
248
283
  point.push(n);
249
284
  }
250
-
251
285
  return point;
252
286
  }
253
-
254
287
  function getSimpleLineVertices(coordinates) {
255
288
  var points = coordinates;
256
-
257
289
  if (Array.isArray(points) && Array.isArray(points[0]) && Array.isArray(points[0][0])) {
258
290
  // @ts-ignore
259
291
  points = coordinates.flat();
260
292
  }
261
-
262
293
  var distance = 0;
263
-
264
294
  if (points.length < 2) {
265
295
  return {
266
296
  results: points,
@@ -270,7 +300,6 @@ function getSimpleLineVertices(coordinates) {
270
300
  var results = [];
271
301
  var point = pushDis(points[0], distance);
272
302
  results.push(point);
273
-
274
303
  for (var i = 1; i < points.length - 1; i++) {
275
304
  var subDistance = lineSegmentDistance(points[i - 1], points[i]);
276
305
  distance += subDistance;
@@ -278,7 +307,6 @@ function getSimpleLineVertices(coordinates) {
278
307
  results.push(mulPoint);
279
308
  results.push(mulPoint);
280
309
  }
281
-
282
310
  var pointDistance = lineSegmentDistance(points[points.length - 2], points[points.length - 1]);
283
311
  distance += pointDistance;
284
312
  results.push(pushDis(points[points.length - 1], distance));
@@ -288,7 +316,6 @@ function getSimpleLineVertices(coordinates) {
288
316
  };
289
317
  }
290
318
  }
291
-
292
319
  function getTileSimpleLineVertices(points) {
293
320
  if (points.length < 2) {
294
321
  return {
@@ -298,75 +325,61 @@ function getTileSimpleLineVertices(points) {
298
325
  var results = [];
299
326
  var point = pushDis(points[0]);
300
327
  results.push(point);
301
-
302
328
  for (var i = 1; i < points.length - 1; i++) {
303
329
  var mulPoint = pushDis(points[i]);
304
330
  results.push(mulPoint);
305
331
  results.push(mulPoint);
306
332
  }
307
-
308
333
  results.push(pushDis(points[points.length - 1]));
309
334
  return {
310
335
  results: results
311
336
  };
312
337
  }
313
338
  }
314
-
315
339
  function polygonTriangulation(feature) {
316
340
  var coordinates = feature.coordinates;
317
-
318
341
  var flattengeo = _earcut.default.flatten(coordinates);
319
-
320
342
  var vertices = flattengeo.vertices,
321
- dimensions = flattengeo.dimensions,
322
- holes = flattengeo.holes;
343
+ dimensions = flattengeo.dimensions,
344
+ holes = flattengeo.holes;
323
345
  return {
324
346
  indices: (0, _earcut.default)(vertices, holes, dimensions),
325
347
  vertices: vertices,
326
348
  size: dimensions
327
349
  };
328
- } // 构建几何图形(带有中心点和大小)
329
-
350
+ }
330
351
 
352
+ // 构建几何图形(带有中心点和大小)
331
353
  function polygonTriangulationWithCenter(feature) {
332
354
  var coordinates = feature.coordinates;
333
-
334
355
  var flattengeo = _earcut.default.flatten(coordinates);
335
-
336
356
  var vertices = flattengeo.vertices,
337
- dimensions = flattengeo.dimensions,
338
- holes = flattengeo.holes;
357
+ dimensions = flattengeo.dimensions,
358
+ holes = flattengeo.holes;
339
359
  return {
340
360
  indices: (0, _earcut.default)(vertices, holes, dimensions),
341
361
  vertices: getVerticesWithCenter(vertices),
342
362
  size: dimensions + 4
343
363
  };
344
364
  }
345
-
346
365
  function getVerticesWithCenter(vertices) {
347
366
  var verticesWithCenter = [];
348
-
349
367
  var _calculatePointsCente = (0, _l7Utils.calculatePointsCenterAndRadius)(vertices),
350
- center = _calculatePointsCente.center,
351
- radius = _calculatePointsCente.radius;
352
-
368
+ center = _calculatePointsCente.center,
369
+ radius = _calculatePointsCente.radius;
353
370
  for (var i = 0; i < vertices.length; i += 2) {
354
371
  var lng = vertices[i];
355
372
  var lat = vertices[i + 1];
356
373
  verticesWithCenter.push.apply(verticesWithCenter, [lng, lat, 0].concat((0, _toConsumableArray2.default)(center), [radius]));
357
374
  }
358
-
359
375
  return verticesWithCenter;
360
376
  }
361
-
362
377
  function PolygonExtrudeTriangulation(feature) {
363
378
  var coordinates = feature.coordinates;
364
-
365
379
  var _extrude_PolygonNorma = (0, _extrude.extrude_PolygonNormal)(coordinates, true),
366
- positions = _extrude_PolygonNorma.positions,
367
- index = _extrude_PolygonNorma.index,
368
- normals = _extrude_PolygonNorma.normals;
369
-
380
+ positions = _extrude_PolygonNorma.positions,
381
+ index = _extrude_PolygonNorma.index,
382
+ normals = _extrude_PolygonNorma.normals;
370
383
  return {
371
384
  vertices: positions,
372
385
  // [ x, y, z, uv.x,uv.y ]
@@ -375,14 +388,11 @@ function PolygonExtrudeTriangulation(feature) {
375
388
  size: 5
376
389
  };
377
390
  }
378
-
379
391
  function HeatmapGridTriangulation(feature) {
380
392
  var shape = feature.shape;
381
-
382
393
  var _getHeatmapGeometry = getHeatmapGeometry(shape),
383
- positions = _getHeatmapGeometry.positions,
384
- index = _getHeatmapGeometry.index;
385
-
394
+ positions = _getHeatmapGeometry.positions,
395
+ index = _getHeatmapGeometry.index;
386
396
  return {
387
397
  vertices: positions,
388
398
  // [ x, y, z ] 多边形顶点
@@ -390,15 +400,14 @@ function HeatmapGridTriangulation(feature) {
390
400
  size: 3
391
401
  };
392
402
  }
403
+
393
404
  /**
394
405
  * 图片图层顶点构造
395
406
  * @param feature 数据
396
407
  */
397
-
398
-
399
408
  function RasterImageTriangulation(feature) {
400
- var coordinates = feature.coordinates; // [ x, y, z. uv.x, uv.y]
401
-
409
+ var coordinates = feature.coordinates;
410
+ // [ x, y, z. uv.x, uv.y]
402
411
  var positions = [].concat((0, _toConsumableArray2.default)(coordinates[0]), [0, 0, 1, coordinates[1][0], coordinates[0][1], 0, 1, 1], (0, _toConsumableArray2.default)(coordinates[1]), [0, 1, 0], (0, _toConsumableArray2.default)(coordinates[0]), [0, 0, 1], (0, _toConsumableArray2.default)(coordinates[1]), [0, 1, 0, coordinates[0][0], coordinates[1][1], 0, 0, 0]);
403
412
  var indexs = [0, 1, 2, 3, 4, 5];
404
413
  return {
@@ -407,60 +416,52 @@ function RasterImageTriangulation(feature) {
407
416
  size: 5
408
417
  };
409
418
  }
419
+
410
420
  /**
411
421
  * 计算3D弧线顶点
412
422
  * @param feature 映射数据
413
423
  * @param segNum 弧线线段数
414
424
  */
415
-
416
-
417
425
  function LineArcTriangulation(feature, segmentNumber) {
418
426
  var segNum = segmentNumber ? segmentNumber : 30;
419
427
  var coordinates = feature.coordinates;
420
428
  var positions = [];
421
429
  var indexArray = [];
422
-
423
430
  var _loop = function _loop(i) {
424
431
  // 上线两个顶点
425
432
  // [ x, y, z, sx,sy, tx,ty]
426
433
  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]);
427
-
428
434
  if (i !== segNum - 1) {
429
435
  indexArray.push.apply(indexArray, (0, _toConsumableArray2.default)([0, 1, 2, 1, 3, 2].map(function (v) {
430
436
  return i * 2 + v;
431
437
  })));
432
438
  }
433
439
  };
434
-
435
440
  for (var i = 0; i < segNum; i++) {
436
441
  _loop(i);
437
442
  }
438
-
439
443
  return {
440
444
  vertices: positions,
441
445
  indices: indexArray,
442
446
  size: 7
443
447
  };
444
448
  }
449
+
445
450
  /**
446
451
  * 构建热力图密度图的顶点
447
452
  * @param feature
448
453
  * @returns
449
454
  */
450
-
451
-
452
455
  function HeatmapTriangulation(feature) {
453
456
  var coordinates = feature.coordinates;
454
-
455
457
  if (coordinates.length === 2) {
456
458
  coordinates.push(0);
457
459
  }
458
-
459
460
  var dir = addDir(-1, 1);
460
461
  var dir1 = addDir(1, 1);
461
462
  var dir2 = addDir(-1, -1);
462
- var dir3 = addDir(1, -1); // [x,y,z, dirx ,diry, weight]
463
-
463
+ var dir3 = addDir(1, -1);
464
+ // [x,y,z, dirx ,diry, weight]
464
465
  var positions = [].concat((0, _toConsumableArray2.default)(coordinates), (0, _toConsumableArray2.default)(dir), (0, _toConsumableArray2.default)(coordinates), (0, _toConsumableArray2.default)(dir2), (0, _toConsumableArray2.default)(coordinates), (0, _toConsumableArray2.default)(dir3), (0, _toConsumableArray2.default)(coordinates), (0, _toConsumableArray2.default)(dir1));
465
466
  var indexArray = [0, 1, 2, 3, 0, 2];
466
467
  return {
@@ -469,25 +470,21 @@ function HeatmapTriangulation(feature) {
469
470
  size: 5
470
471
  };
471
472
  }
473
+
472
474
  /**
473
475
  * 点图层3d geomerty
474
476
  * @param shape 3D形状
475
477
  */
476
-
477
-
478
478
  function getGeometry(shape) {
479
479
  var needFlat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
480
-
481
480
  if (GeometryCache && GeometryCache[shape]) {
482
481
  return GeometryCache[shape];
483
482
  }
484
-
485
483
  var path = _Path.geometryShape[shape] ? _Path.geometryShape[shape]() : _Path.geometryShape.cylinder();
486
484
  var geometry = (0, _extrude.extrude_PolygonNormal)([path], needFlat);
487
485
  GeometryCache[shape] = geometry;
488
486
  return geometry;
489
487
  }
490
-
491
488
  function computeVertexNormals(positions, indexArray) {
492
489
  var dim = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
493
490
  var needFlat = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
@@ -495,13 +492,9 @@ function computeVertexNormals(positions, indexArray) {
495
492
  var vA;
496
493
  var vB;
497
494
  var vC;
498
-
499
495
  var cb = _glMatrix.vec3.create();
500
-
501
496
  var ab = _glMatrix.vec3.create();
502
-
503
497
  var normal = _glMatrix.vec3.create();
504
-
505
498
  for (var i = 0, li = indexArray.length; i < li; i += 3) {
506
499
  vA = indexArray[i + 0] * 3;
507
500
  vB = indexArray[i + 1] * 3;
@@ -509,40 +502,29 @@ function computeVertexNormals(positions, indexArray) {
509
502
  var p1 = [positions[vA], positions[vA + 1]];
510
503
  var p2 = [positions[vB], positions[vB + 1]];
511
504
  var p3 = [positions[vC], positions[vC + 1]];
512
-
513
505
  if (needFlat) {
514
506
  p1 = (0, _l7Utils.lngLatToMeters)(p1);
515
507
  p2 = (0, _l7Utils.lngLatToMeters)(p2);
516
508
  p3 = (0, _l7Utils.lngLatToMeters)(p3);
517
509
  }
518
-
519
510
  var _p = p1,
520
- _p2 = (0, _slicedToArray2.default)(_p, 2),
521
- ax = _p2[0],
522
- ay = _p2[1];
523
-
511
+ _p2 = (0, _slicedToArray2.default)(_p, 2),
512
+ ax = _p2[0],
513
+ ay = _p2[1];
524
514
  var pA = _glMatrix.vec3.fromValues(ax, ay, positions[vA + 2]);
525
-
526
515
  var _p3 = p2,
527
- _p4 = (0, _slicedToArray2.default)(_p3, 2),
528
- bx = _p4[0],
529
- by = _p4[1];
530
-
516
+ _p4 = (0, _slicedToArray2.default)(_p3, 2),
517
+ bx = _p4[0],
518
+ by = _p4[1];
531
519
  var pB = _glMatrix.vec3.fromValues(bx, by, positions[vB + 2]);
532
-
533
520
  var _p5 = p3,
534
- _p6 = (0, _slicedToArray2.default)(_p5, 2),
535
- cx = _p6[0],
536
- cy = _p6[1];
537
-
521
+ _p6 = (0, _slicedToArray2.default)(_p5, 2),
522
+ cx = _p6[0],
523
+ cy = _p6[1];
538
524
  var pC = _glMatrix.vec3.fromValues(cx, cy, positions[vC + 2]);
539
-
540
525
  _glMatrix.vec3.sub(cb, pC, pB);
541
-
542
526
  _glMatrix.vec3.sub(ab, pA, pB);
543
-
544
527
  _glMatrix.vec3.cross(normal, cb, ab);
545
-
546
528
  normals[vA] += cb[0];
547
529
  normals[vA + 1] += cb[1];
548
530
  normals[vA + 2] += cb[2];
@@ -553,56 +535,47 @@ function computeVertexNormals(positions, indexArray) {
553
535
  normals[vC + 1] += cb[1];
554
536
  normals[vC + 2] += cb[2];
555
537
  }
556
-
557
538
  normalizeNormals(normals);
558
539
  return normals;
559
540
  }
560
-
561
541
  function normalizeNormals(normals) {
562
542
  for (var i = 0, li = normals.length; i < li; i += 3) {
563
543
  var normal = _glMatrix.vec3.fromValues(normals[i], normals[i + 1], normals[i + 2]);
564
-
565
544
  var newNormal = _glMatrix.vec3.create();
566
-
567
545
  _glMatrix.vec3.normalize(newNormal, normal);
568
-
569
546
  normals.set(newNormal, i);
570
547
  }
571
548
  }
572
-
573
549
  function checkIsClosed(points) {
574
550
  var p1 = points[0][0];
575
551
  var p2 = points[0][points[0].length - 1];
576
552
  return p1[0] === p2[0] && p1[1] === p2[1];
577
553
  }
578
-
579
554
  function getHeatmapGeometry(shape) {
580
555
  var shape3d = ['cylinder', 'triangleColumn', 'hexagonColumn', 'squareColumn'];
581
556
  var path = _Path.geometryShape[shape] ? _Path.geometryShape[shape]() : _Path.geometryShape.circle();
582
- var geometry = shape3d.indexOf(shape) === -1 ? (0, _extrude.fillPolygon)([path]) : (0, _extrude.default)([path]); // const geometry = fillPolygon([path]);
583
-
557
+ var geometry = shape3d.indexOf(shape) === -1 ? (0, _extrude.fillPolygon)([path]) : (0, _extrude.default)([path]);
558
+ // const geometry = fillPolygon([path]);
584
559
  return geometry;
585
- } // 热力图计算范围
586
-
587
-
560
+ }
561
+ // 热力图计算范围
588
562
  function addDir(dirX, dirY) {
589
563
  var x = (dirX + 1) / 2;
590
564
  var y = (dirY + 1) / 2;
591
565
  return [x, y];
592
566
  }
567
+
593
568
  /**
594
569
  * 构建地球三角网格
595
570
  * @returns
596
571
  */
597
-
598
-
599
572
  function earthTriangulation() {
600
573
  var earthmesh = (0, _utils.primitiveSphere)(_utils.EARTH_RADIUS, {
601
574
  segments: _utils.EARTH_SEGMENTS
602
575
  });
603
576
  var positionsArr = earthmesh.positionsArr,
604
- indicesArr = earthmesh.indicesArr,
605
- normalArr = earthmesh.normalArr;
577
+ indicesArr = earthmesh.indicesArr,
578
+ normalArr = earthmesh.normalArr;
606
579
  return {
607
580
  vertices: positionsArr,
608
581
  indices: indicesArr,
@@ -610,14 +583,13 @@ function earthTriangulation() {
610
583
  normals: normalArr
611
584
  };
612
585
  }
613
-
614
586
  function earthOuterTriangulation() {
615
587
  var earthmesh = (0, _utils.primitiveSphere)(_utils.EARTH_RADIUS + _utils.EARTH_RADIUS_OUTER, {
616
588
  segments: _utils.EARTH_SEGMENTS
617
589
  });
618
590
  var positionsArr = earthmesh.positionsArr,
619
- indicesArr = earthmesh.indicesArr,
620
- normalArr = earthmesh.normalArr;
591
+ indicesArr = earthmesh.indicesArr,
592
+ normalArr = earthmesh.normalArr;
621
593
  return {
622
594
  vertices: positionsArr,
623
595
  indices: indicesArr,