@antv/l7-layers 2.9.27-alpha.2 → 2.9.27-alpha.4

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 (342) hide show
  1. package/es/Geometry/index.js +6 -2
  2. package/es/Geometry/models/billboard.js +3 -7
  3. package/es/Geometry/models/plane.js +5 -7
  4. package/es/Geometry/models/sprite.js +4 -7
  5. package/es/canvas/index.d.ts +4 -0
  6. package/es/canvas/index.js +38 -2
  7. package/es/citybuliding/building.js +6 -2
  8. package/es/citybuliding/models/build.js +2 -3
  9. package/es/core/BaseLayer.d.ts +20 -12
  10. package/es/core/BaseLayer.js +61 -85
  11. package/es/core/BaseModel.d.ts +2 -2
  12. package/es/core/BaseModel.js +22 -19
  13. package/es/core/interface.d.ts +20 -1
  14. package/es/core/triangulation.d.ts +6 -0
  15. package/es/core/triangulation.js +64 -2
  16. package/es/earth/index.js +3 -1
  17. package/es/earth/models/atmosphere.js +4 -7
  18. package/es/earth/models/base.js +12 -18
  19. package/es/earth/models/bloomsphere.js +4 -8
  20. package/es/earth/shaders/atmosphere_frag.glsl +1 -1
  21. package/es/earth/shaders/bloomsphere_frag.glsl +1 -1
  22. package/es/heatmap/index.d.ts +2 -2
  23. package/es/heatmap/index.js +7 -5
  24. package/es/heatmap/models/grid.js +1 -3
  25. package/es/heatmap/models/grid3d.js +4 -11
  26. package/es/heatmap/models/heatmap.js +8 -9
  27. package/es/heatmap/models/hexagon.js +2 -6
  28. package/es/heatmap/triangulation.js +0 -1
  29. package/es/image/index.d.ts +1 -1
  30. package/es/image/index.js +10 -3
  31. package/es/image/models/dataImage.d.ts +1 -1
  32. package/es/image/models/dataImage.js +14 -39
  33. package/es/image/models/image.js +5 -10
  34. package/es/image/models/index.d.ts +1 -1
  35. package/es/image/models/index.js +3 -1
  36. package/es/image/models/tileDataImage.d.ts +19 -0
  37. package/es/image/models/tileDataImage.js +174 -0
  38. package/es/line/index.d.ts +1 -0
  39. package/es/line/index.js +8 -2
  40. package/es/line/models/arc.js +10 -10
  41. package/es/line/models/arc_3d.js +8 -10
  42. package/es/line/models/earthArc_3d.js +8 -10
  43. package/es/line/models/great_circle.js +7 -7
  44. package/es/line/models/half.js +3 -4
  45. package/es/line/models/line.js +10 -9
  46. package/es/line/models/linearline.js +3 -4
  47. package/es/line/models/simpleLine.js +5 -4
  48. package/es/line/models/simpleTileLine.d.ts +9 -0
  49. package/es/line/models/simpleTileLine.js +100 -0
  50. package/es/line/models/tile.d.ts +1 -4
  51. package/es/line/models/tile.js +50 -223
  52. package/es/line/models/wall.js +11 -47
  53. package/es/line/shaders/dash/arc_dash_vert.glsl +2 -0
  54. package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
  55. package/es/line/shaders/line_arc2d_vert.glsl +2 -2
  56. package/es/line/shaders/line_arc_3d_frag.glsl +10 -10
  57. package/es/line/shaders/line_arc_3d_vert.glsl +5 -6
  58. package/es/line/shaders/line_arc_frag.glsl +9 -10
  59. package/es/line/shaders/line_arc_great_circle_frag.glsl +6 -6
  60. package/es/line/shaders/line_arc_great_circle_vert.glsl +2 -3
  61. package/es/line/shaders/line_arc_vert.glsl +6 -4
  62. package/es/line/shaders/line_bezier_vert.glsl +2 -2
  63. package/es/line/shaders/line_frag.glsl +5 -6
  64. package/es/line/shaders/line_vert.glsl +1 -1
  65. package/es/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
  66. package/es/line/shaders/linear/arc3d_linear_vert.glsl +11 -12
  67. package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
  68. package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  69. package/es/line/shaders/tile/line_tile_vert.glsl +19 -177
  70. package/es/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  71. package/es/line/shaders/tile/simpleline_vert.glsl +21 -0
  72. package/es/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +21 -25
  73. package/es/line/shaders/wall/wall_vert.glsl +77 -0
  74. package/es/mask/index.d.ts +1 -0
  75. package/es/mask/index.js +80 -5
  76. package/es/mask/models/fill.d.ts +2 -1
  77. package/es/mask/models/fill.js +13 -10
  78. package/es/mask/shaders/mask_vert.glsl +0 -6
  79. package/es/plugins/DataMappingPlugin.d.ts +4 -3
  80. package/es/plugins/DataMappingPlugin.js +129 -58
  81. package/es/plugins/DataSourcePlugin.js +3 -2
  82. package/es/plugins/FeatureScalePlugin.d.ts +0 -2
  83. package/es/plugins/FeatureScalePlugin.js +8 -51
  84. package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -2
  85. package/es/plugins/LayerAnimateStylePlugin.js +7 -27
  86. package/es/plugins/LayerModelPlugin.js +2 -6
  87. package/es/plugins/LightingPlugin.js +1 -7
  88. package/es/plugins/MultiPassRendererPlugin.d.ts +0 -1
  89. package/es/plugins/MultiPassRendererPlugin.js +4 -16
  90. package/es/plugins/PixelPickingPlugin.d.ts +1 -1
  91. package/es/plugins/PixelPickingPlugin.js +8 -28
  92. package/es/plugins/RegisterStyleAttributePlugin.d.ts +4 -0
  93. package/es/plugins/RegisterStyleAttributePlugin.js +56 -5
  94. package/es/plugins/UpdateStyleAttributePlugin.js +2 -9
  95. package/es/point/index.js +9 -6
  96. package/es/point/models/earthExtrude.d.ts +1 -1
  97. package/es/point/models/earthExtrude.js +9 -14
  98. package/es/point/models/earthFill.js +2 -2
  99. package/es/point/models/extrude.d.ts +1 -1
  100. package/es/point/models/extrude.js +9 -12
  101. package/es/point/models/fill.d.ts +1 -1
  102. package/es/point/models/fill.js +8 -9
  103. package/es/point/models/fillmage.js +5 -6
  104. package/es/point/models/image.js +3 -3
  105. package/es/point/models/index.d.ts +1 -1
  106. package/es/point/models/index.js +3 -3
  107. package/es/point/models/normal.d.ts +0 -1
  108. package/es/point/models/normal.js +9 -62
  109. package/es/point/models/radar.js +5 -70
  110. package/es/point/models/simplePoint.d.ts +0 -1
  111. package/es/point/models/simplePoint.js +2 -11
  112. package/es/point/models/text.js +7 -10
  113. package/es/point/models/tile.d.ts +0 -7
  114. package/es/point/models/tile.js +24 -158
  115. package/es/point/models/tileText.d.ts +0 -4
  116. package/es/point/models/tileText.js +99 -188
  117. package/es/point/shaders/animate/wave_frag.glsl +4 -4
  118. package/es/point/shaders/earth/fill_vert.glsl +0 -1
  119. package/es/point/shaders/fill_vert.glsl +0 -1
  120. package/es/point/shaders/normal_frag.glsl +1 -10
  121. package/es/point/shaders/normal_vert.glsl +5 -60
  122. package/es/point/shaders/radar/radar_frag.glsl +4 -15
  123. package/es/point/shaders/radar/radar_vert.glsl +4 -54
  124. package/es/point/shaders/tile/fill_tile_frag.glsl +10 -17
  125. package/es/point/shaders/tile/fill_tile_vert.glsl +20 -123
  126. package/es/point/shaders/tile/text_frag.glsl +33 -0
  127. package/es/point/shaders/tile/text_map_frag.glsl +31 -0
  128. package/es/point/shaders/tile/text_map_vert.glsl +38 -0
  129. package/es/point/shaders/tile/text_vert.glsl +48 -0
  130. package/es/polygon/index.js +6 -2
  131. package/es/polygon/models/extrude.js +4 -8
  132. package/es/polygon/models/fill.js +3 -4
  133. package/es/polygon/models/ocean.d.ts +0 -2
  134. package/es/polygon/models/ocean.js +13 -47
  135. package/es/polygon/models/tile.d.ts +1 -4
  136. package/es/polygon/models/tile.js +25 -57
  137. package/es/polygon/models/water.d.ts +0 -2
  138. package/es/polygon/models/water.js +13 -47
  139. package/es/polygon/shaders/polygon_frag.glsl +2 -2
  140. package/es/polygon/shaders/polygon_vert.glsl +2 -2
  141. package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  142. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  143. package/es/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  144. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  145. package/es/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  146. package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  147. package/es/raster/buffers/triangulation.js +1 -4
  148. package/es/raster/index.js +6 -2
  149. package/es/raster/models/raster.d.ts +1 -1
  150. package/es/raster/models/raster.js +6 -5
  151. package/es/shader/minify_frag.glsl +7 -0
  152. package/es/shader/minify_picking_frag.glsl +10 -0
  153. package/es/tile/manager/baseMapTileLayerManager.d.ts +29 -0
  154. package/es/tile/manager/baseMapTileLayerManager.js +207 -0
  155. package/es/tile/manager/tileLayerManager.d.ts +2 -2
  156. package/es/tile/manager/tileLayerManager.js +12 -2
  157. package/es/tile/manager/tilePickerManager.d.ts +2 -3
  158. package/es/tile/manager/tilePickerManager.js +1 -2
  159. package/es/tile/models/tileModel.d.ts +1 -0
  160. package/es/tile/models/tileModel.js +18 -2
  161. package/es/tile/tileFactory/base.d.ts +1 -1
  162. package/es/tile/tileFactory/base.js +58 -33
  163. package/es/tile/tileFactory/line.js +3 -0
  164. package/es/tile/tileFactory/point.js +3 -0
  165. package/es/tile/tileFactory/polygon.js +3 -0
  166. package/es/tile/tileFactory/raster.js +3 -0
  167. package/es/tile/tileFactory/rasterData.js +3 -0
  168. package/es/tile/tileFactory/rasterDataLayer.js +6 -2
  169. package/es/tile/tileFactory/test.js +26 -5
  170. package/es/tile/tileFactory/vectorLayer.d.ts +4 -1
  171. package/es/tile/tileFactory/vectorLayer.js +110 -7
  172. package/es/tile/tileLayer/baseMapTileLayer.d.ts +29 -0
  173. package/es/tile/tileLayer/baseMapTileLayer.js +188 -0
  174. package/es/tile/tileLayer/baseTileLayer.d.ts +4 -4
  175. package/es/tile/tileLayer/baseTileLayer.js +46 -75
  176. package/es/tile/tileTest.d.ts +1 -0
  177. package/es/tile/tileTest.js +3 -2
  178. package/es/tile/tmsMapTileLayer.d.ts +9 -0
  179. package/es/tile/tmsMapTileLayer.js +119 -0
  180. package/es/tile/tmsTileLayer.d.ts +2 -0
  181. package/es/tile/tmsTileLayer.js +24 -2
  182. package/es/tile/utils.d.ts +4 -0
  183. package/es/tile/utils.js +30 -0
  184. package/es/utils/dataMappingStyle.js +3 -0
  185. package/es/utils/layerData.js +2 -2
  186. package/es/utils/updateShape.js +2 -2
  187. package/es/wind/index.js +6 -2
  188. package/es/wind/models/wind.js +8 -8
  189. package/es/wind/shaders/wind_vert.glsl +1 -1
  190. package/lib/Geometry/index.js +6 -2
  191. package/lib/Geometry/models/billboard.js +3 -7
  192. package/lib/Geometry/models/plane.js +5 -7
  193. package/lib/Geometry/models/sprite.js +4 -7
  194. package/lib/canvas/index.js +37 -2
  195. package/lib/citybuliding/building.js +6 -2
  196. package/lib/citybuliding/models/build.js +2 -3
  197. package/lib/core/BaseLayer.js +61 -85
  198. package/lib/core/BaseModel.js +22 -19
  199. package/lib/core/triangulation.js +66 -2
  200. package/lib/earth/index.js +3 -1
  201. package/lib/earth/models/atmosphere.js +4 -7
  202. package/lib/earth/models/base.js +12 -18
  203. package/lib/earth/models/bloomsphere.js +4 -8
  204. package/lib/earth/shaders/atmosphere_frag.glsl +1 -1
  205. package/lib/earth/shaders/bloomsphere_frag.glsl +1 -1
  206. package/lib/heatmap/index.js +7 -5
  207. package/lib/heatmap/models/grid.js +1 -3
  208. package/lib/heatmap/models/grid3d.js +4 -11
  209. package/lib/heatmap/models/heatmap.js +8 -9
  210. package/lib/heatmap/models/hexagon.js +2 -6
  211. package/lib/heatmap/triangulation.js +0 -1
  212. package/lib/image/index.js +10 -3
  213. package/lib/image/models/dataImage.js +13 -38
  214. package/lib/image/models/image.js +5 -10
  215. package/lib/image/models/index.js +4 -1
  216. package/lib/image/models/tileDataImage.js +188 -0
  217. package/lib/line/index.js +7 -2
  218. package/lib/line/models/arc.js +10 -10
  219. package/lib/line/models/arc_3d.js +8 -10
  220. package/lib/line/models/earthArc_3d.js +8 -10
  221. package/lib/line/models/great_circle.js +7 -7
  222. package/lib/line/models/half.js +3 -4
  223. package/lib/line/models/line.js +10 -9
  224. package/lib/line/models/linearline.js +3 -4
  225. package/lib/line/models/simpleLine.js +5 -4
  226. package/lib/line/models/simpleTileLine.js +115 -0
  227. package/lib/line/models/tile.js +50 -224
  228. package/lib/line/models/wall.js +11 -47
  229. package/lib/line/shaders/dash/arc_dash_vert.glsl +2 -0
  230. package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
  231. package/lib/line/shaders/line_arc2d_vert.glsl +2 -2
  232. package/lib/line/shaders/line_arc_3d_frag.glsl +10 -10
  233. package/lib/line/shaders/line_arc_3d_vert.glsl +5 -6
  234. package/lib/line/shaders/line_arc_frag.glsl +9 -10
  235. package/lib/line/shaders/line_arc_great_circle_frag.glsl +6 -6
  236. package/lib/line/shaders/line_arc_great_circle_vert.glsl +2 -3
  237. package/lib/line/shaders/line_arc_vert.glsl +6 -4
  238. package/lib/line/shaders/line_bezier_vert.glsl +2 -2
  239. package/lib/line/shaders/line_frag.glsl +5 -6
  240. package/lib/line/shaders/line_vert.glsl +1 -1
  241. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
  242. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +11 -12
  243. package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
  244. package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  245. package/lib/line/shaders/tile/line_tile_vert.glsl +19 -177
  246. package/lib/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  247. package/lib/line/shaders/tile/simpleline_vert.glsl +21 -0
  248. package/lib/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +21 -25
  249. package/lib/line/shaders/wall/wall_vert.glsl +77 -0
  250. package/lib/mask/index.js +82 -5
  251. package/lib/mask/models/fill.js +14 -10
  252. package/lib/mask/shaders/mask_vert.glsl +0 -6
  253. package/lib/plugins/DataMappingPlugin.js +127 -57
  254. package/lib/plugins/DataSourcePlugin.js +3 -2
  255. package/lib/plugins/FeatureScalePlugin.js +6 -50
  256. package/lib/plugins/LayerAnimateStylePlugin.js +6 -29
  257. package/lib/plugins/LayerModelPlugin.js +2 -6
  258. package/lib/plugins/LightingPlugin.js +1 -7
  259. package/lib/plugins/MultiPassRendererPlugin.js +3 -19
  260. package/lib/plugins/PixelPickingPlugin.js +8 -28
  261. package/lib/plugins/RegisterStyleAttributePlugin.js +56 -5
  262. package/lib/plugins/UpdateStyleAttributePlugin.js +2 -9
  263. package/lib/point/index.js +9 -6
  264. package/lib/point/models/earthExtrude.js +9 -14
  265. package/lib/point/models/earthFill.js +2 -2
  266. package/lib/point/models/extrude.js +9 -12
  267. package/lib/point/models/fill.js +8 -9
  268. package/lib/point/models/fillmage.js +5 -6
  269. package/lib/point/models/image.js +3 -3
  270. package/lib/point/models/index.js +1 -1
  271. package/lib/point/models/normal.js +8 -61
  272. package/lib/point/models/radar.js +5 -70
  273. package/lib/point/models/simplePoint.js +1 -10
  274. package/lib/point/models/text.js +7 -10
  275. package/lib/point/models/tile.js +23 -159
  276. package/lib/point/models/tileText.js +98 -187
  277. package/lib/point/shaders/animate/wave_frag.glsl +4 -4
  278. package/lib/point/shaders/earth/fill_vert.glsl +0 -1
  279. package/lib/point/shaders/fill_vert.glsl +0 -1
  280. package/lib/point/shaders/normal_frag.glsl +1 -10
  281. package/lib/point/shaders/normal_vert.glsl +5 -60
  282. package/lib/point/shaders/radar/radar_frag.glsl +4 -15
  283. package/lib/point/shaders/radar/radar_vert.glsl +4 -54
  284. package/lib/point/shaders/tile/fill_tile_frag.glsl +10 -17
  285. package/lib/point/shaders/tile/fill_tile_vert.glsl +20 -123
  286. package/lib/point/shaders/tile/text_frag.glsl +33 -0
  287. package/lib/point/shaders/tile/text_map_frag.glsl +31 -0
  288. package/lib/point/shaders/tile/text_map_vert.glsl +38 -0
  289. package/lib/point/shaders/tile/text_vert.glsl +48 -0
  290. package/lib/polygon/index.js +6 -2
  291. package/lib/polygon/models/extrude.js +4 -8
  292. package/lib/polygon/models/fill.js +3 -4
  293. package/lib/polygon/models/ocean.js +14 -47
  294. package/lib/polygon/models/tile.js +24 -57
  295. package/lib/polygon/models/water.js +14 -47
  296. package/lib/polygon/shaders/polygon_frag.glsl +2 -2
  297. package/lib/polygon/shaders/polygon_vert.glsl +2 -2
  298. package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  299. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  300. package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  301. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  302. package/lib/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  303. package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  304. package/lib/raster/buffers/triangulation.js +1 -4
  305. package/lib/raster/index.js +6 -2
  306. package/lib/raster/models/raster.js +6 -5
  307. package/lib/shader/minify_frag.glsl +7 -0
  308. package/lib/shader/minify_picking_frag.glsl +10 -0
  309. package/lib/tile/manager/baseMapTileLayerManager.js +222 -0
  310. package/lib/tile/manager/tileLayerManager.js +12 -2
  311. package/lib/tile/manager/tilePickerManager.js +1 -2
  312. package/lib/tile/models/tileModel.js +19 -2
  313. package/lib/tile/tileFactory/base.js +60 -33
  314. package/lib/tile/tileFactory/line.js +3 -0
  315. package/lib/tile/tileFactory/point.js +3 -0
  316. package/lib/tile/tileFactory/polygon.js +3 -0
  317. package/lib/tile/tileFactory/raster.js +3 -0
  318. package/lib/tile/tileFactory/rasterData.js +3 -0
  319. package/lib/tile/tileFactory/rasterDataLayer.js +6 -2
  320. package/lib/tile/tileFactory/test.js +26 -5
  321. package/lib/tile/tileFactory/vectorLayer.js +112 -8
  322. package/lib/tile/tileLayer/baseMapTileLayer.js +195 -0
  323. package/lib/tile/tileLayer/baseTileLayer.js +46 -75
  324. package/lib/tile/tileTest.js +3 -2
  325. package/lib/tile/tmsMapTileLayer.js +136 -0
  326. package/lib/tile/tmsTileLayer.js +25 -2
  327. package/lib/tile/utils.js +38 -0
  328. package/lib/utils/dataMappingStyle.js +3 -0
  329. package/lib/utils/layerData.js +2 -2
  330. package/lib/utils/updateShape.js +2 -2
  331. package/lib/wind/index.js +6 -2
  332. package/lib/wind/models/wind.js +7 -7
  333. package/lib/wind/shaders/wind_vert.glsl +1 -1
  334. package/package.json +8 -7
  335. package/es/line/shaders/tile/line_tile_frag.glsl +0 -79
  336. package/es/line/shaders/wall_vert.glsl +0 -111
  337. package/es/mask/shaders/mask_frag.glsl +0 -7
  338. package/es/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
  339. package/lib/line/shaders/tile/line_tile_frag.glsl +0 -79
  340. package/lib/line/shaders/wall_vert.glsl +0 -111
  341. package/lib/mask/shaders/mask_frag.glsl +0 -7
  342. package/lib/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
@@ -83,13 +83,13 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
83
83
 
84
84
  // 生命周期钩子
85
85
  // 待渲染 model 列表
86
- // TODO: 用于保存子图层对象
86
+ // 用于保存子图层对象
87
87
  // Tip: 用于标识矢量图层
88
88
 
89
89
  /**
90
90
  * 待更新样式属性,在初始化阶段完成注册
91
91
  */
92
- // TODO: layer 保底颜色
92
+ // Tip: layer 保底颜色
93
93
  // private pickingPassRender: IPass<'pixelPicking'>;
94
94
  function BaseLayer() {
95
95
  var _this;
@@ -149,9 +149,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
149
149
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "currentPickId", null);
150
150
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "pendingStyleAttributes", []);
151
151
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "scaleOptions", {});
152
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "aniamateStatus", false);
152
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "animateStatus", false);
153
153
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "bottomColor", 'rgba(0, 0, 0, 0)');
154
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isDestroied", false);
154
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isDestroyed", false);
155
155
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "encodeDataLength", 0);
156
156
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sourceEvent", function () {
157
157
  _this.dataState.dataSourceNeedUpdate = true;
@@ -160,9 +160,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
160
160
 
161
161
  if (layerConfig && layerConfig.autoFit) {
162
162
  _this.fitBounds(layerConfig.fitBoundsOptions);
163
- } // 对外暴露事件 迁移到 DataMappingPlugin generateMapping,保证在重新重新映射后触发
164
- // this.emit('dataUpdate');
165
-
163
+ }
166
164
 
167
165
  _this.reRender();
168
166
  });
@@ -253,11 +251,6 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
253
251
  }, {
254
252
  key: "addPlugin",
255
253
  value: function addPlugin(plugin) {
256
- // TODO: 控制插件注册顺序
257
- // @example:
258
- // pointLayer.addPlugin(new MyCustomPlugin(), {
259
- // before: 'L7BuiltinPlugin'
260
- // });
261
254
  this.plugins.push(plugin);
262
255
  return this;
263
256
  }
@@ -420,21 +413,13 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
420
413
 
421
414
  if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
422
415
  this.layerService.startAnimate();
423
- this.aniamateStatus = true;
416
+ this.animateStatus = true;
424
417
  }
425
418
  }
426
419
  }, {
427
420
  key: "color",
428
421
  value: function color(field, values, updateOptions) {
429
- // 设置 color、size、shape、style 时由于场景服务尚未完成(并没有调用 scene.addLayer),因此暂时加入待更新属性列表
430
- this.updateStyleAttribute('color', field, values, updateOptions); // this.pendingStyleAttributes.push({
431
- // attributeName: 'color',
432
- // attributeField: field,
433
- // attributeValues: values,
434
- // defaultName: 'colors',
435
- // updateOptions,
436
- // });
437
-
422
+ this.updateStyleAttribute('color', field, values, updateOptions);
438
423
  return this;
439
424
  } // 为对应的图层传入纹理的编号名称(point/image 在 shape 方法中传入纹理名称的方法并不通用)
440
425
 
@@ -474,7 +459,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
474
459
  field: field,
475
460
  values: values
476
461
  };
477
- this.updateStyleAttribute('shape', field, values, updateOptions); // TODO: 根据 shape 判断是否需要更新 model
462
+ this.updateStyleAttribute('shape', field, values, updateOptions); // Tip: 根据 shape 判断是否需要更新 model
478
463
 
479
464
  if (!this.tileLayer) {
480
465
  (0, _updateShape.updateShape)(this, lastShape, currentShape);
@@ -507,8 +492,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
507
492
 
508
493
  this.updateLayerConfig({
509
494
  animateOption: rawAnimate
510
- }); // this.animateOptions = options;
511
-
495
+ });
512
496
  return this;
513
497
  }
514
498
  }, {
@@ -613,7 +597,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
613
597
  }, {
614
598
  key: "render",
615
599
  value: function render() {
616
- if (this.tileLayer !== undefined) {
600
+ if (this.tileLayer) {
617
601
  // 瓦片图层执行单独的 render 渲染队列
618
602
  this.tileLayer.render();
619
603
  return this;
@@ -810,11 +794,6 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
810
794
  }, {
811
795
  key: "hide",
812
796
  value: function hide() {
813
- if (this.type === 'CanvasLayer' && this.layerModel.clearCanvas) {
814
- // 对 canvasLayer 的 hide 操作做特殊处理
815
- this.layerModel.clearCanvas();
816
- }
817
-
818
797
  this.updateLayerConfig({
819
798
  visible: false
820
799
  });
@@ -970,35 +949,34 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
970
949
  }, {
971
950
  key: "destroy",
972
951
  value: function destroy() {
973
- var _this$layerModel2;
952
+ var _this$multiPassRender, _this$layerModel2;
974
953
 
975
954
  var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
976
955
 
977
- if (this.isDestroied) {
956
+ if (this.isDestroyed) {
978
957
  return;
979
958
  } // remove child layer
980
959
 
981
960
 
982
961
  this.layerChildren.map(function (child) {
983
- return child.destroy();
962
+ return child.destroy(false);
984
963
  });
985
964
  this.layerChildren = []; // remove mask list
986
965
 
987
966
  this.masks.map(function (mask) {
988
- return mask.destroy();
967
+ return mask.destroy(false);
989
968
  });
990
969
  this.masks = [];
991
970
  this.hooks.beforeDestroy.call(); // 清除sources事件
992
971
 
993
972
  this.layerSource.off('sourceUpdate', this.sourceEvent);
994
- this.multiPassRenderer.destroy(); // console.log(this.styleAttributeService.getAttributes())
995
- // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());
973
+ (_this$multiPassRender = this.multiPassRenderer) === null || _this$multiPassRender === void 0 ? void 0 : _this$multiPassRender.destroy(); // 清除所有属性以及关联的 vao == 销毁所有 => model this.models.forEach((model) => model.destroy());
996
974
 
997
975
  this.styleAttributeService.clearAllAttributes(); // 执行每个图层单独的 clearModels 方法 (清除一些额外的 texture、program、buffer 等)
998
976
 
999
- this.hooks.afterDestroy.call(); // TODO: 清除各个图层自定义的 models 资源
977
+ this.hooks.afterDestroy.call(); // Tip: 清除各个图层自定义的 models 资源
1000
978
 
1001
- (_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels();
979
+ (_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels(refresh);
1002
980
  this.models = [];
1003
981
  this.layerService.cleanRemove(this, refresh);
1004
982
  this.emit('remove', {
@@ -1012,7 +990,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1012
990
  this.removeAllListeners(); // 解绑图层容器中的服务
1013
991
  // this.container.unbind(TYPES.IStyleAttributeService);
1014
992
 
1015
- this.isDestroied = true;
993
+ this.isDestroyed = true;
1016
994
  }
1017
995
  }, {
1018
996
  key: "clear",
@@ -1173,50 +1151,52 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1173
1151
 
1174
1152
  var createModel = this.rendererService.createModel;
1175
1153
  return new Promise(function (resolve, reject) {
1176
- // filter supported worker & worker enabled layer
1177
- if (workerOptions && workerOptions.modelType in _l7Utils.WorkerSourceMap && workerEnabled) {
1178
- _this9.styleAttributeService.createAttributesAndIndicesAscy(_this9.encodedData, segmentNumber, workerOptions).then(function (_ref7) {
1179
- var attributes = _ref7.attributes,
1180
- elements = _ref7.elements;
1181
- var m = createModel((0, _objectSpread2.default)({
1154
+ setTimeout(function () {
1155
+ // filter supported worker & worker enabled layer
1156
+ if (workerOptions && workerOptions.modelType in _l7Utils.WorkerSourceMap && workerEnabled) {
1157
+ _this9.styleAttributeService.createAttributesAndIndicesAscy(_this9.encodedData, segmentNumber, workerOptions).then(function (_ref7) {
1158
+ var attributes = _ref7.attributes,
1159
+ elements = _ref7.elements;
1160
+ var m = createModel((0, _objectSpread2.default)({
1161
+ attributes: attributes,
1162
+ uniforms: uniforms,
1163
+ fs: fs,
1164
+ vs: vs,
1165
+ elements: elements,
1166
+ blend: _blend.BlendTypes[_l7Core.BlendType.normal]
1167
+ }, rest));
1168
+ resolve(m);
1169
+ }).catch(function (err) {
1170
+ return reject(err);
1171
+ });
1172
+ } else {
1173
+ var _this9$styleAttribute = _this9.styleAttributeService.createAttributesAndIndices(_this9.encodedData, triangulation, segmentNumber),
1174
+ attributes = _this9$styleAttribute.attributes,
1175
+ elements = _this9$styleAttribute.elements,
1176
+ count = _this9$styleAttribute.count;
1177
+
1178
+ var modelOptions = (0, _objectSpread2.default)({
1182
1179
  attributes: attributes,
1183
1180
  uniforms: uniforms,
1184
1181
  fs: fs,
1185
1182
  vs: vs,
1186
1183
  elements: elements,
1187
1184
  blend: _blend.BlendTypes[_l7Core.BlendType.normal]
1188
- }, rest));
1185
+ }, rest);
1186
+
1187
+ if (count) {
1188
+ modelOptions.count = count;
1189
+ }
1190
+
1191
+ var m = createModel(modelOptions);
1189
1192
  resolve(m);
1190
- }).catch(function (err) {
1191
- return reject(err);
1192
- });
1193
- } else {
1194
- var _this9$styleAttribute = _this9.styleAttributeService.createAttributesAndIndices(_this9.encodedData, triangulation, segmentNumber),
1195
- attributes = _this9$styleAttribute.attributes,
1196
- elements = _this9$styleAttribute.elements,
1197
- count = _this9$styleAttribute.count;
1198
-
1199
- var modeloptions = (0, _objectSpread2.default)({
1200
- attributes: attributes,
1201
- uniforms: uniforms,
1202
- fs: fs,
1203
- vs: vs,
1204
- elements: elements,
1205
- blend: _blend.BlendTypes[_l7Core.BlendType.normal]
1206
- }, rest);
1207
-
1208
- if (count) {
1209
- modeloptions.count = count;
1210
1193
  }
1211
-
1212
- var m = createModel(modeloptions);
1213
- resolve(m);
1214
- }
1194
+ });
1215
1195
  });
1216
1196
  }
1217
1197
  }, {
1218
- key: "createAttrubutes",
1219
- value: function createAttrubutes(options) {
1198
+ key: "createAttributes",
1199
+ value: function createAttributes(options) {
1220
1200
  var triangulation = options.triangulation; // @ts-ignore
1221
1201
 
1222
1202
  var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
@@ -1237,9 +1217,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1237
1217
  }, {
1238
1218
  key: "stopAnimate",
1239
1219
  value: function stopAnimate() {
1240
- if (this.aniamateStatus) {
1220
+ if (this.animateStatus) {
1241
1221
  this.layerService.stopAnimate();
1242
- this.aniamateStatus = false;
1222
+ this.animateStatus = false;
1243
1223
  this.updateLayerConfig({
1244
1224
  animateOption: {
1245
1225
  enable: false
@@ -1255,6 +1235,9 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1255
1235
  }, {
1256
1236
  key: "needPick",
1257
1237
  value: function needPick(type) {
1238
+ // 地图图层的判断
1239
+ if (this.rawConfig.usage === 'basemap') return false;
1240
+
1258
1241
  var _this$getLayerConfig10 = this.getLayerConfig(),
1259
1242
  _this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
1260
1243
  enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
@@ -1312,8 +1295,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1312
1295
  }, {
1313
1296
  key: "renderModels",
1314
1297
  value: function renderModels(isPicking) {
1315
- var _this10 = this,
1316
- _this$layerModel4;
1298
+ var _this10 = this;
1317
1299
 
1318
1300
  // TODO: this.getEncodedData().length > 0 这个判断是为了解决在 2.5.x 引入数据纹理后产生的 空数据渲染导致 texture 超出上限问题
1319
1301
  if (this.encodeDataLength <= 0 && !this.forceRender) return this;
@@ -1328,10 +1310,6 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1328
1310
  });
1329
1311
  }
1330
1312
 
1331
- if (this !== null && this !== void 0 && (_this$layerModel4 = this.layerModel) !== null && _this$layerModel4 !== void 0 && _this$layerModel4.renderUpdate) {
1332
- this.layerModel.renderUpdate();
1333
- }
1334
-
1335
1313
  this.models.forEach(function (model) {
1336
1314
  model.draw({
1337
1315
  uniforms: _this10.layerModel.getUninforms()
@@ -1370,6 +1348,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1370
1348
  * 继承空方法
1371
1349
  * @param time
1372
1350
  */
1351
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1373
1352
 
1374
1353
  }, {
1375
1354
  key: "setEarthTime",
@@ -1394,10 +1373,7 @@ var BaseLayer = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
1394
1373
  }, {
1395
1374
  key: "reRender",
1396
1375
  value: function reRender() {
1397
- if (this.inited) {
1398
- this.layerService.updateLayerRenderList();
1399
- this.layerService.renderLayers();
1400
- }
1376
+ this.inited && this.layerService.reRender();
1401
1377
  }
1402
1378
  }, {
1403
1379
  key: "splitValuesAndCallbackInAttribute",
@@ -79,7 +79,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
79
79
  stroke: undefined,
80
80
  offsets: undefined
81
81
  };
82
- this.stylePropertyesExist = {
82
+ this.stylePropertiesExist = {
83
83
  hasThetaOffset: 0,
84
84
  hasOpacity: 0,
85
85
  hasStrokeOpacity: 0,
@@ -115,7 +115,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
115
115
 
116
116
  this.cellLength = 0; // 清空上一次计算的 cell 的长度
117
117
 
118
- this.stylePropertyesExist = {
118
+ this.stylePropertiesExist = {
119
119
  // 全量清空上一次是否需要对 style 属性进行数据映射的判断
120
120
  hasThetaOffset: 0,
121
121
  hasOpacity: 0,
@@ -133,13 +133,13 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
133
133
  this.rowCount, // 数据纹理有几行
134
134
  this.DATA_TEXTURE_WIDTH, // 数据纹理有几列
135
135
  0.0, 0.0, // 1
136
- this.stylePropertyesExist.hasOpacity, // cell 中是否存在 opacity
137
- this.stylePropertyesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
138
- this.stylePropertyesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
139
- this.stylePropertyesExist.hasStroke, // cell 中是否存在 stroke
136
+ this.stylePropertiesExist.hasOpacity, // cell 中是否存在 opacity
137
+ this.stylePropertiesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
138
+ this.stylePropertiesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
139
+ this.stylePropertiesExist.hasStroke, // cell 中是否存在 stroke
140
140
  // 2
141
- this.stylePropertyesExist.hasOffsets, // cell 中是否存在 offsets
142
- this.stylePropertyesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
141
+ this.stylePropertiesExist.hasOffsets, // cell 中是否存在 offsets
142
+ this.stylePropertiesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
143
143
  0.0, 0.0, // 3
144
144
  0.0, 0.0, 0.0, 1.0];
145
145
  } else {
@@ -216,7 +216,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
216
216
  attr: 'opacity',
217
217
  count: 1
218
218
  });
219
- this.stylePropertyesExist.hasOpacity = 1;
219
+ this.stylePropertiesExist.hasOpacity = 1;
220
220
  this.cellLength += 1;
221
221
  }
222
222
 
@@ -226,7 +226,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
226
226
  attr: 'strokeOpacity',
227
227
  count: 1
228
228
  });
229
- this.stylePropertyesExist.hasStrokeOpacity = 1;
229
+ this.stylePropertiesExist.hasStrokeOpacity = 1;
230
230
  this.cellLength += 1;
231
231
  }
232
232
 
@@ -236,7 +236,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
236
236
  attr: 'strokeWidth',
237
237
  count: 1
238
238
  });
239
- this.stylePropertyesExist.hasStrokeWidth = 1;
239
+ this.stylePropertiesExist.hasStrokeWidth = 1;
240
240
  this.cellLength += 1;
241
241
  }
242
242
 
@@ -246,7 +246,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
246
246
  attr: 'stroke',
247
247
  count: 4
248
248
  });
249
- this.stylePropertyesExist.hasStroke = 1;
249
+ this.stylePropertiesExist.hasStroke = 1;
250
250
  this.cellLength += 4;
251
251
  }
252
252
 
@@ -256,7 +256,7 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
256
256
  attr: 'offsets',
257
257
  count: 2
258
258
  });
259
- this.stylePropertyesExist.hasOffsets = 1;
259
+ this.stylePropertiesExist.hasOffsets = 1;
260
260
  this.cellLength += 2;
261
261
  }
262
262
 
@@ -266,10 +266,9 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
266
266
  attr: 'thetaOffset',
267
267
  count: 1
268
268
  });
269
- this.stylePropertyesExist.hasThetaOffset = 1;
269
+ this.stylePropertiesExist.hasThetaOffset = 1;
270
270
  this.cellLength += 1;
271
- } // console.log('this.cellLength', this.cellLength)
272
-
271
+ }
273
272
  }
274
273
  /**
275
274
  * 判断变量 stroke 是否是常量值
@@ -446,20 +445,24 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
446
445
  key: "needUpdate",
447
446
  value: function needUpdate() {
448
447
  return false;
449
- }
448
+ } // eslint-disable-next-line @typescript-eslint/no-unused-vars
449
+
450
450
  }, {
451
451
  key: "buildModels",
452
452
  value: function buildModels(callbackModel) {
453
453
  throw new Error('Method not implemented.');
454
- }
454
+ } // eslint-disable-next-line @typescript-eslint/no-unused-vars
455
+
455
456
  }, {
456
457
  key: "initModels",
457
458
  value: function initModels(callbackModel) {
458
459
  throw new Error('Method not implemented.');
459
- }
460
+ } // eslint-disable-next-line @typescript-eslint/no-unused-vars
461
+
460
462
  }, {
461
463
  key: "clearModels",
462
464
  value: function clearModels() {
465
+ var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
463
466
  return;
464
467
  }
465
468
  }, {
@@ -18,6 +18,7 @@ exports.PointImageTriangulation = PointImageTriangulation;
18
18
  exports.PolygonExtrudeTriangulation = PolygonExtrudeTriangulation;
19
19
  exports.RasterImageTriangulation = RasterImageTriangulation;
20
20
  exports.SimpleLineTriangulation = SimpleLineTriangulation;
21
+ exports.TileSimpleLineTriangulation = TileSimpleLineTriangulation;
21
22
  exports.earthOuterTriangulation = earthOuterTriangulation;
22
23
  exports.earthTriangulation = earthTriangulation;
23
24
  exports.polygonTriangulation = polygonTriangulation;
@@ -177,6 +178,16 @@ function SimpleLineTriangulation(feature) {
177
178
  var coordinates = feature.coordinates;
178
179
  var pos = [];
179
180
 
181
+ if (!Array.isArray(coordinates[0])) {
182
+ return {
183
+ vertices: [],
184
+ indices: [],
185
+ normals: [],
186
+ size: 6,
187
+ count: 0
188
+ };
189
+ }
190
+
180
191
  var _getSimpleLineVertice = getSimpleLineVertices(coordinates),
181
192
  results = _getSimpleLineVertice.results,
182
193
  totalDistance = _getSimpleLineVertice.totalDistance;
@@ -193,6 +204,33 @@ function SimpleLineTriangulation(feature) {
193
204
  };
194
205
  }
195
206
 
207
+ function TileSimpleLineTriangulation(feature) {
208
+ var coordinates = feature.coordinates;
209
+ var pos = [];
210
+
211
+ if (!Array.isArray(coordinates[0])) {
212
+ return {
213
+ vertices: [],
214
+ indices: [],
215
+ size: 4,
216
+ count: 0
217
+ };
218
+ }
219
+
220
+ var _getTileSimpleLineVer = getTileSimpleLineVertices(coordinates),
221
+ results = _getTileSimpleLineVer.results;
222
+
223
+ results.map(function (point) {
224
+ pos.push(point[0], point[1], point[2], point[3]);
225
+ });
226
+ return {
227
+ vertices: pos,
228
+ indices: [],
229
+ size: 4,
230
+ count: results.length
231
+ };
232
+ }
233
+
196
234
  function lineSegmentDistance(b1, a1) {
197
235
  var dx = a1[0] - b1[0];
198
236
  var dy = a1[1] - b1[1];
@@ -204,7 +242,10 @@ function pushDis(point, n) {
204
242
  point.push(0);
205
243
  }
206
244
 
207
- point.push(n);
245
+ if (n !== undefined) {
246
+ point.push(n);
247
+ }
248
+
208
249
  return point;
209
250
  }
210
251
 
@@ -239,6 +280,29 @@ function getSimpleLineVertices(points) {
239
280
  }
240
281
  }
241
282
 
283
+ function getTileSimpleLineVertices(points) {
284
+ if (points.length < 2) {
285
+ return {
286
+ results: points
287
+ };
288
+ } else {
289
+ var results = [];
290
+ var point = pushDis(points[0]);
291
+ results.push(point);
292
+
293
+ for (var i = 1; i < points.length - 1; i++) {
294
+ var mulPoint = pushDis(points[i]);
295
+ results.push(mulPoint);
296
+ results.push(mulPoint);
297
+ }
298
+
299
+ results.push(pushDis(points[points.length - 1]));
300
+ return {
301
+ results: results
302
+ };
303
+ }
304
+ }
305
+
242
306
  function polygonTriangulation(feature) {
243
307
  var coordinates = feature.coordinates;
244
308
 
@@ -252,7 +316,7 @@ function polygonTriangulation(feature) {
252
316
  vertices: vertices,
253
317
  size: dimensions
254
318
  };
255
- } // TODO:构建几何图形(带有中心点和大小)
319
+ } // 构建几何图形(带有中心点和大小)
256
320
 
257
321
 
258
322
  function polygonTriangulationWithCenter(feature) {
@@ -77,7 +77,9 @@ var EarthLayer = /*#__PURE__*/function (_BaseLayer) {
77
77
  this.layerModel.initModels(function (models) {
78
78
  _this2.models = models;
79
79
 
80
- _this2.renderLayers();
80
+ _this2.emit('modelLoaded', null);
81
+
82
+ _this2.layerService.throttleRenderLayers();
81
83
  });
82
84
  }
83
85
  /**
@@ -30,7 +30,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
30
30
  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; } }
31
31
 
32
32
  /* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
33
- var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // TODO: \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
33
+ var atmoSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\n\nvarying vec3 vVertexNormal;\nvarying float v_offset;\nvarying vec4 v_Color;\nvoid main() {\n \n \n // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);\n // \u53BB\u9664\u80CC\u9762\n if(intensity > 1.0) intensity = 0.0;\n\n gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);\n}\n";
34
34
 
35
35
  /* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
36
36
  var atmoSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nvarying float v_CamreaDistance;\n\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\nvarying float v_offset;\n\nvoid main() {\n float EARTH_RADIUS = 100.0;\n \n v_Color = a_Color;\n\n v_offset = min(((length(u_CameraPosition) - EARTH_RADIUS)/600.0) * 0.5 + 0.4, 1.0);\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
@@ -72,7 +72,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
72
72
  // TODO: 调整图层的绘制顺序 地球大气层
73
73
  this.layer.zIndex = -997;
74
74
  this.layer.buildLayerModel({
75
- moduleName: 'earthAtmo',
75
+ moduleName: 'earthAtmoSphere',
76
76
  vertexShader: atmoSphereVert,
77
77
  fragmentShader: atmoSphereFrag,
78
78
  triangulation: _triangulation.earthTriangulation,
@@ -97,13 +97,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
97
97
  descriptor: {
98
98
  name: 'a_Size',
99
99
  buffer: {
100
- // give the WebGL driver a hint that this buffer may change
101
100
  usage: _l7Core.gl.DYNAMIC_DRAW,
102
101
  data: [],
103
102
  type: _l7Core.gl.FLOAT
104
103
  },
105
104
  size: 1,
106
- update: function update(feature, featureIdx, vertex, attributeIdx) {
105
+ update: function update(feature) {
107
106
  var _feature$size = feature.size,
108
107
  size = _feature$size === void 0 ? 1 : _feature$size;
109
108
  return Array.isArray(size) ? [size[0]] : [size];
@@ -116,7 +115,6 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
116
115
  descriptor: {
117
116
  name: 'a_Normal',
118
117
  buffer: {
119
- // give the WebGL driver a hint that this buffer may change
120
118
  usage: _l7Core.gl.STATIC_DRAW,
121
119
  data: [],
122
120
  type: _l7Core.gl.FLOAT
@@ -133,13 +131,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
133
131
  descriptor: {
134
132
  name: 'a_Uv',
135
133
  buffer: {
136
- // give the WebGL driver a hint that this buffer may change
137
134
  usage: _l7Core.gl.DYNAMIC_DRAW,
138
135
  data: [],
139
136
  type: _l7Core.gl.FLOAT
140
137
  },
141
138
  size: 2,
142
- update: function update(feature, featureIdx, vertex, attributeIdx) {
139
+ update: function update(feature, featureIdx, vertex) {
143
140
  return [vertex[3], vertex[4]];
144
141
  }
145
142
  }