@antv/l7-layers 2.9.36 → 2.9.37-alpha.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 (631) hide show
  1. package/package.json +6 -6
  2. package/es/Geometry/index.d.ts +0 -32
  3. package/es/Geometry/index.js +0 -118
  4. package/es/Geometry/models/billboard.d.ts +0 -26
  5. package/es/Geometry/models/billboard.js +0 -228
  6. package/es/Geometry/models/index.d.ts +0 -5
  7. package/es/Geometry/models/index.js +0 -9
  8. package/es/Geometry/models/plane.d.ts +0 -45
  9. package/es/Geometry/models/plane.js +0 -419
  10. package/es/Geometry/models/sprite.d.ts +0 -47
  11. package/es/Geometry/models/sprite.js +0 -301
  12. package/es/Geometry/shaders/billboard_frag.glsl +0 -13
  13. package/es/Geometry/shaders/billboard_vert.glsl +0 -50
  14. package/es/Geometry/shaders/plane_frag.glsl +0 -22
  15. package/es/Geometry/shaders/plane_vert.glsl +0 -53
  16. package/es/Geometry/shaders/sprite_frag.glsl +0 -21
  17. package/es/Geometry/shaders/sprite_vert.glsl +0 -28
  18. package/es/canvas/index.d.ts +0 -23
  19. package/es/canvas/index.js +0 -121
  20. package/es/canvas/models/canvas.d.ts +0 -18
  21. package/es/canvas/models/canvas.js +0 -212
  22. package/es/canvas/models/index.d.ts +0 -5
  23. package/es/canvas/models/index.js +0 -5
  24. package/es/citybuliding/building.d.ts +0 -17
  25. package/es/citybuliding/building.js +0 -86
  26. package/es/citybuliding/models/build.d.ts +0 -22
  27. package/es/citybuliding/models/build.js +0 -187
  28. package/es/citybuliding/shaders/build_frag.glsl +0 -117
  29. package/es/citybuliding/shaders/build_vert.glsl +0 -54
  30. package/es/core/BaseLayer.d.ts +0 -225
  31. package/es/core/BaseLayer.js +0 -1430
  32. package/es/core/BaseModel.d.ts +0 -140
  33. package/es/core/BaseModel.js +0 -489
  34. package/es/core/interface.d.ts +0 -225
  35. package/es/core/interface.js +0 -30
  36. package/es/core/schema.d.ts +0 -27
  37. package/es/core/schema.js +0 -25
  38. package/es/core/shape/Path.d.ts +0 -39
  39. package/es/core/shape/Path.js +0 -62
  40. package/es/core/shape/extrude.d.ts +0 -17
  41. package/es/core/shape/extrude.js +0 -148
  42. package/es/core/triangulation.d.ts +0 -128
  43. package/es/core/triangulation.js +0 -553
  44. package/es/earth/index.d.ts +0 -22
  45. package/es/earth/index.js +0 -98
  46. package/es/earth/models/atmosphere.d.ts +0 -9
  47. package/es/earth/models/atmosphere.js +0 -135
  48. package/es/earth/models/base.d.ts +0 -16
  49. package/es/earth/models/base.js +0 -206
  50. package/es/earth/models/bloomsphere.d.ts +0 -9
  51. package/es/earth/models/bloomsphere.js +0 -134
  52. package/es/earth/shaders/atmosphere_frag.glsl +0 -17
  53. package/es/earth/shaders/atmosphere_vert.glsl +0 -26
  54. package/es/earth/shaders/base_frag.glsl +0 -13
  55. package/es/earth/shaders/base_vert.glsl +0 -52
  56. package/es/earth/shaders/bloomsphere_frag.glsl +0 -15
  57. package/es/earth/shaders/bloomsphere_vert.glsl +0 -20
  58. package/es/earth/utils.d.ts +0 -26
  59. package/es/earth/utils.js +0 -104
  60. package/es/heatmap/index.d.ts +0 -21
  61. package/es/heatmap/index.js +0 -141
  62. package/es/heatmap/models/grid.d.ts +0 -8
  63. package/es/heatmap/models/grid.js +0 -106
  64. package/es/heatmap/models/grid3d.d.ts +0 -8
  65. package/es/heatmap/models/grid3d.js +0 -140
  66. package/es/heatmap/models/heatmap.d.ts +0 -24
  67. package/es/heatmap/models/heatmap.js +0 -463
  68. package/es/heatmap/models/hexagon.d.ts +0 -8
  69. package/es/heatmap/models/hexagon.js +0 -107
  70. package/es/heatmap/models/index.d.ts +0 -5
  71. package/es/heatmap/models/index.js +0 -12
  72. package/es/heatmap/shaders/grid_vert.glsl +0 -42
  73. package/es/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
  74. package/es/heatmap/shaders/heatmap_3d_vert.glsl +0 -46
  75. package/es/heatmap/shaders/heatmap_frag.glsl +0 -47
  76. package/es/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
  77. package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +0 -35
  78. package/es/heatmap/shaders/heatmap_vert.glsl +0 -10
  79. package/es/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  80. package/es/heatmap/shaders/hexagon_3d_vert.glsl +0 -64
  81. package/es/heatmap/shaders/hexagon_frag.glsl +0 -12
  82. package/es/heatmap/shaders/hexagon_vert.glsl +0 -41
  83. package/es/heatmap/triangulation.d.ts +0 -5
  84. package/es/heatmap/triangulation.js +0 -37
  85. package/es/image/index.d.ts +0 -19
  86. package/es/image/index.js +0 -104
  87. package/es/image/models/dataImage.d.ts +0 -22
  88. package/es/image/models/dataImage.js +0 -200
  89. package/es/image/models/image.d.ts +0 -19
  90. package/es/image/models/image.js +0 -164
  91. package/es/image/models/index.d.ts +0 -5
  92. package/es/image/models/index.js +0 -9
  93. package/es/image/models/tileDataImage.d.ts +0 -19
  94. package/es/image/models/tileDataImage.js +0 -174
  95. package/es/image/shaders/dataImage_frag.glsl +0 -38
  96. package/es/image/shaders/image_frag.glsl +0 -9
  97. package/es/image/shaders/image_vert.glsl +0 -17
  98. package/es/index.d.ts +0 -17
  99. package/es/index.js +0 -107
  100. package/es/line/index.d.ts +0 -43
  101. package/es/line/index.js +0 -140
  102. package/es/line/models/arc.d.ts +0 -17
  103. package/es/line/models/arc.js +0 -356
  104. package/es/line/models/arc_3d.d.ts +0 -17
  105. package/es/line/models/arc_3d.js +0 -333
  106. package/es/line/models/earthArc_3d.d.ts +0 -17
  107. package/es/line/models/earthArc_3d.js +0 -336
  108. package/es/line/models/great_circle.d.ts +0 -12
  109. package/es/line/models/great_circle.js +0 -294
  110. package/es/line/models/half.d.ts +0 -18
  111. package/es/line/models/half.js +0 -281
  112. package/es/line/models/index.d.ts +0 -5
  113. package/es/line/models/index.js +0 -25
  114. package/es/line/models/line.d.ts +0 -21
  115. package/es/line/models/line.js +0 -443
  116. package/es/line/models/linearline.d.ts +0 -11
  117. package/es/line/models/linearline.js +0 -275
  118. package/es/line/models/simpleLine.d.ts +0 -14
  119. package/es/line/models/simpleLine.js +0 -234
  120. package/es/line/models/simpleTileLine.d.ts +0 -9
  121. package/es/line/models/simpleTileLine.js +0 -100
  122. package/es/line/models/tile.d.ts +0 -8
  123. package/es/line/models/tile.js +0 -178
  124. package/es/line/models/wall.d.ts +0 -12
  125. package/es/line/models/wall.js +0 -293
  126. package/es/line/shaders/arc_chunks.vert.glsl +0 -21
  127. package/es/line/shaders/dash/arc_dash_frag.glsl +0 -28
  128. package/es/line/shaders/dash/arc_dash_vert.glsl +0 -150
  129. package/es/line/shaders/dash/line_dash_frag.glsl +0 -31
  130. package/es/line/shaders/dash/line_dash_vert.glsl +0 -93
  131. package/es/line/shaders/half/line_half_frag.glsl +0 -53
  132. package/es/line/shaders/half/line_half_vert.glsl +0 -169
  133. package/es/line/shaders/line_arc2d_vert.glsl +0 -114
  134. package/es/line/shaders/line_arc_3d_frag.glsl +0 -103
  135. package/es/line/shaders/line_arc_3d_vert.glsl +0 -206
  136. package/es/line/shaders/line_arc_frag.glsl +0 -88
  137. package/es/line/shaders/line_arc_great_circle_frag.glsl +0 -101
  138. package/es/line/shaders/line_arc_great_circle_vert.glsl +0 -214
  139. package/es/line/shaders/line_arc_vert.glsl +0 -178
  140. package/es/line/shaders/line_bezier_vert.glsl +0 -85
  141. package/es/line/shaders/line_frag.glsl +0 -99
  142. package/es/line/shaders/line_vert.glsl +0 -192
  143. package/es/line/shaders/linear/arc3d_linear_frag.glsl +0 -46
  144. package/es/line/shaders/linear/arc3d_linear_vert.glsl +0 -206
  145. package/es/line/shaders/linear/arc_linear_frag.glsl +0 -38
  146. package/es/line/shaders/linear/arc_linear_vert.glsl +0 -138
  147. package/es/line/shaders/linear/line_linear_frag.glsl +0 -27
  148. package/es/line/shaders/linearLine/line_linear_frag.glsl +0 -20
  149. package/es/line/shaders/linearLine/line_linear_vert.glsl +0 -112
  150. package/es/line/shaders/simple/simpleline_frag.glsl +0 -10
  151. package/es/line/shaders/simple/simpleline_linear_frag.glsl +0 -11
  152. package/es/line/shaders/simple/simpleline_vert.glsl +0 -79
  153. package/es/line/shaders/tile/line_tile_map_vert.glsl +0 -25
  154. package/es/line/shaders/tile/line_tile_vert.glsl +0 -52
  155. package/es/line/shaders/tile/simpleline_map_vert.glsl +0 -15
  156. package/es/line/shaders/tile/simpleline_vert.glsl +0 -21
  157. package/es/line/shaders/wall/wall_frag.glsl +0 -89
  158. package/es/line/shaders/wall/wall_vert.glsl +0 -77
  159. package/es/mask/index.d.ts +0 -27
  160. package/es/mask/index.js +0 -160
  161. package/es/mask/models/fill.d.ts +0 -12
  162. package/es/mask/models/fill.js +0 -124
  163. package/es/mask/models/index.d.ts +0 -5
  164. package/es/mask/models/index.js +0 -7
  165. package/es/mask/shaders/mask_vert.glsl +0 -16
  166. package/es/plugins/DataMappingPlugin.d.ts +0 -18
  167. package/es/plugins/DataMappingPlugin.js +0 -413
  168. package/es/plugins/DataSourcePlugin.d.ts +0 -7
  169. package/es/plugins/DataSourcePlugin.js +0 -84
  170. package/es/plugins/FeatureScalePlugin.d.ts +0 -24
  171. package/es/plugins/FeatureScalePlugin.js +0 -340
  172. package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -5
  173. package/es/plugins/LayerAnimateStylePlugin.js +0 -29
  174. package/es/plugins/LayerModelPlugin.d.ts +0 -10
  175. package/es/plugins/LayerModelPlugin.js +0 -72
  176. package/es/plugins/LayerStylePlugin.d.ts +0 -8
  177. package/es/plugins/LayerStylePlugin.js +0 -39
  178. package/es/plugins/LightingPlugin.d.ts +0 -36
  179. package/es/plugins/LightingPlugin.js +0 -104
  180. package/es/plugins/MultiPassRendererPlugin.d.ts +0 -23
  181. package/es/plugins/MultiPassRendererPlugin.js +0 -65
  182. package/es/plugins/PixelPickingPlugin.d.ts +0 -8
  183. package/es/plugins/PixelPickingPlugin.js +0 -126
  184. package/es/plugins/RegisterStyleAttributePlugin.d.ts +0 -15
  185. package/es/plugins/RegisterStyleAttributePlugin.js +0 -156
  186. package/es/plugins/ShaderUniformPlugin.d.ts +0 -21
  187. package/es/plugins/ShaderUniformPlugin.js +0 -106
  188. package/es/plugins/UpdateModelPlugin.d.ts +0 -8
  189. package/es/plugins/UpdateModelPlugin.js +0 -31
  190. package/es/plugins/UpdateStyleAttributePlugin.d.ts +0 -12
  191. package/es/plugins/UpdateStyleAttributePlugin.js +0 -83
  192. package/es/point/index.d.ts +0 -40
  193. package/es/point/index.js +0 -229
  194. package/es/point/models/earthExtrude.d.ts +0 -24
  195. package/es/point/models/earthExtrude.js +0 -274
  196. package/es/point/models/earthFill.d.ts +0 -11
  197. package/es/point/models/earthFill.js +0 -258
  198. package/es/point/models/extrude.d.ts +0 -24
  199. package/es/point/models/extrude.js +0 -295
  200. package/es/point/models/fill.d.ts +0 -40
  201. package/es/point/models/fill.js +0 -403
  202. package/es/point/models/fillmage.d.ts +0 -25
  203. package/es/point/models/fillmage.js +0 -366
  204. package/es/point/models/image.d.ts +0 -11
  205. package/es/point/models/image.js +0 -239
  206. package/es/point/models/index.d.ts +0 -5
  207. package/es/point/models/index.js +0 -30
  208. package/es/point/models/normal.d.ts +0 -16
  209. package/es/point/models/normal.js +0 -124
  210. package/es/point/models/radar.d.ts +0 -24
  211. package/es/point/models/radar.js +0 -232
  212. package/es/point/models/simplePoint.d.ts +0 -16
  213. package/es/point/models/simplePoint.js +0 -179
  214. package/es/point/models/text.d.ts +0 -57
  215. package/es/point/models/text.js +0 -619
  216. package/es/point/models/tile.d.ts +0 -15
  217. package/es/point/models/tile.js +0 -175
  218. package/es/point/models/tileText.d.ts +0 -52
  219. package/es/point/models/tileText.js +0 -509
  220. package/es/point/shaders/animate/wave_frag.glsl +0 -65
  221. package/es/point/shaders/earth/extrude_frag.glsl +0 -44
  222. package/es/point/shaders/earth/extrude_vert.glsl +0 -140
  223. package/es/point/shaders/earth/fill_frag.glsl +0 -86
  224. package/es/point/shaders/earth/fill_vert.glsl +0 -125
  225. package/es/point/shaders/extrude/extrude_frag.glsl +0 -44
  226. package/es/point/shaders/extrude/extrude_vert.glsl +0 -121
  227. package/es/point/shaders/fill_frag.glsl +0 -84
  228. package/es/point/shaders/fill_vert.glsl +0 -188
  229. package/es/point/shaders/image/fillImage_frag.glsl +0 -20
  230. package/es/point/shaders/image/fillImage_vert.glsl +0 -116
  231. package/es/point/shaders/image_frag.glsl +0 -39
  232. package/es/point/shaders/image_vert.glsl +0 -90
  233. package/es/point/shaders/normal_frag.glsl +0 -6
  234. package/es/point/shaders/normal_vert.glsl +0 -24
  235. package/es/point/shaders/radar/radar_frag.glsl +0 -53
  236. package/es/point/shaders/radar/radar_vert.glsl +0 -70
  237. package/es/point/shaders/simplePoint_frag.glsl +0 -53
  238. package/es/point/shaders/simplePoint_vert.glsl +0 -79
  239. package/es/point/shaders/text_frag.glsl +0 -48
  240. package/es/point/shaders/text_vert.glsl +0 -131
  241. package/es/point/shaders/tile/fill_tile_frag.glsl +0 -76
  242. package/es/point/shaders/tile/fill_tile_vert.glsl +0 -78
  243. package/es/point/shaders/tile/text_frag.glsl +0 -33
  244. package/es/point/shaders/tile/text_map_frag.glsl +0 -31
  245. package/es/point/shaders/tile/text_map_vert.glsl +0 -38
  246. package/es/point/shaders/tile/text_vert.glsl +0 -48
  247. package/es/point/shape/extrude.d.ts +0 -15
  248. package/es/point/shape/extrude.js +0 -63
  249. package/es/polygon/index.d.ts +0 -27
  250. package/es/polygon/index.js +0 -146
  251. package/es/polygon/models/extrude.d.ts +0 -28
  252. package/es/polygon/models/extrude.js +0 -302
  253. package/es/polygon/models/fill.d.ts +0 -17
  254. package/es/polygon/models/fill.js +0 -210
  255. package/es/polygon/models/index.d.ts +0 -5
  256. package/es/polygon/models/index.js +0 -28
  257. package/es/polygon/models/ocean.d.ts +0 -21
  258. package/es/polygon/models/ocean.js +0 -202
  259. package/es/polygon/models/tile.d.ts +0 -12
  260. package/es/polygon/models/tile.js +0 -101
  261. package/es/polygon/models/water.d.ts +0 -16
  262. package/es/polygon/models/water.js +0 -179
  263. package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -44
  264. package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -44
  265. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -85
  266. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -90
  267. package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -48
  268. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -93
  269. package/es/polygon/shaders/polygon_frag.glsl +0 -12
  270. package/es/polygon/shaders/polygon_linear_frag.glsl +0 -22
  271. package/es/polygon/shaders/polygon_linear_vert.glsl +0 -74
  272. package/es/polygon/shaders/polygon_vert.glsl +0 -66
  273. package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +0 -16
  274. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +0 -42
  275. package/es/polygon/shaders/water/polygon_ocean_frag.glsl +0 -247
  276. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -21
  277. package/es/polygon/shaders/water/polygon_water_frag.glsl +0 -71
  278. package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -26
  279. package/es/raster/buffers/triangulation.d.ts +0 -6
  280. package/es/raster/buffers/triangulation.js +0 -25
  281. package/es/raster/index.d.ts +0 -19
  282. package/es/raster/index.js +0 -107
  283. package/es/raster/models/index.d.ts +0 -5
  284. package/es/raster/models/index.js +0 -10
  285. package/es/raster/models/raster.d.ts +0 -22
  286. package/es/raster/models/raster.js +0 -242
  287. package/es/raster/models/rasterRgb.d.ts +0 -20
  288. package/es/raster/models/rasterRgb.js +0 -226
  289. package/es/raster/models/rasterTile.d.ts +0 -18
  290. package/es/raster/models/rasterTile.js +0 -140
  291. package/es/raster/raster.d.ts +0 -30
  292. package/es/raster/raster.js +0 -174
  293. package/es/raster/shaders/raster_2d_frag.glsl +0 -64
  294. package/es/raster/shaders/raster_2d_vert.glsl +0 -17
  295. package/es/raster/shaders/raster_frag.glsl +0 -9
  296. package/es/raster/shaders/raster_rgb_frag.glsl +0 -12
  297. package/es/raster/shaders/raster_vert.glsl +0 -44
  298. package/es/shader/minify_frag.glsl +0 -7
  299. package/es/shader/minify_picking_frag.glsl +0 -10
  300. package/es/tile/interface.d.ts +0 -29
  301. package/es/tile/interface.js +0 -1
  302. package/es/tile/manager/baseMapTileLayerManager.d.ts +0 -7
  303. package/es/tile/manager/baseMapTileLayerManager.js +0 -119
  304. package/es/tile/manager/baseTileManager.d.ts +0 -27
  305. package/es/tile/manager/baseTileManager.js +0 -107
  306. package/es/tile/manager/tileConfigManager.d.ts +0 -17
  307. package/es/tile/manager/tileConfigManager.js +0 -121
  308. package/es/tile/manager/tileLayerManager.d.ts +0 -15
  309. package/es/tile/manager/tileLayerManager.js +0 -255
  310. package/es/tile/manager/tilePickerManager.d.ts +0 -21
  311. package/es/tile/manager/tilePickerManager.js +0 -194
  312. package/es/tile/models/tileModel.d.ts +0 -10
  313. package/es/tile/models/tileModel.js +0 -81
  314. package/es/tile/tileFactory/base.d.ts +0 -44
  315. package/es/tile/tileFactory/base.js +0 -474
  316. package/es/tile/tileFactory/index.d.ts +0 -5
  317. package/es/tile/tileFactory/index.js +0 -38
  318. package/es/tile/tileFactory/line.d.ts +0 -12
  319. package/es/tile/tileFactory/line.js +0 -62
  320. package/es/tile/tileFactory/mask.d.ts +0 -12
  321. package/es/tile/tileFactory/mask.js +0 -63
  322. package/es/tile/tileFactory/point.d.ts +0 -12
  323. package/es/tile/tileFactory/point.js +0 -63
  324. package/es/tile/tileFactory/polygon.d.ts +0 -12
  325. package/es/tile/tileFactory/polygon.js +0 -62
  326. package/es/tile/tileFactory/raster.d.ts +0 -12
  327. package/es/tile/tileFactory/raster.js +0 -58
  328. package/es/tile/tileFactory/rasterData.d.ts +0 -12
  329. package/es/tile/tileFactory/rasterData.js +0 -86
  330. package/es/tile/tileFactory/rasterDataLayer.d.ts +0 -20
  331. package/es/tile/tileFactory/rasterDataLayer.js +0 -90
  332. package/es/tile/tileFactory/test.d.ts +0 -12
  333. package/es/tile/tileFactory/test.js +0 -105
  334. package/es/tile/tileFactory/vectorLayer.d.ts +0 -38
  335. package/es/tile/tileFactory/vectorLayer.js +0 -264
  336. package/es/tile/tileLayer/baseMapTileLayer.d.ts +0 -30
  337. package/es/tile/tileLayer/baseMapTileLayer.js +0 -195
  338. package/es/tile/tileLayer/baseTileLayer.d.ts +0 -48
  339. package/es/tile/tileLayer/baseTileLayer.js +0 -420
  340. package/es/tile/tileTest.d.ts +0 -15
  341. package/es/tile/tileTest.js +0 -62
  342. package/es/tile/tmsMapTileLayer.d.ts +0 -7
  343. package/es/tile/tmsMapTileLayer.js +0 -97
  344. package/es/tile/tmsTileLayer.d.ts +0 -7
  345. package/es/tile/tmsTileLayer.js +0 -101
  346. package/es/tile/utils.d.ts +0 -19
  347. package/es/tile/utils.js +0 -209
  348. package/es/utils/blend.d.ts +0 -2
  349. package/es/utils/blend.js +0 -54
  350. package/es/utils/collision-index.d.ts +0 -47
  351. package/es/utils/collision-index.js +0 -102
  352. package/es/utils/dataMappingStyle.d.ts +0 -31
  353. package/es/utils/dataMappingStyle.js +0 -150
  354. package/es/utils/extrude_polyline.d.ts +0 -67
  355. package/es/utils/extrude_polyline.js +0 -611
  356. package/es/utils/grid-index.d.ts +0 -28
  357. package/es/utils/grid-index.js +0 -179
  358. package/es/utils/layerData.d.ts +0 -2
  359. package/es/utils/layerData.js +0 -179
  360. package/es/utils/multiPassRender.d.ts +0 -16
  361. package/es/utils/multiPassRender.js +0 -50
  362. package/es/utils/polylineNormal.d.ts +0 -9
  363. package/es/utils/polylineNormal.js +0 -191
  364. package/es/utils/simpleLine.d.ts +0 -23
  365. package/es/utils/simpleLine.js +0 -103
  366. package/es/utils/symbol-layout.d.ts +0 -43
  367. package/es/utils/symbol-layout.js +0 -299
  368. package/es/utils/updateShape.d.ts +0 -2
  369. package/es/utils/updateShape.js +0 -20
  370. package/es/wind/index.d.ts +0 -20
  371. package/es/wind/index.js +0 -98
  372. package/es/wind/models/index.d.ts +0 -5
  373. package/es/wind/models/index.js +0 -5
  374. package/es/wind/models/utils.d.ts +0 -19
  375. package/es/wind/models/utils.js +0 -226
  376. package/es/wind/models/wind.d.ts +0 -33
  377. package/es/wind/models/wind.js +0 -331
  378. package/es/wind/models/windRender.d.ts +0 -104
  379. package/es/wind/models/windRender.js +0 -357
  380. package/es/wind/models/windShader.d.ts +0 -12
  381. package/es/wind/models/windShader.js +0 -12
  382. package/es/wind/shaders/wind_frag.glsl +0 -9
  383. package/es/wind/shaders/wind_vert.glsl +0 -17
  384. package/lib/Geometry/index.js +0 -130
  385. package/lib/Geometry/models/billboard.js +0 -242
  386. package/lib/Geometry/models/index.js +0 -22
  387. package/lib/Geometry/models/plane.js +0 -434
  388. package/lib/Geometry/models/sprite.js +0 -315
  389. package/lib/Geometry/shaders/billboard_frag.glsl +0 -13
  390. package/lib/Geometry/shaders/billboard_vert.glsl +0 -50
  391. package/lib/Geometry/shaders/plane_frag.glsl +0 -22
  392. package/lib/Geometry/shaders/plane_vert.glsl +0 -53
  393. package/lib/Geometry/shaders/sprite_frag.glsl +0 -21
  394. package/lib/Geometry/shaders/sprite_vert.glsl +0 -28
  395. package/lib/canvas/index.js +0 -133
  396. package/lib/canvas/models/canvas.js +0 -221
  397. package/lib/canvas/models/index.js +0 -16
  398. package/lib/citybuliding/building.js +0 -99
  399. package/lib/citybuliding/models/build.js +0 -202
  400. package/lib/citybuliding/shaders/build_frag.glsl +0 -117
  401. package/lib/citybuliding/shaders/build_vert.glsl +0 -54
  402. package/lib/core/BaseLayer.js +0 -1425
  403. package/lib/core/BaseModel.js +0 -506
  404. package/lib/core/interface.js +0 -41
  405. package/lib/core/schema.js +0 -33
  406. package/lib/core/shape/Path.js +0 -88
  407. package/lib/core/shape/extrude.js +0 -180
  408. package/lib/core/triangulation.js +0 -619
  409. package/lib/earth/index.js +0 -113
  410. package/lib/earth/models/atmosphere.js +0 -149
  411. package/lib/earth/models/base.js +0 -216
  412. package/lib/earth/models/bloomsphere.js +0 -148
  413. package/lib/earth/shaders/atmosphere_frag.glsl +0 -17
  414. package/lib/earth/shaders/atmosphere_vert.glsl +0 -26
  415. package/lib/earth/shaders/base_frag.glsl +0 -13
  416. package/lib/earth/shaders/base_vert.glsl +0 -52
  417. package/lib/earth/shaders/bloomsphere_frag.glsl +0 -15
  418. package/lib/earth/shaders/bloomsphere_vert.glsl +0 -20
  419. package/lib/earth/utils.js +0 -136
  420. package/lib/heatmap/index.js +0 -154
  421. package/lib/heatmap/models/grid.js +0 -120
  422. package/lib/heatmap/models/grid3d.js +0 -154
  423. package/lib/heatmap/models/heatmap.js +0 -486
  424. package/lib/heatmap/models/hexagon.js +0 -121
  425. package/lib/heatmap/models/index.js +0 -26
  426. package/lib/heatmap/shaders/grid_vert.glsl +0 -42
  427. package/lib/heatmap/shaders/heatmap_3d_frag.glsl +0 -14
  428. package/lib/heatmap/shaders/heatmap_3d_vert.glsl +0 -46
  429. package/lib/heatmap/shaders/heatmap_frag.glsl +0 -47
  430. package/lib/heatmap/shaders/heatmap_framebuffer_frag.glsl +0 -10
  431. package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +0 -35
  432. package/lib/heatmap/shaders/heatmap_vert.glsl +0 -10
  433. package/lib/heatmap/shaders/hexagon_3d_frag.glsl +0 -0
  434. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +0 -64
  435. package/lib/heatmap/shaders/hexagon_frag.glsl +0 -12
  436. package/lib/heatmap/shaders/hexagon_vert.glsl +0 -41
  437. package/lib/heatmap/triangulation.js +0 -44
  438. package/lib/image/index.js +0 -117
  439. package/lib/image/models/dataImage.js +0 -215
  440. package/lib/image/models/image.js +0 -178
  441. package/lib/image/models/index.js +0 -22
  442. package/lib/image/models/tileDataImage.js +0 -188
  443. package/lib/image/shaders/dataImage_frag.glsl +0 -38
  444. package/lib/image/shaders/image_frag.glsl +0 -9
  445. package/lib/image/shaders/image_vert.glsl +0 -17
  446. package/lib/index.js +0 -275
  447. package/lib/line/index.js +0 -152
  448. package/lib/line/models/arc.js +0 -373
  449. package/lib/line/models/arc_3d.js +0 -351
  450. package/lib/line/models/earthArc_3d.js +0 -354
  451. package/lib/line/models/great_circle.js +0 -310
  452. package/lib/line/models/half.js +0 -298
  453. package/lib/line/models/index.js +0 -46
  454. package/lib/line/models/line.js +0 -460
  455. package/lib/line/models/linearline.js +0 -292
  456. package/lib/line/models/simpleLine.js +0 -249
  457. package/lib/line/models/simpleTileLine.js +0 -115
  458. package/lib/line/models/tile.js +0 -194
  459. package/lib/line/models/wall.js +0 -309
  460. package/lib/line/shaders/arc_chunks.vert.glsl +0 -21
  461. package/lib/line/shaders/dash/arc_dash_frag.glsl +0 -28
  462. package/lib/line/shaders/dash/arc_dash_vert.glsl +0 -150
  463. package/lib/line/shaders/dash/line_dash_frag.glsl +0 -31
  464. package/lib/line/shaders/dash/line_dash_vert.glsl +0 -93
  465. package/lib/line/shaders/half/line_half_frag.glsl +0 -53
  466. package/lib/line/shaders/half/line_half_vert.glsl +0 -169
  467. package/lib/line/shaders/line_arc2d_vert.glsl +0 -114
  468. package/lib/line/shaders/line_arc_3d_frag.glsl +0 -103
  469. package/lib/line/shaders/line_arc_3d_vert.glsl +0 -206
  470. package/lib/line/shaders/line_arc_frag.glsl +0 -88
  471. package/lib/line/shaders/line_arc_great_circle_frag.glsl +0 -101
  472. package/lib/line/shaders/line_arc_great_circle_vert.glsl +0 -214
  473. package/lib/line/shaders/line_arc_vert.glsl +0 -178
  474. package/lib/line/shaders/line_bezier_vert.glsl +0 -85
  475. package/lib/line/shaders/line_frag.glsl +0 -99
  476. package/lib/line/shaders/line_vert.glsl +0 -192
  477. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +0 -46
  478. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +0 -206
  479. package/lib/line/shaders/linear/arc_linear_frag.glsl +0 -38
  480. package/lib/line/shaders/linear/arc_linear_vert.glsl +0 -138
  481. package/lib/line/shaders/linear/line_linear_frag.glsl +0 -27
  482. package/lib/line/shaders/linearLine/line_linear_frag.glsl +0 -20
  483. package/lib/line/shaders/linearLine/line_linear_vert.glsl +0 -112
  484. package/lib/line/shaders/simple/simpleline_frag.glsl +0 -10
  485. package/lib/line/shaders/simple/simpleline_linear_frag.glsl +0 -11
  486. package/lib/line/shaders/simple/simpleline_vert.glsl +0 -79
  487. package/lib/line/shaders/tile/line_tile_map_vert.glsl +0 -25
  488. package/lib/line/shaders/tile/line_tile_vert.glsl +0 -52
  489. package/lib/line/shaders/tile/simpleline_map_vert.glsl +0 -15
  490. package/lib/line/shaders/tile/simpleline_vert.glsl +0 -21
  491. package/lib/line/shaders/wall/wall_frag.glsl +0 -89
  492. package/lib/line/shaders/wall/wall_vert.glsl +0 -77
  493. package/lib/mask/index.js +0 -176
  494. package/lib/mask/models/fill.js +0 -141
  495. package/lib/mask/models/index.js +0 -19
  496. package/lib/mask/shaders/mask_vert.glsl +0 -16
  497. package/lib/plugins/DataMappingPlugin.js +0 -427
  498. package/lib/plugins/DataSourcePlugin.js +0 -97
  499. package/lib/plugins/FeatureScalePlugin.js +0 -363
  500. package/lib/plugins/LayerAnimateStylePlugin.js +0 -41
  501. package/lib/plugins/LayerModelPlugin.js +0 -83
  502. package/lib/plugins/LayerStylePlugin.js +0 -50
  503. package/lib/plugins/LightingPlugin.js +0 -119
  504. package/lib/plugins/MultiPassRendererPlugin.js +0 -77
  505. package/lib/plugins/PixelPickingPlugin.js +0 -139
  506. package/lib/plugins/RegisterStyleAttributePlugin.js +0 -168
  507. package/lib/plugins/ShaderUniformPlugin.js +0 -119
  508. package/lib/plugins/UpdateModelPlugin.js +0 -42
  509. package/lib/plugins/UpdateStyleAttributePlugin.js +0 -94
  510. package/lib/point/index.js +0 -242
  511. package/lib/point/models/earthExtrude.js +0 -290
  512. package/lib/point/models/earthFill.js +0 -293
  513. package/lib/point/models/extrude.js +0 -312
  514. package/lib/point/models/fill.js +0 -419
  515. package/lib/point/models/fillmage.js +0 -382
  516. package/lib/point/models/image.js +0 -255
  517. package/lib/point/models/index.js +0 -53
  518. package/lib/point/models/normal.js +0 -141
  519. package/lib/point/models/radar.js +0 -249
  520. package/lib/point/models/simplePoint.js +0 -196
  521. package/lib/point/models/text.js +0 -634
  522. package/lib/point/models/tile.js +0 -189
  523. package/lib/point/models/tileText.js +0 -524
  524. package/lib/point/shaders/animate/wave_frag.glsl +0 -65
  525. package/lib/point/shaders/earth/extrude_frag.glsl +0 -44
  526. package/lib/point/shaders/earth/extrude_vert.glsl +0 -140
  527. package/lib/point/shaders/earth/fill_frag.glsl +0 -86
  528. package/lib/point/shaders/earth/fill_vert.glsl +0 -125
  529. package/lib/point/shaders/extrude/extrude_frag.glsl +0 -44
  530. package/lib/point/shaders/extrude/extrude_vert.glsl +0 -121
  531. package/lib/point/shaders/fill_frag.glsl +0 -84
  532. package/lib/point/shaders/fill_vert.glsl +0 -188
  533. package/lib/point/shaders/image/fillImage_frag.glsl +0 -20
  534. package/lib/point/shaders/image/fillImage_vert.glsl +0 -116
  535. package/lib/point/shaders/image_frag.glsl +0 -39
  536. package/lib/point/shaders/image_vert.glsl +0 -90
  537. package/lib/point/shaders/normal_frag.glsl +0 -6
  538. package/lib/point/shaders/normal_vert.glsl +0 -24
  539. package/lib/point/shaders/radar/radar_frag.glsl +0 -53
  540. package/lib/point/shaders/radar/radar_vert.glsl +0 -70
  541. package/lib/point/shaders/simplePoint_frag.glsl +0 -53
  542. package/lib/point/shaders/simplePoint_vert.glsl +0 -79
  543. package/lib/point/shaders/text_frag.glsl +0 -48
  544. package/lib/point/shaders/text_vert.glsl +0 -131
  545. package/lib/point/shaders/tile/fill_tile_frag.glsl +0 -76
  546. package/lib/point/shaders/tile/fill_tile_vert.glsl +0 -78
  547. package/lib/point/shaders/tile/text_frag.glsl +0 -33
  548. package/lib/point/shaders/tile/text_map_frag.glsl +0 -31
  549. package/lib/point/shaders/tile/text_map_vert.glsl +0 -38
  550. package/lib/point/shaders/tile/text_vert.glsl +0 -48
  551. package/lib/point/shape/extrude.js +0 -78
  552. package/lib/polygon/index.js +0 -160
  553. package/lib/polygon/models/extrude.js +0 -318
  554. package/lib/polygon/models/fill.js +0 -225
  555. package/lib/polygon/models/index.js +0 -50
  556. package/lib/polygon/models/ocean.js +0 -219
  557. package/lib/polygon/models/tile.js +0 -114
  558. package/lib/polygon/models/water.js +0 -196
  559. package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +0 -44
  560. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +0 -44
  561. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +0 -85
  562. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +0 -90
  563. package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +0 -48
  564. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +0 -93
  565. package/lib/polygon/shaders/polygon_frag.glsl +0 -12
  566. package/lib/polygon/shaders/polygon_linear_frag.glsl +0 -22
  567. package/lib/polygon/shaders/polygon_linear_vert.glsl +0 -74
  568. package/lib/polygon/shaders/polygon_vert.glsl +0 -66
  569. package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +0 -16
  570. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +0 -42
  571. package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +0 -247
  572. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -21
  573. package/lib/polygon/shaders/water/polygon_water_frag.glsl +0 -71
  574. package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -26
  575. package/lib/raster/buffers/triangulation.js +0 -35
  576. package/lib/raster/index.js +0 -120
  577. package/lib/raster/models/index.js +0 -23
  578. package/lib/raster/models/raster.js +0 -259
  579. package/lib/raster/models/rasterRgb.js +0 -241
  580. package/lib/raster/models/rasterTile.js +0 -154
  581. package/lib/raster/raster.js +0 -191
  582. package/lib/raster/shaders/raster_2d_frag.glsl +0 -64
  583. package/lib/raster/shaders/raster_2d_vert.glsl +0 -17
  584. package/lib/raster/shaders/raster_frag.glsl +0 -9
  585. package/lib/raster/shaders/raster_rgb_frag.glsl +0 -12
  586. package/lib/raster/shaders/raster_vert.glsl +0 -44
  587. package/lib/shader/minify_frag.glsl +0 -7
  588. package/lib/shader/minify_picking_frag.glsl +0 -10
  589. package/lib/tile/interface.js +0 -5
  590. package/lib/tile/manager/baseMapTileLayerManager.js +0 -134
  591. package/lib/tile/manager/baseTileManager.js +0 -121
  592. package/lib/tile/manager/tileConfigManager.js +0 -133
  593. package/lib/tile/manager/tileLayerManager.js +0 -273
  594. package/lib/tile/manager/tilePickerManager.js +0 -205
  595. package/lib/tile/models/tileModel.js +0 -94
  596. package/lib/tile/tileFactory/base.js +0 -497
  597. package/lib/tile/tileFactory/index.js +0 -71
  598. package/lib/tile/tileFactory/line.js +0 -73
  599. package/lib/tile/tileFactory/mask.js +0 -74
  600. package/lib/tile/tileFactory/point.js +0 -74
  601. package/lib/tile/tileFactory/polygon.js +0 -73
  602. package/lib/tile/tileFactory/raster.js +0 -71
  603. package/lib/tile/tileFactory/rasterData.js +0 -99
  604. package/lib/tile/tileFactory/rasterDataLayer.js +0 -104
  605. package/lib/tile/tileFactory/test.js +0 -118
  606. package/lib/tile/tileFactory/vectorLayer.js +0 -280
  607. package/lib/tile/tileLayer/baseMapTileLayer.js +0 -202
  608. package/lib/tile/tileLayer/baseTileLayer.js +0 -429
  609. package/lib/tile/tileTest.js +0 -74
  610. package/lib/tile/tmsMapTileLayer.js +0 -114
  611. package/lib/tile/tmsTileLayer.js +0 -118
  612. package/lib/tile/utils.js +0 -248
  613. package/lib/utils/blend.js +0 -65
  614. package/lib/utils/collision-index.js +0 -118
  615. package/lib/utils/dataMappingStyle.js +0 -154
  616. package/lib/utils/extrude_polyline.js +0 -653
  617. package/lib/utils/grid-index.js +0 -188
  618. package/lib/utils/layerData.js +0 -191
  619. package/lib/utils/multiPassRender.js +0 -61
  620. package/lib/utils/polylineNormal.js +0 -230
  621. package/lib/utils/simpleLine.js +0 -116
  622. package/lib/utils/symbol-layout.js +0 -308
  623. package/lib/utils/updateShape.js +0 -27
  624. package/lib/wind/index.js +0 -111
  625. package/lib/wind/models/index.js +0 -16
  626. package/lib/wind/models/utils.js +0 -253
  627. package/lib/wind/models/wind.js +0 -346
  628. package/lib/wind/models/windRender.js +0 -373
  629. package/lib/wind/models/windShader.js +0 -25
  630. package/lib/wind/shaders/wind_frag.glsl +0 -9
  631. package/lib/wind/shaders/wind_vert.glsl +0 -17
@@ -1,1430 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import _objectSpread from "@babel/runtime/helpers/objectSpread2";
4
- import _initializerDefineProperty from "@babel/runtime/helpers/initializerDefineProperty";
5
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
6
- import _createClass from "@babel/runtime/helpers/createClass";
7
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
8
- import _inherits from "@babel/runtime/helpers/inherits";
9
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
10
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
11
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
12
- import _applyDecoratedDescriptor from "@babel/runtime/helpers/applyDecoratedDescriptor";
13
- import _initializerWarningHelper from "@babel/runtime/helpers/initializerWarningHelper";
14
- var _excluded = ["passes"],
15
- _excluded2 = ["moduleName", "vertexShader", "fragmentShader", "triangulation", "segmentNumber", "workerEnabled", "workerOptions"];
16
-
17
- var _dec, _class, _descriptor;
18
-
19
- import _regeneratorRuntime from "@babel/runtime/regenerator";
20
-
21
- 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; } } }; }
22
-
23
- 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); }
24
-
25
- 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; }
26
-
27
- 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); }; }
28
-
29
- 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; } }
30
-
31
- // @ts-ignore
32
- import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
33
- import { BlendType, lazyInject, TYPES } from '@antv/l7-core';
34
- import Source from '@antv/l7-source';
35
- import { encodePickingColor, WorkerSourceMap } from '@antv/l7-utils';
36
- import { EventEmitter } from 'eventemitter3';
37
- import { isFunction, isObject, isUndefined } from 'lodash';
38
- import { BlendTypes } from "../utils/blend";
39
- import { handleStyleDataMapping } from "../utils/dataMappingStyle";
40
- import { calculateData } from "../utils/layerData";
41
- import { createMultiPassRenderer, normalizePasses } from "../utils/multiPassRender";
42
- import { updateShape } from "../utils/updateShape";
43
- /**
44
- * 分配 layer id
45
- */
46
-
47
- var layerIdCounter = 0;
48
- var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__PURE__*/function (_ref) {
49
- _inherits(BaseLayer, _ref);
50
-
51
- var _super = _createSuper(BaseLayer);
52
-
53
- // 生命周期钩子
54
- // 待渲染 model 列表
55
- // 用于保存子图层对象
56
- // Tip: 用于标识矢量图层
57
-
58
- /**
59
- * 待更新样式属性,在初始化阶段完成注册
60
- */
61
- // Tip: layer 保底颜色
62
- // private pickingPassRender: IPass<'pixelPicking'>;
63
- function BaseLayer() {
64
- var _this;
65
-
66
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
67
-
68
- _classCallCheck(this, BaseLayer);
69
-
70
- _this = _super.call(this);
71
-
72
- _defineProperty(_assertThisInitialized(_this), "id", "".concat(layerIdCounter++));
73
-
74
- _defineProperty(_assertThisInitialized(_this), "name", "".concat(layerIdCounter));
75
-
76
- _defineProperty(_assertThisInitialized(_this), "visible", true);
77
-
78
- _defineProperty(_assertThisInitialized(_this), "zIndex", 0);
79
-
80
- _defineProperty(_assertThisInitialized(_this), "inited", false);
81
-
82
- _defineProperty(_assertThisInitialized(_this), "layerModelNeedUpdate", false);
83
-
84
- _defineProperty(_assertThisInitialized(_this), "pickedFeatureID", null);
85
-
86
- _defineProperty(_assertThisInitialized(_this), "selectedFeatureID", null);
87
-
88
- _defineProperty(_assertThisInitialized(_this), "styleNeedUpdate", false);
89
-
90
- _defineProperty(_assertThisInitialized(_this), "forceRender", false);
91
-
92
- _defineProperty(_assertThisInitialized(_this), "clusterZoom", 0);
93
-
94
- _defineProperty(_assertThisInitialized(_this), "defaultSourceConfig", {
95
- data: [],
96
- options: {
97
- parser: {
98
- type: 'json'
99
- }
100
- }
101
- });
102
-
103
- _defineProperty(_assertThisInitialized(_this), "dataState", {
104
- dataSourceNeedUpdate: false,
105
- dataMappingNeedUpdate: false,
106
- filterNeedUpdate: false,
107
- featureScaleNeedUpdate: false,
108
- StyleAttrNeedUpdate: false
109
- });
110
-
111
- _defineProperty(_assertThisInitialized(_this), "hooks", {
112
- init: new SyncBailHook(),
113
- afterInit: new SyncBailHook(),
114
- beforeRender: new SyncBailHook(),
115
- beforeRenderData: new SyncWaterfallHook(),
116
- afterRender: new SyncHook(),
117
- beforePickingEncode: new SyncHook(),
118
- afterPickingEncode: new SyncHook(),
119
- beforeHighlight: new SyncHook(['pickedColor']),
120
- afterHighlight: new SyncHook(),
121
- beforeSelect: new SyncHook(['pickedColor']),
122
- afterSelect: new SyncHook(),
123
- beforeDestroy: new SyncHook(),
124
- afterDestroy: new SyncHook()
125
- });
126
-
127
- _defineProperty(_assertThisInitialized(_this), "models", []);
128
-
129
- _defineProperty(_assertThisInitialized(_this), "modelLoaded", false);
130
-
131
- _defineProperty(_assertThisInitialized(_this), "layerChildren", []);
132
-
133
- _defineProperty(_assertThisInitialized(_this), "masks", []);
134
-
135
- _defineProperty(_assertThisInitialized(_this), "isVector", false);
136
-
137
- _initializerDefineProperty(_assertThisInitialized(_this), "configService", _descriptor, _assertThisInitialized(_this));
138
-
139
- _defineProperty(_assertThisInitialized(_this), "animateOptions", {
140
- enable: false
141
- });
142
-
143
- _defineProperty(_assertThisInitialized(_this), "currentPickId", null);
144
-
145
- _defineProperty(_assertThisInitialized(_this), "pendingStyleAttributes", []);
146
-
147
- _defineProperty(_assertThisInitialized(_this), "scaleOptions", {});
148
-
149
- _defineProperty(_assertThisInitialized(_this), "animateStatus", false);
150
-
151
- _defineProperty(_assertThisInitialized(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
152
-
153
- _defineProperty(_assertThisInitialized(_this), "isDestroyed", false);
154
-
155
- _defineProperty(_assertThisInitialized(_this), "encodeDataLength", 0);
156
-
157
- _defineProperty(_assertThisInitialized(_this), "sourceEvent", function () {
158
- _this.dataState.dataSourceNeedUpdate = true;
159
-
160
- var layerConfig = _this.getLayerConfig();
161
-
162
- if (layerConfig && layerConfig.autoFit) {
163
- _this.fitBounds(layerConfig.fitBoundsOptions);
164
- }
165
-
166
- _this.reRender();
167
- });
168
-
169
- _this.name = config.name || _this.id;
170
- _this.zIndex = config.zIndex || 0;
171
- _this.rawConfig = config;
172
- return _this;
173
- }
174
-
175
- _createClass(BaseLayer, [{
176
- key: "addMaskLayer",
177
- value: function addMaskLayer(maskLayer) {
178
- this.masks.push(maskLayer);
179
- }
180
- }, {
181
- key: "removeMaskLayer",
182
- value: function removeMaskLayer(maskLayer) {
183
- var layerIndex = this.masks.indexOf(maskLayer);
184
-
185
- if (layerIndex > -1) {
186
- this.masks.splice(layerIndex, 1);
187
- }
188
-
189
- maskLayer.destroy();
190
- }
191
- }, {
192
- key: "getAttribute",
193
- value: function getAttribute(name) {
194
- return this.styleAttributeService.getLayerStyleAttribute(name);
195
- }
196
- }, {
197
- key: "getLayerConfig",
198
- value: function getLayerConfig() {
199
- return this.configService.getLayerConfig(this.id);
200
- }
201
- }, {
202
- key: "updateLayerConfig",
203
- value: function updateLayerConfig(configToUpdate) {
204
- var _this2 = this;
205
-
206
- // 同步 rawConfig
207
- Object.keys(configToUpdate).map(function (key) {
208
- if (key in _this2.rawConfig) {
209
- // @ts-ignore
210
- _this2.rawConfig[key] = configToUpdate[key];
211
- }
212
- });
213
-
214
- if (!this.inited) {
215
- this.needUpdateConfig = _objectSpread(_objectSpread({}, this.needUpdateConfig), configToUpdate);
216
- } else {
217
- var sceneId = this.container.get(TYPES.SceneID); // @ts-ignore
218
-
219
- handleStyleDataMapping(configToUpdate, this); // 处理 style 中进行数据映射的属性字段
220
-
221
- this.configService.setLayerConfig(sceneId, this.id, _objectSpread(_objectSpread(_objectSpread({}, this.configService.getLayerConfig(this.id)), this.needUpdateConfig), configToUpdate));
222
- this.needUpdateConfig = {};
223
- }
224
- }
225
- /**
226
- * 注入图层容器,父容器为场景容器
227
- * RootContainer 1
228
- * -> SceneContainer 1.*
229
- * -> LayerContainer 1.*
230
- */
231
-
232
- }, {
233
- key: "setContainer",
234
- value: function setContainer(container, sceneContainer) {
235
- this.container = container;
236
- this.sceneContainer = sceneContainer;
237
- }
238
- }, {
239
- key: "getContainer",
240
- value: function getContainer() {
241
- return this.container;
242
- }
243
- }, {
244
- key: "setBottomColor",
245
- value: function setBottomColor(color) {
246
- this.bottomColor = color;
247
- }
248
- }, {
249
- key: "getBottomColor",
250
- value: function getBottomColor() {
251
- return this.bottomColor;
252
- }
253
- }, {
254
- key: "addPlugin",
255
- value: function addPlugin(plugin) {
256
- this.plugins.push(plugin);
257
- return this;
258
- }
259
- }, {
260
- key: "init",
261
- value: function init() {
262
- var _this3 = this;
263
-
264
- // 设置配置项
265
- var sceneId = this.container.get(TYPES.SceneID); // 初始化图层配置项
266
- // const { enableMultiPassRenderer = false } = this.rawConfig;
267
- // this.configService.setLayerConfig(sceneId, this.id, {
268
- // enableMultiPassRenderer,
269
- // });
270
-
271
- this.configService.setLayerConfig(sceneId, this.id, this.rawConfig);
272
- this.layerType = this.rawConfig.layerType; // 全局容器服务
273
- // 场景容器服务
274
-
275
- this.iconService = this.container.get(TYPES.IIconService);
276
- this.fontService = this.container.get(TYPES.IFontService);
277
- this.rendererService = this.container.get(TYPES.IRendererService);
278
- this.layerService = this.container.get(TYPES.ILayerService);
279
- this.interactionService = this.container.get(TYPES.IInteractionService);
280
- this.pickingService = this.container.get(TYPES.IPickingService);
281
- this.mapService = this.container.get(TYPES.IMapService);
282
-
283
- var _this$getLayerConfig = this.getLayerConfig(),
284
- enableMultiPassRenderer = _this$getLayerConfig.enableMultiPassRenderer,
285
- passes = _this$getLayerConfig.passes;
286
-
287
- if (enableMultiPassRenderer && passes !== null && passes !== void 0 && passes.length && passes.length > 0) {
288
- // Tip: 兼容 multiPassRender 在 amap1 时存在的图层不同步问题 zoom
289
- this.mapService.on('mapAfterFrameChange', function () {
290
- _this3.renderLayers();
291
- });
292
- }
293
-
294
- this.cameraService = this.container.get(TYPES.ICameraService);
295
- this.coordinateService = this.container.get(TYPES.ICoordinateSystemService);
296
- this.shaderModuleService = this.container.get(TYPES.IShaderModuleService);
297
- this.postProcessingPassFactory = this.container.get(TYPES.IFactoryPostProcessingPass);
298
- this.normalPassFactory = this.container.get(TYPES.IFactoryNormalPass); // 图层容器服务
299
-
300
- this.styleAttributeService = this.container.get(TYPES.IStyleAttributeService);
301
- this.multiPassRenderer = this.container.get(TYPES.IMultiPassRenderer);
302
- this.multiPassRenderer.setLayer(this); // 完成样式服务注册完成前添加的属性
303
-
304
- this.pendingStyleAttributes.forEach(function (_ref2) {
305
- var attributeName = _ref2.attributeName,
306
- attributeField = _ref2.attributeField,
307
- attributeValues = _ref2.attributeValues,
308
- updateOptions = _ref2.updateOptions;
309
-
310
- _this3.styleAttributeService.updateStyleAttribute(attributeName, {
311
- // @ts-ignore
312
- scale: _objectSpread({
313
- field: attributeField
314
- }, _this3.splitValuesAndCallbackInAttribute( // @ts-ignore
315
- attributeValues, // @ts-ignore
316
- _this3.getLayerConfig()[attributeName]))
317
- }, // @ts-ignore
318
- updateOptions);
319
- });
320
- this.pendingStyleAttributes = []; // 获取插件集
321
-
322
- this.plugins = this.container.getAll(TYPES.ILayerPlugin); // 完成插件注册,传入场景和图层容器内的服务
323
-
324
- var _iterator = _createForOfIteratorHelper(this.plugins),
325
- _step;
326
-
327
- try {
328
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
329
- var plugin = _step.value;
330
- plugin.apply(this, {
331
- rendererService: this.rendererService,
332
- mapService: this.mapService,
333
- styleAttributeService: this.styleAttributeService,
334
- normalPassFactory: this.normalPassFactory,
335
- postProcessingPassFactory: this.postProcessingPassFactory
336
- });
337
- } // 触发 init 生命周期插件
338
-
339
- } catch (err) {
340
- _iterator.e(err);
341
- } finally {
342
- _iterator.f();
343
- }
344
-
345
- this.hooks.init.call(); // this.pickingPassRender = this.normalPassFactory('pixelPicking');
346
- // this.pickingPassRender.init(this);
347
-
348
- this.hooks.afterInit.call(); // 触发初始化完成事件;
349
-
350
- this.emit('inited', {
351
- target: this,
352
- type: 'inited'
353
- });
354
- this.emit('add', {
355
- target: this,
356
- type: 'add'
357
- });
358
- return this;
359
- }
360
- }, {
361
- key: "updateModelData",
362
- value: function updateModelData(data) {
363
- if (data.attributes && data.elements) {
364
- this.models.map(function (m) {
365
- m.updateAttributesAndElements(data.attributes, data.elements);
366
- });
367
- } else {
368
- console.warn('data error');
369
- }
370
- }
371
- }, {
372
- key: "createModelData",
373
- value: function createModelData(data, option) {
374
- var _this$layerModel;
375
-
376
- if ((_this$layerModel = this.layerModel) !== null && _this$layerModel !== void 0 && _this$layerModel.createModelData) {
377
- // 在某些特殊图层中单独构建 attribute & elements
378
- return this.layerModel.createModelData(option);
379
- }
380
-
381
- var calEncodeData = this.calculateEncodeData(data, option);
382
- var triangulation = this.triangulation;
383
-
384
- if (calEncodeData && triangulation) {
385
- return this.styleAttributeService.createAttributesAndIndices(calEncodeData, triangulation);
386
- } else {
387
- return {
388
- attributes: undefined,
389
- elements: undefined
390
- };
391
- }
392
- }
393
- }, {
394
- key: "calculateEncodeData",
395
- value: function calculateEncodeData(data, option) {
396
- if (this.inited) {
397
- return calculateData(this, this.fontService, this.mapService, this.styleAttributeService, data, option);
398
- } else {
399
- console.warn('layer not inited!');
400
- return null;
401
- }
402
- }
403
- /**
404
- * Model初始化前需要更新Model样式
405
- */
406
-
407
- }, {
408
- key: "prepareBuildModel",
409
- value: function prepareBuildModel() {
410
- this.inited = true;
411
- this.updateLayerConfig(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig)); // 启动动画
412
-
413
- var _this$getLayerConfig2 = this.getLayerConfig(),
414
- animateOption = _this$getLayerConfig2.animateOption;
415
-
416
- if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
417
- this.layerService.startAnimate();
418
- this.animateStatus = true;
419
- }
420
- }
421
- }, {
422
- key: "color",
423
- value: function color(field, values, updateOptions) {
424
- this.updateStyleAttribute('color', field, values, updateOptions);
425
- return this;
426
- } // 为对应的图层传入纹理的编号名称(point/image 在 shape 方法中传入纹理名称的方法并不通用)
427
-
428
- }, {
429
- key: "texture",
430
- value: function texture(field, values, updateOptions) {
431
- this.updateStyleAttribute('texture', field, values, updateOptions);
432
- return this;
433
- }
434
- }, {
435
- key: "rotate",
436
- value: function rotate(field, values, updateOptions) {
437
- this.updateStyleAttribute('rotate', field, values, updateOptions);
438
- return this;
439
- }
440
- }, {
441
- key: "size",
442
- value: function size(field, values, updateOptions) {
443
- this.updateStyleAttribute('size', field, values, updateOptions);
444
- return this;
445
- } // 对mapping后的数据过滤,scale保持不变
446
-
447
- }, {
448
- key: "filter",
449
- value: function filter(field, values, updateOptions) {
450
- this.updateStyleAttribute('filter', field, values, updateOptions);
451
- return this;
452
- }
453
- }, {
454
- key: "shape",
455
- value: function shape(field, values, updateOptions) {
456
- var _this$styleAttributeS, _this$styleAttributeS2, _this$styleAttributeS3;
457
-
458
- var lastShape = (_this$styleAttributeS = this.styleAttributeService) === null || _this$styleAttributeS === void 0 ? void 0 : (_this$styleAttributeS2 = _this$styleAttributeS.getLayerStyleAttribute('shape')) === null || _this$styleAttributeS2 === void 0 ? void 0 : (_this$styleAttributeS3 = _this$styleAttributeS2.scale) === null || _this$styleAttributeS3 === void 0 ? void 0 : _this$styleAttributeS3.field;
459
- var currentShape = field;
460
- this.shapeOption = {
461
- field: field,
462
- values: values
463
- };
464
- this.updateStyleAttribute('shape', field, values, updateOptions); // Tip: 根据 shape 判断是否需要更新 model
465
-
466
- if (!this.tileLayer) {
467
- updateShape(this, lastShape, currentShape);
468
- }
469
-
470
- return this;
471
- }
472
- }, {
473
- key: "label",
474
- value: function label(field, values, updateOptions) {
475
- this.pendingStyleAttributes.push({
476
- attributeName: 'label',
477
- attributeField: field,
478
- attributeValues: values,
479
- updateOptions: updateOptions
480
- });
481
- return this;
482
- }
483
- }, {
484
- key: "animate",
485
- value: function animate(options) {
486
- var rawAnimate = {};
487
-
488
- if (isObject(options)) {
489
- rawAnimate.enable = true;
490
- rawAnimate = _objectSpread(_objectSpread({}, rawAnimate), options);
491
- } else {
492
- rawAnimate.enable = options;
493
- }
494
-
495
- this.updateLayerConfig({
496
- animateOption: rawAnimate
497
- });
498
- return this;
499
- }
500
- }, {
501
- key: "source",
502
- value: function source(data, options) {
503
- if ((data === null || data === void 0 ? void 0 : data.type) === 'source') {
504
- // 判断是否为source
505
- this.setSource(data);
506
- return this;
507
- }
508
-
509
- this.sourceOption = {
510
- data: data,
511
- options: options
512
- };
513
- this.clusterZoom = 0;
514
- return this;
515
- }
516
- }, {
517
- key: "setData",
518
- value: function setData(data, options) {
519
- var _this4 = this;
520
-
521
- if (this.inited) {
522
- this.layerSource.setData(data, options);
523
- } else {
524
- this.on('inited', function () {
525
- var currentSource = _this4.getSource();
526
-
527
- if (!currentSource) {
528
- // 执行 setData 的时候 source 还不存在(还未执行 addLayer)
529
- _this4.source(new Source(data, options));
530
-
531
- _this4.sourceEvent();
532
- } else {
533
- _this4.layerSource.setData(data, options);
534
- } // this.layerSource.setData(data, options);
535
-
536
- });
537
- }
538
-
539
- return this;
540
- }
541
- }, {
542
- key: "style",
543
- value: function style(options) {
544
- var _this5 = this;
545
-
546
- var lastConfig = this.getLayerConfig();
547
-
548
- var passes = options.passes,
549
- rest = _objectWithoutProperties(options, _excluded); // passes 特殊处理
550
-
551
-
552
- if (passes) {
553
- normalizePasses(passes).forEach(function (pass) {
554
- var postProcessingPass = _this5.multiPassRenderer.getPostProcessor().getPostProcessingPassByName(pass[0]);
555
-
556
- if (postProcessingPass) {
557
- postProcessingPass.updateOptions(pass[1]);
558
- }
559
- });
560
- }
561
-
562
- this.rawConfig = _objectSpread(_objectSpread({}, this.rawConfig), rest);
563
-
564
- if (this.container) {
565
- this.updateLayerConfig(this.rawConfig);
566
- this.styleNeedUpdate = true;
567
- } // @ts-ignore
568
-
569
-
570
- if (lastConfig && lastConfig.mask === true && options.mask === false) {
571
- this.clearModels();
572
- this.layerModel.buildModels(function (models) {
573
- _this5.models = models;
574
- });
575
- }
576
-
577
- return this;
578
- }
579
- }, {
580
- key: "scale",
581
- value: function scale(field, cfg) {
582
- if (isObject(field)) {
583
- this.scaleOptions = _objectSpread(_objectSpread({}, this.scaleOptions), field);
584
- } else {
585
- this.scaleOptions[field] = cfg;
586
- }
587
-
588
- return this;
589
- }
590
- /**
591
- * 渲染所有的图层
592
- */
593
-
594
- }, {
595
- key: "renderLayers",
596
- value: function renderLayers() {
597
- this.rendering = true;
598
- this.layerService.renderLayers();
599
- this.rendering = false;
600
- }
601
- }, {
602
- key: "render",
603
- value: function render() {
604
- if (this.tileLayer) {
605
- // 瓦片图层执行单独的 render 渲染队列
606
- this.tileLayer.render();
607
- return this;
608
- }
609
-
610
- if (this.encodeDataLength <= 0 && !this.forceRender) return this; // Tip: this.getEncodedData().length !== 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
611
-
612
- this.renderModels();
613
- return this;
614
- }
615
- /**
616
- * renderMultiPass 专门用于渲染支持 multipass 的 layer
617
- */
618
-
619
- }, {
620
- key: "renderMultiPass",
621
- value: function () {
622
- var _renderMultiPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
623
- return _regeneratorRuntime.wrap(function _callee$(_context) {
624
- while (1) {
625
- switch (_context.prev = _context.next) {
626
- case 0:
627
- if (!(this.encodeDataLength <= 0 && !this.forceRender)) {
628
- _context.next = 2;
629
- break;
630
- }
631
-
632
- return _context.abrupt("return");
633
-
634
- case 2:
635
- if (!(this.multiPassRenderer && this.multiPassRenderer.getRenderFlag())) {
636
- _context.next = 7;
637
- break;
638
- }
639
-
640
- _context.next = 5;
641
- return this.multiPassRenderer.render();
642
-
643
- case 5:
644
- _context.next = 8;
645
- break;
646
-
647
- case 7:
648
- if (this.multiPassRenderer) {
649
- // renderPass 触发的渲染
650
- this.renderModels();
651
- } else {
652
- this.renderModels();
653
- }
654
-
655
- case 8:
656
- case "end":
657
- return _context.stop();
658
- }
659
- }
660
- }, _callee, this);
661
- }));
662
-
663
- function renderMultiPass() {
664
- return _renderMultiPass.apply(this, arguments);
665
- }
666
-
667
- return renderMultiPass;
668
- }()
669
- }, {
670
- key: "active",
671
- value: function active(options) {
672
- var activeOption = {};
673
- activeOption.enableHighlight = isObject(options) ? true : options;
674
-
675
- if (isObject(options)) {
676
- activeOption.enableHighlight = true;
677
-
678
- if (options.color) {
679
- activeOption.highlightColor = options.color;
680
- }
681
-
682
- if (options.mix) {
683
- activeOption.activeMix = options.mix;
684
- }
685
- } else {
686
- activeOption.enableHighlight = !!options;
687
- }
688
-
689
- this.updateLayerConfig(activeOption);
690
- return this;
691
- }
692
- }, {
693
- key: "setActive",
694
- value: function setActive(id, options) {
695
- var _this6 = this;
696
-
697
- if (isObject(id)) {
698
- var _id$x = id.x,
699
- x = _id$x === void 0 ? 0 : _id$x,
700
- _id$y = id.y,
701
- y = _id$y === void 0 ? 0 : _id$y;
702
- this.updateLayerConfig({
703
- highlightColor: isObject(options) ? options.color : this.getLayerConfig().highlightColor,
704
- activeMix: isObject(options) ? options.mix : this.getLayerConfig().activeMix
705
- });
706
- this.pick({
707
- x: x,
708
- y: y
709
- });
710
- } else {
711
- this.updateLayerConfig({
712
- pickedFeatureID: id,
713
- highlightColor: isObject(options) ? options.color : this.getLayerConfig().highlightColor,
714
- activeMix: isObject(options) ? options.mix : this.getLayerConfig().activeMix
715
- });
716
- this.hooks.beforeSelect.call(encodePickingColor(id)) // @ts-ignore
717
- .then(function () {
718
- setTimeout(function () {
719
- _this6.reRender();
720
- }, 1);
721
- });
722
- }
723
- }
724
- }, {
725
- key: "select",
726
- value: function select(option) {
727
- var activeOption = {};
728
- activeOption.enableSelect = isObject(option) ? true : option;
729
-
730
- if (isObject(option)) {
731
- activeOption.enableSelect = true;
732
-
733
- if (option.color) {
734
- activeOption.selectColor = option.color;
735
- }
736
-
737
- if (option.mix) {
738
- activeOption.selectMix = option.mix;
739
- }
740
- } else {
741
- activeOption.enableSelect = !!option;
742
- }
743
-
744
- this.updateLayerConfig(activeOption);
745
- return this;
746
- }
747
- }, {
748
- key: "setSelect",
749
- value: function setSelect(id, options) {
750
- var _this7 = this;
751
-
752
- if (isObject(id)) {
753
- var _id$x2 = id.x,
754
- x = _id$x2 === void 0 ? 0 : _id$x2,
755
- _id$y2 = id.y,
756
- y = _id$y2 === void 0 ? 0 : _id$y2;
757
- this.updateLayerConfig({
758
- selectColor: isObject(options) ? options.color : this.getLayerConfig().selectColor,
759
- selectMix: isObject(options) ? options.mix : this.getLayerConfig().selectMix
760
- });
761
- this.pick({
762
- x: x,
763
- y: y
764
- });
765
- } else {
766
- this.updateLayerConfig({
767
- pickedFeatureID: id,
768
- selectColor: isObject(options) ? options.color : this.getLayerConfig().selectColor,
769
- selectMix: isObject(options) ? options.mix : this.getLayerConfig().selectMix
770
- });
771
- this.hooks.beforeSelect.call(encodePickingColor(id)) // @ts-ignore
772
- .then(function () {
773
- setTimeout(function () {
774
- _this7.reRender();
775
- }, 1);
776
- });
777
- }
778
- }
779
- }, {
780
- key: "setBlend",
781
- value: function setBlend(type) {
782
- this.updateLayerConfig({
783
- blend: type
784
- });
785
- this.layerModelNeedUpdate = true;
786
- this.reRender();
787
- return this;
788
- }
789
- }, {
790
- key: "show",
791
- value: function show() {
792
- this.updateLayerConfig({
793
- visible: true
794
- });
795
- this.reRender();
796
- return this;
797
- }
798
- }, {
799
- key: "hide",
800
- value: function hide() {
801
- this.updateLayerConfig({
802
- visible: false
803
- });
804
- this.reRender();
805
- return this;
806
- }
807
- }, {
808
- key: "setIndex",
809
- value: function setIndex(index) {
810
- this.zIndex = index;
811
- this.layerService.updateLayerRenderList();
812
- this.layerService.renderLayers();
813
- return this;
814
- }
815
- }, {
816
- key: "setCurrentPickId",
817
- value: function setCurrentPickId(id) {
818
- this.currentPickId = id;
819
- }
820
- }, {
821
- key: "getCurrentPickId",
822
- value: function getCurrentPickId() {
823
- return this.currentPickId;
824
- }
825
- }, {
826
- key: "setCurrentSelectedId",
827
- value: function setCurrentSelectedId(id) {
828
- this.selectedFeatureID = id;
829
- }
830
- }, {
831
- key: "getCurrentSelectedId",
832
- value: function getCurrentSelectedId() {
833
- return this.selectedFeatureID;
834
- }
835
- }, {
836
- key: "isVisible",
837
- value: function isVisible() {
838
- var zoom = this.mapService.getZoom();
839
-
840
- var _this$getLayerConfig3 = this.getLayerConfig(),
841
- visible = _this$getLayerConfig3.visible,
842
- _this$getLayerConfig4 = _this$getLayerConfig3.minZoom,
843
- minZoom = _this$getLayerConfig4 === void 0 ? -Infinity : _this$getLayerConfig4,
844
- _this$getLayerConfig5 = _this$getLayerConfig3.maxZoom,
845
- maxZoom = _this$getLayerConfig5 === void 0 ? Infinity : _this$getLayerConfig5;
846
-
847
- return !!visible && zoom >= minZoom && zoom <= maxZoom;
848
- }
849
- }, {
850
- key: "setMultiPass",
851
- value: function setMultiPass(enableMultiPass, currentPasses) {
852
- this.updateLayerConfig({
853
- enableMultiPassRenderer: enableMultiPass
854
- });
855
-
856
- if (currentPasses) {
857
- this.updateLayerConfig({
858
- passes: currentPasses
859
- });
860
- }
861
-
862
- if (enableMultiPass) {
863
- var _this$getLayerConfig6 = this.getLayerConfig(),
864
- _this$getLayerConfig7 = _this$getLayerConfig6.passes,
865
- passes = _this$getLayerConfig7 === void 0 ? [] : _this$getLayerConfig7;
866
-
867
- this.multiPassRenderer = createMultiPassRenderer(this, passes, this.postProcessingPassFactory, this.normalPassFactory);
868
- this.multiPassRenderer.setRenderFlag(true);
869
-
870
- var _this$rendererService = this.rendererService.getViewportSize(),
871
- width = _this$rendererService.width,
872
- height = _this$rendererService.height;
873
-
874
- this.multiPassRenderer.resize(width, height);
875
- }
876
-
877
- return this;
878
- }
879
- }, {
880
- key: "setMinZoom",
881
- value: function setMinZoom(minZoom) {
882
- this.updateLayerConfig({
883
- minZoom: minZoom
884
- });
885
- return this;
886
- }
887
- }, {
888
- key: "getMinZoom",
889
- value: function getMinZoom() {
890
- var _this$getLayerConfig8 = this.getLayerConfig(),
891
- minZoom = _this$getLayerConfig8.minZoom;
892
-
893
- return minZoom;
894
- }
895
- }, {
896
- key: "getMaxZoom",
897
- value: function getMaxZoom() {
898
- var _this$getLayerConfig9 = this.getLayerConfig(),
899
- maxZoom = _this$getLayerConfig9.maxZoom;
900
-
901
- return maxZoom;
902
- }
903
- }, {
904
- key: "get",
905
- value: function get(name) {
906
- var cfg = this.getLayerConfig(); // @ts-ignore
907
-
908
- return cfg[name];
909
- }
910
- }, {
911
- key: "setMaxZoom",
912
- value: function setMaxZoom(maxZoom) {
913
- this.updateLayerConfig({
914
- maxZoom: maxZoom
915
- });
916
- return this;
917
- }
918
- }, {
919
- key: "setAutoFit",
920
- value: function setAutoFit(autoFit) {
921
- this.updateLayerConfig({
922
- autoFit: autoFit
923
- });
924
- return this;
925
- }
926
- /**
927
- * zoom to layer Bounds
928
- */
929
-
930
- }, {
931
- key: "fitBounds",
932
- value: function fitBounds(fitBoundsOptions) {
933
- if (!this.inited) {
934
- this.updateLayerConfig({
935
- autoFit: true
936
- });
937
- return this;
938
- }
939
-
940
- var source = this.getSource();
941
- var extent = source.extent;
942
- var isValid = extent.some(function (v) {
943
- return Math.abs(v) === Infinity;
944
- });
945
-
946
- if (isValid) {
947
- return this;
948
- }
949
-
950
- this.mapService.fitBounds([[extent[0], extent[1]], [extent[2], extent[3]]], fitBoundsOptions);
951
- return this;
952
- }
953
- }, {
954
- key: "destroy",
955
- value: function destroy() {
956
- var _this$multiPassRender, _this$layerModel2, _this$tileLayer;
957
-
958
- var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
959
-
960
- if (this.isDestroyed) {
961
- return;
962
- } // remove child layer
963
-
964
-
965
- this.layerChildren.map(function (child) {
966
- return child.destroy(false);
967
- });
968
- this.layerChildren = []; // remove mask list
969
-
970
- this.masks.map(function (mask) {
971
- return mask.destroy(false);
972
- });
973
- this.masks = [];
974
- this.hooks.beforeDestroy.call(); // 清除sources事件
975
-
976
- this.layerSource.off('sourceUpdate', this.sourceEvent);
977
- (_this$multiPassRender = this.multiPassRenderer) === null || _this$multiPassRender === void 0 ? void 0 : _this$multiPassRender.destroy(); // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());
978
-
979
- this.styleAttributeService.clearAllAttributes(); // 执行每个图层单独的 clearModels 方法 (清除一些额外的 texture、program、buffer 等)
980
-
981
- this.hooks.afterDestroy.call(); // Tip: 清除各个图层自定义的 models 资源
982
-
983
- (_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels(refresh);
984
- (_this$tileLayer = this.tileLayer) === null || _this$tileLayer === void 0 ? void 0 : _this$tileLayer.destroy();
985
- this.models = [];
986
- this.layerService.cleanRemove(this, refresh);
987
- this.emit('remove', {
988
- target: this,
989
- type: 'remove'
990
- });
991
- this.emit('destroy', {
992
- target: this,
993
- type: 'destroy'
994
- });
995
- this.removeAllListeners(); // 解绑图层容器中的服务
996
- // this.container.unbind(TYPES.IStyleAttributeService);
997
-
998
- this.isDestroyed = true;
999
- }
1000
- }, {
1001
- key: "clear",
1002
- value: function clear() {
1003
- this.styleAttributeService.clearAllAttributes(); // 销毁所有 model
1004
- }
1005
- }, {
1006
- key: "clearModels",
1007
- value: function clearModels() {
1008
- var _this$layerModel3;
1009
-
1010
- this.models.forEach(function (model) {
1011
- return model.destroy();
1012
- });
1013
- (_this$layerModel3 = this.layerModel) === null || _this$layerModel3 === void 0 ? void 0 : _this$layerModel3.clearModels();
1014
- this.models = [];
1015
- }
1016
- }, {
1017
- key: "isDirty",
1018
- value: function isDirty() {
1019
- return !!(this.styleAttributeService.getLayerStyleAttributes() || []).filter(function (attribute) {
1020
- return attribute.needRescale || attribute.needRemapping || attribute.needRegenerateVertices;
1021
- }).length;
1022
- }
1023
- }, {
1024
- key: "setSource",
1025
- value: function setSource(source) {
1026
- var _this8 = this;
1027
-
1028
- // 清除旧 sources 事件
1029
- if (this.layerSource) {
1030
- this.layerSource.off('sourceUpdate', this.sourceEvent);
1031
- }
1032
-
1033
- this.layerSource = source;
1034
- this.clusterZoom = 0; // 已 inited 且启用聚合进行更新聚合数据
1035
-
1036
- if (this.inited && this.layerSource.cluster) {
1037
- var zoom = this.mapService.getZoom();
1038
- this.layerSource.updateClusterData(zoom);
1039
- } // source 可能会复用,会在其它layer被修改
1040
-
1041
-
1042
- if (this.layerSource.inited) {
1043
- this.sourceEvent();
1044
- } // this.layerSource.inited 为 true 后,sourceUpdate 事件不会再触发
1045
-
1046
-
1047
- this.layerSource.on('sourceUpdate', function () {
1048
- if (_this8.coordCenter === undefined) {
1049
- var layerCenter = _this8.layerSource.center;
1050
- _this8.coordCenter = layerCenter;
1051
- _this8.mapService.setCoordCenter && _this8.mapService.setCoordCenter(layerCenter); // // @ts-ignore
1052
- // this.mapService.map.customCoords.setCenter(layerCenter);
1053
- // // @ts-ignore
1054
- // this.mapService.setCustomCoordCenter(layerCenter);
1055
- }
1056
-
1057
- _this8.sourceEvent();
1058
- });
1059
- }
1060
- }, {
1061
- key: "getSource",
1062
- value: function getSource() {
1063
- return this.layerSource;
1064
- }
1065
- }, {
1066
- key: "getScaleOptions",
1067
- value: function getScaleOptions() {
1068
- return this.scaleOptions;
1069
- }
1070
- }, {
1071
- key: "setEncodedData",
1072
- value: function setEncodedData(encodedData) {
1073
- this.encodedData = encodedData;
1074
- this.encodeDataLength = encodedData.length;
1075
- }
1076
- }, {
1077
- key: "getEncodedData",
1078
- value: function getEncodedData() {
1079
- return this.encodedData;
1080
- }
1081
- }, {
1082
- key: "getScale",
1083
- value: function getScale(name) {
1084
- return this.styleAttributeService.getLayerAttributeScale(name);
1085
- }
1086
- }, {
1087
- key: "getLegendItems",
1088
- value: function getLegendItems(name) {
1089
- var scale = this.styleAttributeService.getLayerAttributeScale(name); // 函数自定义映射,没有 scale 返回为空数组
1090
-
1091
- if (!scale) {
1092
- return [];
1093
- }
1094
-
1095
- if (scale.invertExtent) {
1096
- // 分段类型 Quantize、Quantile、Threshold
1097
- var items = scale.range().map(function (item) {
1098
- return _defineProperty({
1099
- value: scale.invertExtent(item)
1100
- }, name, item);
1101
- });
1102
- return items;
1103
- } else if (scale.ticks) {
1104
- // 连续类型 Continuous (Linear, Power, Log, Identity, Time)
1105
- var _items = scale.ticks().map(function (item) {
1106
- return _defineProperty({
1107
- value: item
1108
- }, name, scale(item));
1109
- });
1110
-
1111
- return _items;
1112
- } else if (scale !== null && scale !== void 0 && scale.domain) {
1113
- // 枚举类型 Cat
1114
- var _items2 = scale.domain().filter(function (item) {
1115
- return !isUndefined(item);
1116
- }).map(function (item) {
1117
- return _defineProperty({
1118
- value: item
1119
- }, name, scale(item));
1120
- });
1121
-
1122
- return _items2;
1123
- }
1124
-
1125
- return [];
1126
- }
1127
- }, {
1128
- key: "pick",
1129
- value: function pick(_ref6) {
1130
- var x = _ref6.x,
1131
- y = _ref6.y;
1132
- this.interactionService.triggerHover({
1133
- x: x,
1134
- y: y
1135
- });
1136
- }
1137
- }, {
1138
- key: "boxSelect",
1139
- value: function boxSelect(box, cb) {
1140
- this.pickingService.boxPickLayer(this, box, cb);
1141
- }
1142
- }, {
1143
- key: "buildLayerModel",
1144
- value: function buildLayerModel(options) {
1145
- var _this9 = this;
1146
-
1147
- var moduleName = options.moduleName,
1148
- vertexShader = options.vertexShader,
1149
- fragmentShader = options.fragmentShader,
1150
- triangulation = options.triangulation,
1151
- segmentNumber = options.segmentNumber,
1152
- _options$workerEnable = options.workerEnabled,
1153
- workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable,
1154
- workerOptions = options.workerOptions,
1155
- rest = _objectWithoutProperties(options, _excluded2);
1156
-
1157
- this.shaderModuleService.registerModule(moduleName, {
1158
- vs: vertexShader,
1159
- fs: fragmentShader
1160
- });
1161
-
1162
- var _this$shaderModuleSer = this.shaderModuleService.getModule(moduleName),
1163
- vs = _this$shaderModuleSer.vs,
1164
- fs = _this$shaderModuleSer.fs,
1165
- uniforms = _this$shaderModuleSer.uniforms;
1166
-
1167
- var createModel = this.rendererService.createModel;
1168
- return new Promise(function (resolve, reject) {
1169
- setTimeout(function () {
1170
- // filter supported worker & worker enabled layer
1171
- if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
1172
- _this9.styleAttributeService.createAttributesAndIndicesAscy(_this9.encodedData, segmentNumber, workerOptions).then(function (_ref7) {
1173
- var attributes = _ref7.attributes,
1174
- elements = _ref7.elements;
1175
- var m = createModel(_objectSpread({
1176
- attributes: attributes,
1177
- uniforms: uniforms,
1178
- fs: fs,
1179
- vs: vs,
1180
- elements: elements,
1181
- blend: BlendTypes[BlendType.normal]
1182
- }, rest));
1183
- resolve(m);
1184
- }).catch(function (err) {
1185
- return reject(err);
1186
- });
1187
- } else {
1188
- // console.log(this.encodedData[1].originCoordinates[0])
1189
- // console.log(this.encodedData[1].coordinates[0])
1190
- var _this9$styleAttribute = _this9.styleAttributeService.createAttributesAndIndices(_this9.encodedData, triangulation, segmentNumber),
1191
- attributes = _this9$styleAttribute.attributes,
1192
- elements = _this9$styleAttribute.elements,
1193
- count = _this9$styleAttribute.count;
1194
-
1195
- var modelOptions = _objectSpread({
1196
- attributes: attributes,
1197
- uniforms: uniforms,
1198
- fs: fs,
1199
- vs: vs,
1200
- elements: elements,
1201
- blend: BlendTypes[BlendType.normal]
1202
- }, rest);
1203
-
1204
- if (count) {
1205
- modelOptions.count = count;
1206
- }
1207
-
1208
- var m = createModel(modelOptions);
1209
- resolve(m);
1210
- }
1211
- });
1212
- });
1213
- }
1214
- }, {
1215
- key: "createAttributes",
1216
- value: function createAttributes(options) {
1217
- var triangulation = options.triangulation; // @ts-ignore
1218
-
1219
- var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
1220
- attributes = _this$styleAttributeS4.attributes;
1221
-
1222
- return attributes;
1223
- }
1224
- }, {
1225
- key: "getTime",
1226
- value: function getTime() {
1227
- return this.layerService.clock.getDelta();
1228
- }
1229
- }, {
1230
- key: "setAnimateStartTime",
1231
- value: function setAnimateStartTime() {
1232
- this.animateStartTime = this.layerService.clock.getElapsedTime();
1233
- }
1234
- }, {
1235
- key: "stopAnimate",
1236
- value: function stopAnimate() {
1237
- if (this.animateStatus) {
1238
- this.layerService.stopAnimate();
1239
- this.animateStatus = false;
1240
- this.updateLayerConfig({
1241
- animateOption: {
1242
- enable: false
1243
- }
1244
- });
1245
- }
1246
- }
1247
- }, {
1248
- key: "getLayerAnimateTime",
1249
- value: function getLayerAnimateTime() {
1250
- return this.layerService.clock.getElapsedTime() - this.animateStartTime;
1251
- }
1252
- }, {
1253
- key: "needPick",
1254
- value: function needPick(type) {
1255
- // 地图图层的判断
1256
- if (this.rawConfig.usage === 'basemap') return false;
1257
-
1258
- var _this$getLayerConfig10 = this.getLayerConfig(),
1259
- _this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
1260
- enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
1261
- _this$getLayerConfig12 = _this$getLayerConfig10.enableSelect,
1262
- enableSelect = _this$getLayerConfig12 === void 0 ? true : _this$getLayerConfig12; // 判断layer是否监听事件;
1263
-
1264
-
1265
- var isPick = this.eventNames().indexOf(type) !== -1 || this.eventNames().indexOf('un' + type) !== -1;
1266
-
1267
- if ((type === 'click' || type === 'dblclick') && enableSelect) {
1268
- isPick = true;
1269
- }
1270
-
1271
- if (type === 'mousemove' && (enableHighlight || this.eventNames().indexOf('mouseenter') !== -1 || this.eventNames().indexOf('unmousemove') !== -1 || this.eventNames().indexOf('mouseout') !== -1)) {
1272
- isPick = true;
1273
- }
1274
-
1275
- return this.isVisible() && isPick;
1276
- }
1277
- }, {
1278
- key: "buildModels",
1279
- value: function buildModels() {
1280
- throw new Error('Method not implemented.');
1281
- }
1282
- }, {
1283
- key: "rebuildModels",
1284
- value: function rebuildModels() {
1285
- throw new Error('Method not implemented.');
1286
- }
1287
- }, {
1288
- key: "renderMulPass",
1289
- value: function () {
1290
- var _renderMulPass = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(multiPassRenderer) {
1291
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1292
- while (1) {
1293
- switch (_context2.prev = _context2.next) {
1294
- case 0:
1295
- _context2.next = 2;
1296
- return multiPassRenderer.render();
1297
-
1298
- case 2:
1299
- case "end":
1300
- return _context2.stop();
1301
- }
1302
- }
1303
- }, _callee2);
1304
- }));
1305
-
1306
- function renderMulPass(_x) {
1307
- return _renderMulPass.apply(this, arguments);
1308
- }
1309
-
1310
- return renderMulPass;
1311
- }()
1312
- }, {
1313
- key: "renderModels",
1314
- value: function renderModels(isPicking) {
1315
- var _this10 = this;
1316
-
1317
- // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
1318
- if (this.encodeDataLength <= 0 && !this.forceRender) return this;
1319
-
1320
- if (this.layerModelNeedUpdate && this.layerModel) {
1321
- this.layerModel.buildModels(function (models) {
1322
- _this10.models = models;
1323
-
1324
- _this10.hooks.beforeRender.call();
1325
-
1326
- _this10.layerModelNeedUpdate = false;
1327
- });
1328
- }
1329
-
1330
- this.models.forEach(function (model) {
1331
- model.draw({
1332
- uniforms: _this10.layerModel.getUninforms()
1333
- }, isPicking);
1334
- });
1335
- return this;
1336
- }
1337
- }, {
1338
- key: "updateStyleAttribute",
1339
- value: function updateStyleAttribute(type, field, values, updateOptions) {
1340
- if (!this.inited) {
1341
- this.pendingStyleAttributes.push({
1342
- attributeName: type,
1343
- attributeField: field,
1344
- attributeValues: values,
1345
- updateOptions: updateOptions
1346
- });
1347
- } else {
1348
- this.styleAttributeService.updateStyleAttribute(type, {
1349
- // @ts-ignore
1350
- scale: _objectSpread({
1351
- field: field
1352
- }, this.splitValuesAndCallbackInAttribute( // @ts-ignore
1353
- values, // @ts-ignore
1354
- this.getLayerConfig()[field]))
1355
- }, // @ts-ignore
1356
- updateOptions);
1357
- }
1358
- }
1359
- }, {
1360
- key: "getShaderPickStat",
1361
- value: function getShaderPickStat() {
1362
- return this.layerService.getShaderPickStat();
1363
- }
1364
- /**
1365
- * 继承空方法
1366
- * @param time
1367
- */
1368
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1369
-
1370
- }, {
1371
- key: "setEarthTime",
1372
- value: function setEarthTime(time) {
1373
- console.warn('empty fn');
1374
- }
1375
- }, {
1376
- key: "getConfigSchema",
1377
- value: function getConfigSchema() {
1378
- throw new Error('Method not implemented.');
1379
- }
1380
- }, {
1381
- key: "getModelType",
1382
- value: function getModelType() {
1383
- throw new Error('Method not implemented.');
1384
- }
1385
- }, {
1386
- key: "getDefaultConfig",
1387
- value: function getDefaultConfig() {
1388
- return {};
1389
- }
1390
- }, {
1391
- key: "dispatchModelLoad",
1392
- value: function dispatchModelLoad(models) {
1393
- var _this11 = this;
1394
-
1395
- this.models.forEach(function (model) {
1396
- return model.destroy();
1397
- });
1398
- this.models = [];
1399
- this.models = models;
1400
- this.emit('modelLoaded', null);
1401
- this.modelLoaded = true; // Tip: setTimeout 用于延迟绘制,可以让拖动图层时连续的 setData 更加平滑 - L7Draw
1402
-
1403
- setTimeout(function () {
1404
- // Tip: 使用 renderLayers 而不是 throttleRenderLayers,让图层之间的 setData 更新绘制不存在延迟
1405
- _this11.layerService.renderLayers();
1406
- }, 32);
1407
- }
1408
- }, {
1409
- key: "reRender",
1410
- value: function reRender() {
1411
- this.inited && this.layerService.reRender();
1412
- }
1413
- }, {
1414
- key: "splitValuesAndCallbackInAttribute",
1415
- value: function splitValuesAndCallbackInAttribute(valuesOrCallback, defaultValues) {
1416
- return {
1417
- values: isFunction(valuesOrCallback) ? undefined : valuesOrCallback || defaultValues,
1418
- callback: isFunction(valuesOrCallback) ? valuesOrCallback : undefined
1419
- };
1420
- }
1421
- }]);
1422
-
1423
- return BaseLayer;
1424
- }(EventEmitter), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "configService", [_dec], {
1425
- configurable: true,
1426
- enumerable: true,
1427
- writable: true,
1428
- initializer: null
1429
- })), _class));
1430
- export { BaseLayer as default };