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

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