@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
@@ -61,7 +61,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
61
61
  stroke: undefined,
62
62
  offsets: undefined
63
63
  };
64
- this.stylePropertyesExist = {
64
+ this.stylePropertiesExist = {
65
65
  hasThetaOffset: 0,
66
66
  hasOpacity: 0,
67
67
  hasStrokeOpacity: 0,
@@ -97,7 +97,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
97
97
 
98
98
  this.cellLength = 0; // 清空上一次计算的 cell 的长度
99
99
 
100
- this.stylePropertyesExist = {
100
+ this.stylePropertiesExist = {
101
101
  // 全量清空上一次是否需要对 style 属性进行数据映射的判断
102
102
  hasThetaOffset: 0,
103
103
  hasOpacity: 0,
@@ -115,13 +115,13 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
115
115
  this.rowCount, // 数据纹理有几行
116
116
  this.DATA_TEXTURE_WIDTH, // 数据纹理有几列
117
117
  0.0, 0.0, // 1
118
- this.stylePropertyesExist.hasOpacity, // cell 中是否存在 opacity
119
- this.stylePropertyesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
120
- this.stylePropertyesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
121
- this.stylePropertyesExist.hasStroke, // cell 中是否存在 stroke
118
+ this.stylePropertiesExist.hasOpacity, // cell 中是否存在 opacity
119
+ this.stylePropertiesExist.hasStrokeOpacity, // cell 中是否存在 strokeOpacity
120
+ this.stylePropertiesExist.hasStrokeWidth, // cell 中是否存在 strokeWidth
121
+ this.stylePropertiesExist.hasStroke, // cell 中是否存在 stroke
122
122
  // 2
123
- this.stylePropertyesExist.hasOffsets, // cell 中是否存在 offsets
124
- this.stylePropertyesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
123
+ this.stylePropertiesExist.hasOffsets, // cell 中是否存在 offsets
124
+ this.stylePropertiesExist.hasThetaOffset, // cell 中是否存在 thetaOffset
125
125
  0.0, 0.0, // 3
126
126
  0.0, 0.0, 0.0, 1.0];
127
127
  } else {
@@ -198,7 +198,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
198
198
  attr: 'opacity',
199
199
  count: 1
200
200
  });
201
- this.stylePropertyesExist.hasOpacity = 1;
201
+ this.stylePropertiesExist.hasOpacity = 1;
202
202
  this.cellLength += 1;
203
203
  }
204
204
 
@@ -208,7 +208,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
208
208
  attr: 'strokeOpacity',
209
209
  count: 1
210
210
  });
211
- this.stylePropertyesExist.hasStrokeOpacity = 1;
211
+ this.stylePropertiesExist.hasStrokeOpacity = 1;
212
212
  this.cellLength += 1;
213
213
  }
214
214
 
@@ -218,7 +218,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
218
218
  attr: 'strokeWidth',
219
219
  count: 1
220
220
  });
221
- this.stylePropertyesExist.hasStrokeWidth = 1;
221
+ this.stylePropertiesExist.hasStrokeWidth = 1;
222
222
  this.cellLength += 1;
223
223
  }
224
224
 
@@ -228,7 +228,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
228
228
  attr: 'stroke',
229
229
  count: 4
230
230
  });
231
- this.stylePropertyesExist.hasStroke = 1;
231
+ this.stylePropertiesExist.hasStroke = 1;
232
232
  this.cellLength += 4;
233
233
  }
234
234
 
@@ -238,7 +238,7 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
238
238
  attr: 'offsets',
239
239
  count: 2
240
240
  });
241
- this.stylePropertyesExist.hasOffsets = 1;
241
+ this.stylePropertiesExist.hasOffsets = 1;
242
242
  this.cellLength += 2;
243
243
  }
244
244
 
@@ -248,10 +248,9 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
248
248
  attr: 'thetaOffset',
249
249
  count: 1
250
250
  });
251
- this.stylePropertyesExist.hasThetaOffset = 1;
251
+ this.stylePropertiesExist.hasThetaOffset = 1;
252
252
  this.cellLength += 1;
253
- } // console.log('this.cellLength', this.cellLength)
254
-
253
+ }
255
254
  }
256
255
  /**
257
256
  * 判断变量 stroke 是否是常量值
@@ -428,20 +427,24 @@ var BaseModel = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = /*#__P
428
427
  key: "needUpdate",
429
428
  value: function needUpdate() {
430
429
  return false;
431
- }
430
+ } // eslint-disable-next-line @typescript-eslint/no-unused-vars
431
+
432
432
  }, {
433
433
  key: "buildModels",
434
434
  value: function buildModels(callbackModel) {
435
435
  throw new Error('Method not implemented.');
436
- }
436
+ } // eslint-disable-next-line @typescript-eslint/no-unused-vars
437
+
437
438
  }, {
438
439
  key: "initModels",
439
440
  value: function initModels(callbackModel) {
440
441
  throw new Error('Method not implemented.');
441
- }
442
+ } // eslint-disable-next-line @typescript-eslint/no-unused-vars
443
+
442
444
  }, {
443
445
  key: "clearModels",
444
446
  value: function clearModels() {
447
+ var refresh = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
445
448
  return;
446
449
  }
447
450
  }, {
@@ -1,4 +1,4 @@
1
- import { IAnimateOption, IMapService } from '@antv/l7-core';
1
+ import { IAnimateOption, IMapService, ITexture2D } from '@antv/l7-core';
2
2
  import { IColorRamp, IImagedata } from '@antv/l7-utils';
3
3
  import { styleOffset } from '../core/BaseModel';
4
4
  import { anchorType } from '../utils/symbol-layout';
@@ -32,6 +32,9 @@ export interface IBaseLayerStyleOptions {
32
32
  zIndex?: number;
33
33
  mask?: boolean;
34
34
  maskInside?: boolean;
35
+ usage?: string;
36
+ color?: string;
37
+ size?: number;
35
38
  }
36
39
  export interface ILineLayerStyleOptions extends IBaseLayerStyleOptions {
37
40
  tileOrigin?: number[];
@@ -116,6 +119,7 @@ export interface IRasterTileLayerStyleOptions extends IBaseLayerStyleOptions {
116
119
  }
117
120
  export interface IMaskLayerStyleOptions extends IBaseLayerStyleOptions {
118
121
  opacity: number;
122
+ color: string;
119
123
  }
120
124
  export interface IWindLayerStyleOptions extends IBaseLayerStyleOptions {
121
125
  uMin?: number;
@@ -139,12 +143,27 @@ export interface IImageLayerStyleOptions extends IBaseLayerStyleOptions {
139
143
  clampHigh?: boolean;
140
144
  rampColors?: IColorRamp;
141
145
  rampColorsData?: ImageData | IImagedata;
146
+ colorTexture?: ITexture2D;
142
147
  pixelConstant?: number;
143
148
  pixelConstantR?: number;
144
149
  pixelConstantG?: number;
145
150
  pixelConstantB?: number;
146
151
  pixelConstantRGB?: number;
147
152
  }
153
+ export interface ICityBuildLayerStyleOptions {
154
+ opacity: number;
155
+ baseColor: string;
156
+ brightColor: string;
157
+ windowColor: string;
158
+ time: number;
159
+ sweep: {
160
+ enable: boolean;
161
+ sweepRadius: number;
162
+ sweepColor: string;
163
+ sweepSpeed: number;
164
+ sweepCenter?: [number, number];
165
+ };
166
+ }
148
167
  export interface IGeometryLayerStyleOptions extends IBaseLayerStyleOptions {
149
168
  mapTexture?: string;
150
169
  terrainTexture?: string;
@@ -54,6 +54,12 @@ export declare function SimpleLineTriangulation(feature: IEncodeFeature): {
54
54
  size: number;
55
55
  count: number;
56
56
  };
57
+ export declare function TileSimpleLineTriangulation(feature: IEncodeFeature): {
58
+ vertices: any[];
59
+ indices: never[];
60
+ size: number;
61
+ count: number;
62
+ };
57
63
  export declare function polygonTriangulation(feature: IEncodeFeature): {
58
64
  indices: number[];
59
65
  vertices: number[];
@@ -134,6 +134,16 @@ export function SimpleLineTriangulation(feature) {
134
134
  var coordinates = feature.coordinates;
135
135
  var pos = [];
136
136
 
137
+ if (!Array.isArray(coordinates[0])) {
138
+ return {
139
+ vertices: [],
140
+ indices: [],
141
+ normals: [],
142
+ size: 6,
143
+ count: 0
144
+ };
145
+ }
146
+
137
147
  var _getSimpleLineVertice = getSimpleLineVertices(coordinates),
138
148
  results = _getSimpleLineVertice.results,
139
149
  totalDistance = _getSimpleLineVertice.totalDistance;
@@ -149,6 +159,32 @@ export function SimpleLineTriangulation(feature) {
149
159
  count: results.length
150
160
  };
151
161
  }
162
+ export function TileSimpleLineTriangulation(feature) {
163
+ var coordinates = feature.coordinates;
164
+ var pos = [];
165
+
166
+ if (!Array.isArray(coordinates[0])) {
167
+ return {
168
+ vertices: [],
169
+ indices: [],
170
+ size: 4,
171
+ count: 0
172
+ };
173
+ }
174
+
175
+ var _getTileSimpleLineVer = getTileSimpleLineVertices(coordinates),
176
+ results = _getTileSimpleLineVer.results;
177
+
178
+ results.map(function (point) {
179
+ pos.push(point[0], point[1], point[2], point[3]);
180
+ });
181
+ return {
182
+ vertices: pos,
183
+ indices: [],
184
+ size: 4,
185
+ count: results.length
186
+ };
187
+ }
152
188
 
153
189
  function lineSegmentDistance(b1, a1) {
154
190
  var dx = a1[0] - b1[0];
@@ -161,7 +197,10 @@ function pushDis(point, n) {
161
197
  point.push(0);
162
198
  }
163
199
 
164
- point.push(n);
200
+ if (n !== undefined) {
201
+ point.push(n);
202
+ }
203
+
165
204
  return point;
166
205
  }
167
206
 
@@ -196,6 +235,29 @@ function getSimpleLineVertices(points) {
196
235
  }
197
236
  }
198
237
 
238
+ function getTileSimpleLineVertices(points) {
239
+ if (points.length < 2) {
240
+ return {
241
+ results: points
242
+ };
243
+ } else {
244
+ var results = [];
245
+ var point = pushDis(points[0]);
246
+ results.push(point);
247
+
248
+ for (var i = 1; i < points.length - 1; i++) {
249
+ var mulPoint = pushDis(points[i]);
250
+ results.push(mulPoint);
251
+ results.push(mulPoint);
252
+ }
253
+
254
+ results.push(pushDis(points[points.length - 1]));
255
+ return {
256
+ results: results
257
+ };
258
+ }
259
+ }
260
+
199
261
  export function polygonTriangulation(feature) {
200
262
  var coordinates = feature.coordinates;
201
263
  var flattengeo = earcut.flatten(coordinates);
@@ -207,7 +269,7 @@ export function polygonTriangulation(feature) {
207
269
  vertices: vertices,
208
270
  size: dimensions
209
271
  };
210
- } // TODO:构建几何图形(带有中心点和大小)
272
+ } // 构建几何图形(带有中心点和大小)
211
273
 
212
274
  export function polygonTriangulationWithCenter(feature) {
213
275
  var coordinates = feature.coordinates;
package/es/earth/index.js CHANGED
@@ -61,7 +61,9 @@ var EarthLayer = /*#__PURE__*/function (_BaseLayer) {
61
61
  this.layerModel.initModels(function (models) {
62
62
  _this2.models = models;
63
63
 
64
- _this2.renderLayers();
64
+ _this2.emit('modelLoaded', null);
65
+
66
+ _this2.layerService.throttleRenderLayers();
65
67
  });
66
68
  }
67
69
  /**
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
14
14
  import { earthTriangulation } from "../../core/triangulation";
15
15
 
16
16
  /* babel-plugin-inline-import '../shaders/atmosphere_frag.glsl' */
17
- 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";
17
+ 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";
18
18
 
19
19
  /* babel-plugin-inline-import '../shaders/atmosphere_vert.glsl' */
20
20
  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";
@@ -57,7 +57,7 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
57
57
  // TODO: 调整图层的绘制顺序 地球大气层
58
58
  this.layer.zIndex = -997;
59
59
  this.layer.buildLayerModel({
60
- moduleName: 'earthAtmo',
60
+ moduleName: 'earthAtmoSphere',
61
61
  vertexShader: atmoSphereVert,
62
62
  fragmentShader: atmoSphereFrag,
63
63
  triangulation: earthTriangulation,
@@ -82,13 +82,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
82
82
  descriptor: {
83
83
  name: 'a_Size',
84
84
  buffer: {
85
- // give the WebGL driver a hint that this buffer may change
86
85
  usage: gl.DYNAMIC_DRAW,
87
86
  data: [],
88
87
  type: gl.FLOAT
89
88
  },
90
89
  size: 1,
91
- update: function update(feature, featureIdx, vertex, attributeIdx) {
90
+ update: function update(feature) {
92
91
  var _feature$size = feature.size,
93
92
  size = _feature$size === void 0 ? 1 : _feature$size;
94
93
  return Array.isArray(size) ? [size[0]] : [size];
@@ -101,7 +100,6 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
101
100
  descriptor: {
102
101
  name: 'a_Normal',
103
102
  buffer: {
104
- // give the WebGL driver a hint that this buffer may change
105
103
  usage: gl.STATIC_DRAW,
106
104
  data: [],
107
105
  type: gl.FLOAT
@@ -118,13 +116,12 @@ var EarthAtomSphereModel = /*#__PURE__*/function (_BaseModel) {
118
116
  descriptor: {
119
117
  name: 'a_Uv',
120
118
  buffer: {
121
- // give the WebGL driver a hint that this buffer may change
122
119
  usage: gl.DYNAMIC_DRAW,
123
120
  data: [],
124
121
  type: gl.FLOAT
125
122
  },
126
123
  size: 2,
127
- update: function update(feature, featureIdx, vertex, attributeIdx) {
124
+ update: function update(feature, featureIdx, vertex) {
128
125
  return [vertex[3], vertex[4]];
129
126
  }
130
127
  }
@@ -54,7 +54,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
54
54
  value: function getUninforms() {
55
55
  var _this$layer$getLayerC = this.layer.getLayerConfig(),
56
56
  animateOption = _this$layer$getLayerC.animateOption,
57
- globelOtions = _this$layer$getLayerC.globelOtions;
57
+ globalOptions = _this$layer$getLayerC.globalOptions;
58
58
 
59
59
  if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
60
60
  // @ts-ignore
@@ -69,13 +69,12 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
69
69
  }
70
70
 
71
71
  return {
72
- u_ambientRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.ambientRatio) || 0.6,
72
+ u_ambientRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.ambientRatio) || 0.6,
73
73
  // 环境光
74
- u_diffuseRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.diffuseRatio) || 0.4,
74
+ u_diffuseRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.diffuseRatio) || 0.4,
75
75
  // 漫反射
76
- u_specularRatio: (globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.specularRatio) || 0.1,
76
+ u_specularRatio: (globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.specularRatio) || 0.1,
77
77
  // 高光反射
78
- // u_sunLight: [120, 120, 120],
79
78
  u_sunLight: [this.sunX, this.sunY, this.sunZ],
80
79
  u_texture: this.texture
81
80
  };
@@ -87,7 +86,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
87
86
  this.sunY = 10;
88
87
  this.sunX = Math.cos(this.earthTime) * (this.sunRadius - this.sunY);
89
88
  this.sunZ = Math.sin(this.earthTime) * (this.sunRadius - this.sunY);
90
- this.layerService.renderLayers();
89
+ this.layerService.throttleRenderLayers();
91
90
  }
92
91
  }, {
93
92
  key: "initModels",
@@ -95,10 +94,10 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
95
94
  var _this2 = this;
96
95
 
97
96
  var _this$layer$getLayerC2 = this.layer.getLayerConfig(),
98
- globelOtions = _this$layer$getLayerC2.globelOtions;
97
+ globalOptions = _this$layer$getLayerC2.globalOptions;
99
98
 
100
- if ((globelOtions === null || globelOtions === void 0 ? void 0 : globelOtions.earthTime) !== undefined) {
101
- this.setEarthTime(globelOtions.earthTime);
99
+ if ((globalOptions === null || globalOptions === void 0 ? void 0 : globalOptions.earthTime) !== undefined) {
100
+ this.setEarthTime(globalOptions.earthTime);
102
101
  }
103
102
 
104
103
  var source = this.layer.getSource();
@@ -114,9 +113,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
114
113
  height: imageData[0].height
115
114
  });
116
115
 
117
- _this2.layerService.updateLayerRenderList();
118
-
119
- _this2.layerService.renderLayers();
116
+ _this2.layerService.reRender();
120
117
  });
121
118
  this.buildModels(callbackModel);
122
119
  }
@@ -128,7 +125,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
128
125
  }, {
129
126
  key: "buildModels",
130
127
  value: function buildModels(callbackModel) {
131
- // TODO: 调整图层的绘制顺序 地球大气层
128
+ // Tip: 调整图层的绘制顺序 地球大气层
132
129
  this.layer.zIndex = -998;
133
130
  this.layer.buildLayerModel({
134
131
  moduleName: 'earthBase',
@@ -149,20 +146,18 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
149
146
  }, {
150
147
  key: "registerBuiltinAttributes",
151
148
  value: function registerBuiltinAttributes() {
152
- // point layer size;
153
149
  this.styleAttributeService.registerStyleAttribute({
154
150
  name: 'size',
155
151
  type: AttributeType.Attribute,
156
152
  descriptor: {
157
153
  name: 'a_Size',
158
154
  buffer: {
159
- // give the WebGL driver a hint that this buffer may change
160
155
  usage: gl.DYNAMIC_DRAW,
161
156
  data: [],
162
157
  type: gl.FLOAT
163
158
  },
164
159
  size: 1,
165
- update: function update(feature, featureIdx, vertex, attributeIdx) {
160
+ update: function update(feature) {
166
161
  var _feature$size = feature.size,
167
162
  size = _feature$size === void 0 ? 1 : _feature$size;
168
163
  return Array.isArray(size) ? [size[0]] : [size];
@@ -175,7 +170,6 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
175
170
  descriptor: {
176
171
  name: 'a_Normal',
177
172
  buffer: {
178
- // give the WebGL driver a hint that this buffer may change
179
173
  usage: gl.STATIC_DRAW,
180
174
  data: [],
181
175
  type: gl.FLOAT
@@ -198,7 +192,7 @@ var BaseEarthModel = /*#__PURE__*/function (_BaseModel) {
198
192
  type: gl.FLOAT
199
193
  },
200
194
  size: 2,
201
- update: function update(feature, featureIdx, vertex, attributeIdx) {
195
+ update: function update(feature, featureIdx, vertex) {
202
196
  return [vertex[3], vertex[4]];
203
197
  }
204
198
  }
@@ -14,7 +14,7 @@ import BaseModel from "../../core/BaseModel";
14
14
  import { earthOuterTriangulation } from "../../core/triangulation";
15
15
 
16
16
  /* babel-plugin-inline-import '../shaders/bloomsphere_frag.glsl' */
17
- var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\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";
17
+ var bloomSphereFrag = "\nuniform float u_opacity;\nuniform vec3 u_CameraPosition;\nvarying vec3 vVertexNormal;\n\nvarying vec4 v_Color;\nvoid main() {\n\n\n float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));\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";
18
18
 
19
19
  /* babel-plugin-inline-import '../shaders/bloomsphere_vert.glsl' */
20
20
  var bloomSphereVert = "\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute vec2 a_Uv;\nattribute vec4 a_Color;\nuniform vec3 u_CameraPosition;\nuniform mat4 u_ViewProjectionMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_ViewMatrix;\n\nvarying vec3 vVertexNormal;\nvarying vec4 v_Color;\n\nvoid main() {\n v_Color = a_Color;\n\n vVertexNormal = a_Normal;\n\n gl_Position = u_ViewProjectionMatrix * u_ModelMatrix * vec4(a_Position, 1.0);\n}\n";
@@ -54,7 +54,7 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
54
54
  }, {
55
55
  key: "buildModels",
56
56
  value: function buildModels(callbackModel) {
57
- // TODO: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
57
+ // Tip: 调整图层的绘制顺序,让它保持在地球后面(减少锯齿现象)
58
58
  this.layer.zIndex = -999;
59
59
  this.layer.buildLayerModel({
60
60
  moduleName: 'earthBloom',
@@ -75,20 +75,18 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
75
75
  }, {
76
76
  key: "registerBuiltinAttributes",
77
77
  value: function registerBuiltinAttributes() {
78
- // point layer size;
79
78
  this.styleAttributeService.registerStyleAttribute({
80
79
  name: 'size',
81
80
  type: AttributeType.Attribute,
82
81
  descriptor: {
83
82
  name: 'a_Size',
84
83
  buffer: {
85
- // give the WebGL driver a hint that this buffer may change
86
84
  usage: gl.DYNAMIC_DRAW,
87
85
  data: [],
88
86
  type: gl.FLOAT
89
87
  },
90
88
  size: 1,
91
- update: function update(feature, featureIdx, vertex, attributeIdx) {
89
+ update: function update(feature) {
92
90
  var _feature$size = feature.size,
93
91
  size = _feature$size === void 0 ? 1 : _feature$size;
94
92
  return Array.isArray(size) ? [size[0]] : [size];
@@ -101,7 +99,6 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
101
99
  descriptor: {
102
100
  name: 'a_Normal',
103
101
  buffer: {
104
- // give the WebGL driver a hint that this buffer may change
105
102
  usage: gl.STATIC_DRAW,
106
103
  data: [],
107
104
  type: gl.FLOAT
@@ -118,13 +115,12 @@ var EarthBloomSphereModel = /*#__PURE__*/function (_BaseModel) {
118
115
  descriptor: {
119
116
  name: 'a_Uv',
120
117
  buffer: {
121
- // give the WebGL driver a hint that this buffer may change
122
118
  usage: gl.DYNAMIC_DRAW,
123
119
  data: [],
124
120
  type: gl.FLOAT
125
121
  },
126
122
  size: 2,
127
- update: function update(feature, featureIdx, vertex, attributeIdx) {
123
+ update: function update(feature, featureIdx, vertex) {
128
124
  return [vertex[3], vertex[4]];
129
125
  }
130
126
  }
@@ -10,7 +10,7 @@ void main() {
10
10
 
11
11
  // float intensity = pow(0.5 + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);
12
12
  float intensity = pow(v_offset + dot(normalize(vVertexNormal), normalize(u_CameraPosition)), 3.0);
13
- // TODO: 去除背面
13
+ // 去除背面
14
14
  if(intensity > 1.0) intensity = 0.0;
15
15
 
16
16
  gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
@@ -8,7 +8,7 @@ void main() {
8
8
 
9
9
 
10
10
  float intensity = - dot(normalize(vVertexNormal), normalize(u_CameraPosition));
11
- // TODO: 去除背面
11
+ // 去除背面
12
12
  if(intensity > 1.0) intensity = 0.0;
13
13
 
14
14
  gl_FragColor = vec4(v_Color.rgb, v_Color.a * intensity * u_opacity);
@@ -1,4 +1,4 @@
1
- import { IAttrubuteAndElements } from '@antv/l7-core';
1
+ import { IAttributeAndElements } from '@antv/l7-core';
2
2
  import BaseLayer from '../core/BaseLayer';
3
3
  import { IHeatMapLayerStyleOptions } from '../core/interface';
4
4
  import { HeatMapModelType } from './models';
@@ -7,7 +7,7 @@ export default class HeatMapLayer extends BaseLayer<IHeatMapLayerStyleOptions> {
7
7
  buildModels(): void;
8
8
  rebuildModels(): void;
9
9
  renderModels(): this;
10
- updateModelData(data: IAttrubuteAndElements): void;
10
+ updateModelData(data: IAttributeAndElements): void;
11
11
  protected getConfigSchema(): {
12
12
  properties: {
13
13
  opacity: {
@@ -44,7 +44,9 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
44
44
  this.layerModel.initModels(function (models) {
45
45
  _this2.models = models;
46
46
 
47
- _this2.renderLayers();
47
+ _this2.emit('modelLoaded', null);
48
+
49
+ _this2.layerService.throttleRenderLayers();
48
50
  });
49
51
  }
50
52
  }, {
@@ -53,7 +55,9 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
53
55
  var _this3 = this;
54
56
 
55
57
  this.layerModel.buildModels(function (models) {
56
- return _this3.models = models;
58
+ _this3.models = models;
59
+
60
+ _this3.emit('modelLoaded', null);
57
61
  });
58
62
  }
59
63
  }, {
@@ -74,9 +78,7 @@ var HeatMapLayer = /*#__PURE__*/function (_BaseLayer) {
74
78
  if (this.layerModelNeedUpdate) {
75
79
  this.layerModel.buildModels(function (models) {
76
80
  return _this4.models = models;
77
- }); // @ts-ignore
78
- // this.models = this.layerModel.buildModels();
79
-
81
+ });
80
82
  this.layerModelNeedUpdate = false;
81
83
  }
82
84
 
@@ -86,14 +86,12 @@ var GridModel = /*#__PURE__*/function (_BaseModel) {
86
86
  descriptor: {
87
87
  name: 'a_Pos',
88
88
  buffer: {
89
- // give the WebGL driver a hint that this buffer may change
90
89
  usage: gl.DYNAMIC_DRAW,
91
90
  data: [],
92
91
  type: gl.FLOAT
93
92
  },
94
93
  size: 3,
95
- update: function update(feature, featureIdx) {
96
- // const coordinates = feature.coordinates as number[];
94
+ update: function update(feature) {
97
95
  var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
98
96
  return [coordinates[0], coordinates[1], 0];
99
97
  }
@@ -80,33 +80,29 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
80
80
  }, {
81
81
  key: "registerBuiltinAttributes",
82
82
  value: function registerBuiltinAttributes() {
83
- // point layer size;
84
83
  this.styleAttributeService.registerStyleAttribute({
85
84
  name: 'size',
86
85
  type: AttributeType.Attribute,
87
86
  descriptor: {
88
87
  name: 'a_Size',
89
88
  buffer: {
90
- // give the WebGL driver a hint that this buffer may change
91
89
  usage: gl.DYNAMIC_DRAW,
92
90
  data: [],
93
91
  type: gl.FLOAT
94
92
  },
95
93
  size: 1,
96
- update: function update(feature, featureIdx, vertex, attributeIdx) {
94
+ update: function update(feature) {
97
95
  var size = feature.size;
98
96
  return Array.isArray(size) ? [size[0]] : [size];
99
97
  }
100
98
  }
101
- }); // point layer size;
102
-
99
+ });
103
100
  this.styleAttributeService.registerStyleAttribute({
104
101
  name: 'normal',
105
102
  type: AttributeType.Attribute,
106
103
  descriptor: {
107
104
  name: 'a_Normal',
108
105
  buffer: {
109
- // give the WebGL driver a hint that this buffer may change
110
106
  usage: gl.STATIC_DRAW,
111
107
  data: [],
112
108
  type: gl.FLOAT
@@ -124,16 +120,13 @@ var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
124
120
  descriptor: {
125
121
  name: 'a_Pos',
126
122
  buffer: {
127
- // give the WebGL driver a hint that this buffer may change
128
123
  usage: gl.DYNAMIC_DRAW,
129
124
  data: [],
130
125
  type: gl.FLOAT
131
126
  },
132
127
  size: 3,
133
- update: function update(feature, featureIdx) {
134
- var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates; // const coordinates = feature.coordinates as number[];
135
- // const coordinates = feature.originCoordinates as number[];
136
-
128
+ update: function update(feature) {
129
+ var coordinates = feature.version === 'GAODE2.x' ? feature.originCoordinates : feature.coordinates;
137
130
  return [coordinates[0], coordinates[1], 0];
138
131
  }
139
132
  }