@antv/l7-layers 2.9.17-alpha.0 → 2.9.17

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 (367) hide show
  1. package/es/Geometry/index.js +2 -12
  2. package/es/Geometry/index.js.map +1 -1
  3. package/es/Geometry/models/billboard.d.ts +3 -3
  4. package/es/Geometry/models/billboard.js +6 -11
  5. package/es/Geometry/models/billboard.js.map +1 -1
  6. package/es/Geometry/models/plane.d.ts +3 -3
  7. package/es/Geometry/models/plane.js +7 -12
  8. package/es/Geometry/models/plane.js.map +1 -1
  9. package/es/Geometry/models/sprite.d.ts +3 -3
  10. package/es/Geometry/models/sprite.js +6 -11
  11. package/es/Geometry/models/sprite.js.map +1 -1
  12. package/es/canvas/index.js +2 -12
  13. package/es/canvas/index.js.map +1 -1
  14. package/es/citybuliding/building.js +2 -12
  15. package/es/citybuliding/building.js.map +1 -1
  16. package/es/citybuliding/models/build.d.ts +1 -2
  17. package/es/citybuliding/models/build.js +3 -16
  18. package/es/citybuliding/models/build.js.map +1 -1
  19. package/es/core/BaseLayer.d.ts +1 -1
  20. package/es/core/BaseLayer.js +58 -97
  21. package/es/core/BaseLayer.js.map +1 -1
  22. package/es/core/BaseModel.d.ts +2 -2
  23. package/es/core/BaseModel.js +2 -2
  24. package/es/core/BaseModel.js.map +1 -1
  25. package/es/core/interface.d.ts +13 -2
  26. package/es/core/interface.js.map +1 -1
  27. package/es/core/triangulation.d.ts +0 -1
  28. package/es/core/triangulation.js +11 -37
  29. package/es/core/triangulation.js.map +1 -1
  30. package/es/earth/index.js +2 -8
  31. package/es/earth/index.js.map +1 -1
  32. package/es/earth/models/atmosphere.d.ts +2 -2
  33. package/es/earth/models/atmosphere.js +6 -11
  34. package/es/earth/models/atmosphere.js.map +1 -1
  35. package/es/earth/models/base.d.ts +2 -2
  36. package/es/earth/models/base.js +6 -11
  37. package/es/earth/models/base.js.map +1 -1
  38. package/es/earth/models/bloomsphere.d.ts +2 -2
  39. package/es/earth/models/bloomsphere.js +6 -11
  40. package/es/earth/models/bloomsphere.js.map +1 -1
  41. package/es/heatmap/index.js +5 -17
  42. package/es/heatmap/index.js.map +1 -1
  43. package/es/heatmap/models/grid.d.ts +2 -2
  44. package/es/heatmap/models/grid.js +8 -12
  45. package/es/heatmap/models/grid.js.map +1 -1
  46. package/es/heatmap/models/grid3d.d.ts +2 -2
  47. package/es/heatmap/models/grid3d.js +6 -12
  48. package/es/heatmap/models/grid3d.js.map +1 -1
  49. package/es/heatmap/models/heatmap.d.ts +2 -2
  50. package/es/heatmap/models/heatmap.js +62 -112
  51. package/es/heatmap/models/heatmap.js.map +1 -1
  52. package/es/heatmap/models/hexagon.d.ts +2 -2
  53. package/es/heatmap/models/hexagon.js +6 -11
  54. package/es/heatmap/models/hexagon.js.map +1 -1
  55. package/es/image/index.d.ts +1 -1
  56. package/es/image/index.js +16 -14
  57. package/es/image/index.js.map +1 -1
  58. package/es/image/models/dataImage.d.ts +22 -0
  59. package/es/image/models/dataImage.js +230 -0
  60. package/es/image/models/dataImage.js.map +1 -0
  61. package/es/image/models/image.d.ts +4 -3
  62. package/es/image/models/image.js +14 -11
  63. package/es/image/models/image.js.map +1 -1
  64. package/es/image/models/index.d.ts +1 -1
  65. package/es/image/models/index.js +3 -1
  66. package/es/image/models/index.js.map +1 -1
  67. package/es/line/index.d.ts +2 -0
  68. package/es/line/index.js +5 -12
  69. package/es/line/index.js.map +1 -1
  70. package/es/line/models/arc.d.ts +2 -2
  71. package/es/line/models/arc.js +10 -15
  72. package/es/line/models/arc.js.map +1 -1
  73. package/es/line/models/arc_3d.d.ts +2 -2
  74. package/es/line/models/arc_3d.js +8 -13
  75. package/es/line/models/arc_3d.js.map +1 -1
  76. package/es/line/models/arcmini.d.ts +9 -0
  77. package/es/line/models/arcmini.js +145 -0
  78. package/es/line/models/arcmini.js.map +1 -0
  79. package/es/line/models/earthArc_3d.d.ts +2 -2
  80. package/es/line/models/earthArc_3d.js +9 -17
  81. package/es/line/models/earthArc_3d.js.map +1 -1
  82. package/es/line/models/great_circle.d.ts +2 -2
  83. package/es/line/models/great_circle.js +8 -13
  84. package/es/line/models/great_circle.js.map +1 -1
  85. package/es/line/models/half.d.ts +2 -2
  86. package/es/line/models/half.js +29 -46
  87. package/es/line/models/half.js.map +1 -1
  88. package/es/line/models/index.d.ts +1 -1
  89. package/es/line/models/index.js +2 -0
  90. package/es/line/models/index.js.map +1 -1
  91. package/es/line/models/line.d.ts +2 -2
  92. package/es/line/models/line.js +16 -28
  93. package/es/line/models/line.js.map +1 -1
  94. package/es/line/models/linearline.d.ts +11 -2
  95. package/es/line/models/linearline.js +24 -14
  96. package/es/line/models/linearline.js.map +1 -1
  97. package/es/line/models/simpleLine.d.ts +2 -3
  98. package/es/line/models/simpleLine.js +18 -66
  99. package/es/line/models/simpleLine.js.map +1 -1
  100. package/es/line/models/tile.d.ts +11 -2
  101. package/es/line/models/tile.js +39 -45
  102. package/es/line/models/tile.js.map +1 -1
  103. package/es/line/models/wall.d.ts +2 -2
  104. package/es/line/models/wall.js +9 -13
  105. package/es/line/models/wall.js.map +1 -1
  106. package/es/mask/index.js +2 -12
  107. package/es/mask/index.js.map +1 -1
  108. package/es/mask/models/fill.d.ts +2 -2
  109. package/es/mask/models/fill.js +27 -53
  110. package/es/mask/models/fill.js.map +1 -1
  111. package/es/plugins/DataMappingPlugin.js +8 -29
  112. package/es/plugins/DataMappingPlugin.js.map +1 -1
  113. package/es/plugins/DataSourcePlugin.js +5 -14
  114. package/es/plugins/DataSourcePlugin.js.map +1 -1
  115. package/es/plugins/LayerModelPlugin.d.ts +0 -2
  116. package/es/plugins/LayerModelPlugin.js +7 -33
  117. package/es/plugins/LayerModelPlugin.js.map +1 -1
  118. package/es/plugins/PixelPickingPlugin.js +13 -16
  119. package/es/plugins/PixelPickingPlugin.js.map +1 -1
  120. package/es/point/index.d.ts +1 -1
  121. package/es/point/index.js +8 -15
  122. package/es/point/index.js.map +1 -1
  123. package/es/point/models/earthExtrude.d.ts +2 -2
  124. package/es/point/models/earthExtrude.js +14 -16
  125. package/es/point/models/earthExtrude.js.map +1 -1
  126. package/es/point/models/earthFill.d.ts +11 -2
  127. package/es/point/models/earthFill.js +22 -13
  128. package/es/point/models/earthFill.js.map +1 -1
  129. package/es/point/models/extrude.d.ts +2 -2
  130. package/es/point/models/extrude.js +27 -49
  131. package/es/point/models/extrude.js.map +1 -1
  132. package/es/point/models/fill.d.ts +2 -2
  133. package/es/point/models/fill.js +41 -59
  134. package/es/point/models/fill.js.map +1 -1
  135. package/es/point/models/fillmage.d.ts +7 -2
  136. package/es/point/models/fillmage.js +22 -13
  137. package/es/point/models/fillmage.js.map +1 -1
  138. package/es/point/models/icon-font.d.ts +11 -0
  139. package/es/point/models/icon-font.js +181 -0
  140. package/es/point/models/icon-font.js.map +1 -0
  141. package/es/point/models/image.d.ts +2 -2
  142. package/es/point/models/image.js +6 -11
  143. package/es/point/models/image.js.map +1 -1
  144. package/es/point/models/index.d.ts +1 -1
  145. package/es/point/models/index.js +2 -0
  146. package/es/point/models/index.js.map +1 -1
  147. package/es/point/models/normal.d.ts +2 -2
  148. package/es/point/models/normal.js +6 -11
  149. package/es/point/models/normal.js.map +1 -1
  150. package/es/point/models/radar.d.ts +11 -2
  151. package/es/point/models/radar.js +22 -13
  152. package/es/point/models/radar.js.map +1 -1
  153. package/es/point/models/simplePoint.d.ts +2 -2
  154. package/es/point/models/simplePoint.js +6 -11
  155. package/es/point/models/simplePoint.js.map +1 -1
  156. package/es/point/models/text.d.ts +2 -3
  157. package/es/point/models/text.js +75 -108
  158. package/es/point/models/text.js.map +1 -1
  159. package/es/point/models/tile.d.ts +11 -2
  160. package/es/point/models/tile.js +25 -22
  161. package/es/point/models/tile.js.map +1 -1
  162. package/es/polygon/index.js +2 -12
  163. package/es/polygon/index.js.map +1 -1
  164. package/es/polygon/models/extrude.d.ts +2 -2
  165. package/es/polygon/models/extrude.js +5 -10
  166. package/es/polygon/models/extrude.js.map +1 -1
  167. package/es/polygon/models/fill.d.ts +2 -2
  168. package/es/polygon/models/fill.js +13 -27
  169. package/es/polygon/models/fill.js.map +1 -1
  170. package/es/polygon/models/ocean.d.ts +2 -2
  171. package/es/polygon/models/ocean.js +6 -12
  172. package/es/polygon/models/ocean.js.map +1 -1
  173. package/es/polygon/models/tile.d.ts +3 -2
  174. package/es/polygon/models/tile.js +27 -17
  175. package/es/polygon/models/tile.js.map +1 -1
  176. package/es/polygon/models/water.d.ts +2 -2
  177. package/es/polygon/models/water.js +6 -12
  178. package/es/polygon/models/water.js.map +1 -1
  179. package/es/raster/image.d.ts +0 -0
  180. package/es/raster/image.js +2 -0
  181. package/es/raster/image.js.map +1 -0
  182. package/es/raster/index.js +2 -12
  183. package/es/raster/index.js.map +1 -1
  184. package/es/raster/models/raster.d.ts +3 -3
  185. package/es/raster/models/raster.js +7 -11
  186. package/es/raster/models/raster.js.map +1 -1
  187. package/es/raster/raster2d.d.ts +27 -0
  188. package/es/raster/raster2d.js +158 -0
  189. package/es/raster/raster2d.js.map +1 -0
  190. package/es/tile/manager/tileLayerManager.js +21 -4
  191. package/es/tile/manager/tileLayerManager.js.map +1 -1
  192. package/es/tile/manager/tilePickerManager.js +0 -1
  193. package/es/tile/manager/tilePickerManager.js.map +1 -1
  194. package/es/tile/tileFactory/base.js.map +1 -1
  195. package/es/tile/tileFactory/point.js.map +1 -1
  196. package/es/tile/tileFactory/rasterDataLayer.js +2 -12
  197. package/es/tile/tileFactory/rasterDataLayer.js.map +1 -1
  198. package/es/tile/tileFactory/vectorLayer.js +2 -12
  199. package/es/tile/tileFactory/vectorLayer.js.map +1 -1
  200. package/es/utils/extrude_polyline.d.ts +0 -15
  201. package/es/utils/extrude_polyline.js +6 -138
  202. package/es/utils/extrude_polyline.js.map +1 -1
  203. package/es/utils/geo.d.ts +12 -0
  204. package/es/utils/geo.js +53 -0
  205. package/es/utils/geo.js.map +1 -0
  206. package/es/utils/simpleLine.d.ts +23 -0
  207. package/es/utils/simpleLine.js +105 -0
  208. package/es/utils/simpleLine.js.map +1 -0
  209. package/es/wind/index.js +2 -12
  210. package/es/wind/index.js.map +1 -1
  211. package/es/wind/models/wind.d.ts +2 -2
  212. package/es/wind/models/wind.js +33 -36
  213. package/es/wind/models/wind.js.map +1 -1
  214. package/lib/Geometry/index.js +2 -12
  215. package/lib/Geometry/index.js.map +1 -1
  216. package/lib/Geometry/models/billboard.js +6 -11
  217. package/lib/Geometry/models/billboard.js.map +1 -1
  218. package/lib/Geometry/models/plane.js +7 -12
  219. package/lib/Geometry/models/plane.js.map +1 -1
  220. package/lib/Geometry/models/sprite.js +6 -11
  221. package/lib/Geometry/models/sprite.js.map +1 -1
  222. package/lib/canvas/index.js +2 -12
  223. package/lib/canvas/index.js.map +1 -1
  224. package/lib/citybuliding/building.js +2 -12
  225. package/lib/citybuliding/building.js.map +1 -1
  226. package/lib/citybuliding/models/build.js +3 -16
  227. package/lib/citybuliding/models/build.js.map +1 -1
  228. package/lib/core/BaseLayer.js +57 -96
  229. package/lib/core/BaseLayer.js.map +1 -1
  230. package/lib/core/BaseModel.js +2 -2
  231. package/lib/core/BaseModel.js.map +1 -1
  232. package/lib/core/interface.js.map +1 -1
  233. package/lib/core/triangulation.js +16 -40
  234. package/lib/core/triangulation.js.map +1 -1
  235. package/lib/earth/index.js +2 -8
  236. package/lib/earth/index.js.map +1 -1
  237. package/lib/earth/models/atmosphere.js +6 -11
  238. package/lib/earth/models/atmosphere.js.map +1 -1
  239. package/lib/earth/models/base.js +6 -11
  240. package/lib/earth/models/base.js.map +1 -1
  241. package/lib/earth/models/bloomsphere.js +6 -11
  242. package/lib/earth/models/bloomsphere.js.map +1 -1
  243. package/lib/heatmap/index.js +5 -17
  244. package/lib/heatmap/index.js.map +1 -1
  245. package/lib/heatmap/models/grid.js +8 -12
  246. package/lib/heatmap/models/grid.js.map +1 -1
  247. package/lib/heatmap/models/grid3d.js +6 -12
  248. package/lib/heatmap/models/grid3d.js.map +1 -1
  249. package/lib/heatmap/models/heatmap.js +62 -113
  250. package/lib/heatmap/models/heatmap.js.map +1 -1
  251. package/lib/heatmap/models/hexagon.js +6 -11
  252. package/lib/heatmap/models/hexagon.js.map +1 -1
  253. package/lib/image/index.js +16 -14
  254. package/lib/image/index.js.map +1 -1
  255. package/lib/image/models/dataImage.js +245 -0
  256. package/lib/image/models/dataImage.js.map +1 -0
  257. package/lib/image/models/image.js +14 -11
  258. package/lib/image/models/image.js.map +1 -1
  259. package/lib/image/models/index.js +4 -1
  260. package/lib/image/models/index.js.map +1 -1
  261. package/lib/line/index.js +5 -12
  262. package/lib/line/index.js.map +1 -1
  263. package/lib/line/models/arc.js +10 -15
  264. package/lib/line/models/arc.js.map +1 -1
  265. package/lib/line/models/arc_3d.js +8 -13
  266. package/lib/line/models/arc_3d.js.map +1 -1
  267. package/lib/line/models/arcmini.js +161 -0
  268. package/lib/line/models/arcmini.js.map +1 -0
  269. package/lib/line/models/earthArc_3d.js +9 -17
  270. package/lib/line/models/earthArc_3d.js.map +1 -1
  271. package/lib/line/models/great_circle.js +8 -13
  272. package/lib/line/models/great_circle.js.map +1 -1
  273. package/lib/line/models/half.js +29 -48
  274. package/lib/line/models/half.js.map +1 -1
  275. package/lib/line/models/index.js +3 -0
  276. package/lib/line/models/index.js.map +1 -1
  277. package/lib/line/models/line.js +18 -29
  278. package/lib/line/models/line.js.map +1 -1
  279. package/lib/line/models/linearline.js +24 -14
  280. package/lib/line/models/linearline.js.map +1 -1
  281. package/lib/line/models/simpleLine.js +18 -66
  282. package/lib/line/models/simpleLine.js.map +1 -1
  283. package/lib/line/models/tile.js +39 -47
  284. package/lib/line/models/tile.js.map +1 -1
  285. package/lib/line/models/wall.js +9 -13
  286. package/lib/line/models/wall.js.map +1 -1
  287. package/lib/mask/index.js +2 -12
  288. package/lib/mask/index.js.map +1 -1
  289. package/lib/mask/models/fill.js +27 -55
  290. package/lib/mask/models/fill.js.map +1 -1
  291. package/lib/plugins/DataMappingPlugin.js +8 -29
  292. package/lib/plugins/DataMappingPlugin.js.map +1 -1
  293. package/lib/plugins/DataSourcePlugin.js +4 -13
  294. package/lib/plugins/DataSourcePlugin.js.map +1 -1
  295. package/lib/plugins/LayerModelPlugin.js +7 -33
  296. package/lib/plugins/LayerModelPlugin.js.map +1 -1
  297. package/lib/plugins/PixelPickingPlugin.js +13 -16
  298. package/lib/plugins/PixelPickingPlugin.js.map +1 -1
  299. package/lib/point/index.js +8 -15
  300. package/lib/point/index.js.map +1 -1
  301. package/lib/point/models/earthExtrude.js +15 -16
  302. package/lib/point/models/earthExtrude.js.map +1 -1
  303. package/lib/point/models/earthFill.js +22 -13
  304. package/lib/point/models/earthFill.js.map +1 -1
  305. package/lib/point/models/extrude.js +28 -51
  306. package/lib/point/models/extrude.js.map +1 -1
  307. package/lib/point/models/fill.js +42 -61
  308. package/lib/point/models/fill.js.map +1 -1
  309. package/lib/point/models/fillmage.js +22 -13
  310. package/lib/point/models/fillmage.js.map +1 -1
  311. package/lib/point/models/icon-font.js +196 -0
  312. package/lib/point/models/icon-font.js.map +1 -0
  313. package/lib/point/models/image.js +6 -11
  314. package/lib/point/models/image.js.map +1 -1
  315. package/lib/point/models/index.js +3 -0
  316. package/lib/point/models/index.js.map +1 -1
  317. package/lib/point/models/normal.js +6 -11
  318. package/lib/point/models/normal.js.map +1 -1
  319. package/lib/point/models/radar.js +22 -13
  320. package/lib/point/models/radar.js.map +1 -1
  321. package/lib/point/models/simplePoint.js +6 -11
  322. package/lib/point/models/simplePoint.js.map +1 -1
  323. package/lib/point/models/text.js +78 -110
  324. package/lib/point/models/text.js.map +1 -1
  325. package/lib/point/models/tile.js +25 -22
  326. package/lib/point/models/tile.js.map +1 -1
  327. package/lib/polygon/index.js +2 -12
  328. package/lib/polygon/index.js.map +1 -1
  329. package/lib/polygon/models/extrude.js +5 -10
  330. package/lib/polygon/models/extrude.js.map +1 -1
  331. package/lib/polygon/models/fill.js +11 -25
  332. package/lib/polygon/models/fill.js.map +1 -1
  333. package/lib/polygon/models/ocean.js +6 -12
  334. package/lib/polygon/models/ocean.js.map +1 -1
  335. package/lib/polygon/models/tile.js +27 -17
  336. package/lib/polygon/models/tile.js.map +1 -1
  337. package/lib/polygon/models/water.js +6 -12
  338. package/lib/polygon/models/water.js.map +1 -1
  339. package/lib/raster/image.js +2 -0
  340. package/lib/raster/image.js.map +1 -0
  341. package/lib/raster/index.js +2 -12
  342. package/lib/raster/index.js.map +1 -1
  343. package/lib/raster/models/raster.js +7 -11
  344. package/lib/raster/models/raster.js.map +1 -1
  345. package/lib/raster/raster2d.js +172 -0
  346. package/lib/raster/raster2d.js.map +1 -0
  347. package/lib/tile/manager/tileLayerManager.js +21 -4
  348. package/lib/tile/manager/tileLayerManager.js.map +1 -1
  349. package/lib/tile/manager/tilePickerManager.js +0 -1
  350. package/lib/tile/manager/tilePickerManager.js.map +1 -1
  351. package/lib/tile/tileFactory/base.js.map +1 -1
  352. package/lib/tile/tileFactory/point.js.map +1 -1
  353. package/lib/tile/tileFactory/rasterDataLayer.js +2 -12
  354. package/lib/tile/tileFactory/rasterDataLayer.js.map +1 -1
  355. package/lib/tile/tileFactory/vectorLayer.js +2 -12
  356. package/lib/tile/tileFactory/vectorLayer.js.map +1 -1
  357. package/lib/utils/extrude_polyline.js +6 -140
  358. package/lib/utils/extrude_polyline.js.map +1 -1
  359. package/lib/utils/geo.js +65 -0
  360. package/lib/utils/geo.js.map +1 -0
  361. package/lib/utils/simpleLine.js +117 -0
  362. package/lib/utils/simpleLine.js.map +1 -0
  363. package/lib/wind/index.js +2 -12
  364. package/lib/wind/index.js.map +1 -1
  365. package/lib/wind/models/wind.js +33 -36
  366. package/lib/wind/models/wind.js.map +1 -1
  367. package/package.json +8 -9
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/citybuliding/models/build.ts"],"names":["AttributeType","gl","rgb2arr","BaseModel","PolygonExtrudeTriangulation","CityBuildModel","layer","getLayerConfig","opacity","baseColor","brightColor","windowColor","time","sweep","enable","sweepRadius","sweepColor","sweepSpeed","sweepCenter","cityCenter","u_cityCenter","u_cityMinSize","cityMinSize","u_circleSweep","u_circleSweepColor","slice","u_circleSweepSpeed","u_opacity","u_baseColor","u_brightColor","u_windowColor","u_time","getLayerAnimateTime","getSource","extent","minLng","minLat","maxLng","maxLat","mapService","version","lngLatToCoord","l1","l2","Math","sqrt","pow","w","h","callbackModel","calCityGeo","startModelAnimate","buildModels","buildLayerModel","moduleName","vertexShader","buildVert","fragmentShader","buildFrag","triangulation","depth","cull","face","BACK","then","model","catch","err","console","warn","styleAttributeService","registerStyleAttribute","name","type","Attribute","descriptor","buffer","usage","STATIC_DRAW","data","FLOAT","size","update","feature","featureIdx","vertex","attributeIdx","normal","DYNAMIC_DRAW","Array","isArray"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,aAAT,EAAwBC,EAAxB,QAA0D,eAA1D;AACA,SAASC,OAAT,QAAwB,gBAAxB;AACA,OAAOC,SAAP,MAAsB,sBAAtB;AACA,SAASC,2BAAT,QAA4C,0BAA5C;;;;IAiBqBC,c;;;;;;;;;;;;;;;;;;;;;;;;;WAInB,wBAAsB;AACpB,iBAaI,KAAKC,KAAL,CAAWC,cAAX,EAbJ;AAAA,8BACEC,OADF;AAAA,UACEA,OADF,6BACY,CADZ;AAAA,gCAEEC,SAFF;AAAA,UAEEA,SAFF,+BAEc,eAFd;AAAA,kCAGEC,WAHF;AAAA,UAGEA,WAHF,iCAGgB,iBAHhB;AAAA,kCAIEC,WAJF;AAAA,UAIEA,WAJF,iCAIgB,eAJhB;AAAA,2BAKEC,IALF;AAAA,UAKEA,IALF,0BAKS,CALT;AAAA,4BAMEC,KANF;AAAA,UAMEA,KANF,2BAMU;AACNC,QAAAA,MAAM,EAAE,KADF;AAENC,QAAAA,WAAW,EAAE,CAFP;AAGNC,QAAAA,UAAU,EAAE,oBAHN;AAINC,QAAAA,UAAU,EAAE,GAJN;AAKNC,QAAAA,WAAW,EAAE,KAAKC;AALZ,OANV;;AAcA,aAAO;AACLC,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QF,IAAR;AAAA,gBAAQA,IAAR,8BAAe,EAAf;AACA,mBAAOQ,KAAK,CAACC,OAAN,CAAcT,IAAd,IAAsB,CAACA,IAAI,CAAC,CAAD,CAAL,CAAtB,GAAkC,CAACA,IAAD,CAAzC;AACD;AAjBS;AAHoC,OAAlD;AAuBA,WAAKX,qBAAL,CAA2BC,sBAA3B,CAAkD;AAChDC,QAAAA,IAAI,EAAE,IAD0C;AAEhDC,QAAAA,IAAI,EAAEzE,aAAa,CAAC0E,SAF4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,MADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAE5E,EAAE,CAACuF,YAFJ;AAGNT,YAAAA,IAAI,EAAE,EAHA;AAINN,YAAAA,IAAI,EAAExE,EAAE,CAAC+E;AAJH,WAFE;AAQVC,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAQL,IAAR,GAAiBE,OAAjB,CAAQF,IAAR;AACA,mBAAO,CAACI,MAAM,CAAC,CAAD,CAAP,EAAYA,MAAM,CAAC,CAAD,CAAlB,CAAP;AACD;AAjBS;AAHoC,OAAlD;AAuBD;;;;EA/JyClF,S;;SAAvBE,c","sourcesContent":["import { AttributeType, gl, IEncodeFeature, IModel } from '@antv/l7-core';\nimport { rgb2arr } from '@antv/l7-utils';\nimport BaseModel from '../../core/BaseModel';\nimport { PolygonExtrudeTriangulation } from '../../core/triangulation';\nimport buildFrag from '../shaders/build_frag.glsl';\nimport buildVert from '../shaders/build_vert.glsl';\ninterface ICityBuildLayerStyleOptions {\n opacity: number;\n baseColor: string;\n brightColor: string;\n windowColor: string;\n time: number;\n sweep: {\n enable: boolean;\n sweepRadius: number;\n sweepColor: string;\n sweepSpeed: number;\n sweepCenter?: [number, number];\n };\n}\nexport default class CityBuildModel extends BaseModel {\n private cityCenter: [number, number];\n private cityMinSize: number;\n\n public getUninforms() {\n const {\n opacity = 1,\n baseColor = 'rgb(16,16,16)',\n brightColor = 'rgb(255,176,38)',\n windowColor = 'rgb(30,60,89)',\n time = 0,\n sweep = {\n enable: false,\n sweepRadius: 1,\n sweepColor: 'rgb(255, 255, 255)',\n sweepSpeed: 0.4,\n sweepCenter: this.cityCenter,\n },\n } = this.layer.getLayerConfig() as ICityBuildLayerStyleOptions;\n return {\n u_cityCenter: sweep.sweepCenter || this.cityCenter,\n u_cityMinSize: this.cityMinSize * sweep.sweepRadius,\n u_circleSweep: sweep.enable ? 1.0 : 0.0,\n u_circleSweepColor: rgb2arr(sweep.sweepColor).slice(0, 3),\n u_circleSweepSpeed: sweep.sweepSpeed,\n\n u_opacity: opacity,\n u_baseColor: rgb2arr(baseColor),\n u_brightColor: rgb2arr(brightColor),\n u_windowColor: rgb2arr(windowColor),\n u_time: this.layer.getLayerAnimateTime() || time,\n };\n }\n\n public calCityGeo() {\n // @ts-ignore\n const [minLng, minLat, maxLng, maxLat] = this.layer.getSource().extent;\n if (this.mapService.version === 'GAODE2.x') {\n // @ts-ignore\n this.cityCenter = this.mapService.lngLatToCoord([\n (maxLng + minLng) / 2,\n (maxLat + minLat) / 2,\n ]);\n // @ts-ignore\n const l1 = this.mapService.lngLatToCoord([maxLng, maxLat]);\n // @ts-ignore\n const l2 = this.mapService.lngLatToCoord([minLng, minLat]);\n this.cityMinSize =\n Math.sqrt(Math.pow(l1[0] - l2[0], 2) + Math.pow(l1[1] - l2[1], 2)) / 4;\n } else {\n const w = maxLng - minLng;\n const h = maxLat - minLat;\n this.cityCenter = [(maxLng + minLng) / 2, (maxLat + minLat) / 2];\n this.cityMinSize = Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 4;\n }\n }\n\n public initModels(callbackModel: (models: IModel[]) => void) {\n this.calCityGeo();\n\n this.startModelAnimate();\n\n this.buildModels(callbackModel);\n }\n\n public buildModels(callbackModel: (models: IModel[]) => void) {\n this.layer\n .buildLayerModel({\n moduleName: 'cityBuilding',\n vertexShader: buildVert,\n fragmentShader: buildFrag,\n triangulation: PolygonExtrudeTriangulation,\n depth: { enable: true },\n cull: {\n enable: true,\n face: gl.BACK,\n },\n })\n .then((model) => {\n callbackModel([model]);\n })\n .catch((err) => {\n console.warn(err);\n callbackModel([]);\n });\n }\n\n protected registerBuiltinAttributes() {\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'normal',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Normal',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 3,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n normal: number[],\n ) => {\n return normal;\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'size',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Size',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 10 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Uv',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size } = feature;\n return [vertex[3], vertex[4]];\n },\n },\n });\n }\n}\n"],"file":"build.js"}
1
+ {"version":3,"sources":["../../../src/citybuliding/models/build.ts"],"names":["AttributeType","gl","rgb2arr","BaseModel","PolygonExtrudeTriangulation","CityBuildModel","layer","getLayerConfig","opacity","baseColor","brightColor","windowColor","time","sweep","enable","sweepRadius","sweepColor","sweepSpeed","sweepCenter","cityCenter","u_cityCenter","u_cityMinSize","cityMinSize","u_circleSweep","u_circleSweepColor","slice","u_circleSweepSpeed","u_opacity","u_baseColor","u_brightColor","u_windowColor","u_time","getLayerAnimateTime","getSource","extent","minLng","minLat","maxLng","maxLat","mapService","version","lngLatToCoord","l1","l2","Math","sqrt","pow","w","h","calCityGeo","startModelAnimate","buildLayerModel","moduleName","vertexShader","buildVert","fragmentShader","buildFrag","triangulation","cull","face","BACK","styleAttributeService","registerStyleAttribute","name","type","Attribute","descriptor","buffer","usage","STATIC_DRAW","data","FLOAT","size","update","feature","featureIdx","vertex","attributeIdx","normal","DYNAMIC_DRAW","Array","isArray"],"mappings":";;;;;;;;;;;;;AAAA,SAASA,aAAT,EAAwBC,EAAxB,QAA0D,eAA1D;AACA,SAASC,OAAT,QAAwB,gBAAxB;AACA,OAAOC,SAAP,MAAsB,sBAAtB;AACA,SAASC,2BAAT,QAA4C,0BAA5C;;;;IAiBqBC,c;;;;;;;;;;;;;;;;;;;;;;;;;WAInB,wBAAsB;AACpB,iBAaI,KAAKC,KAAL,CAAWC,cAAX,EAbJ;AAAA,8BACEC,OADF;AAAA,UACEA,OADF,6BACY,CADZ;AAAA,gCAEEC,SAFF;AAAA,UAEEA,SAFF,+BAEc,eAFd;AAAA,kCAGEC,WAHF;AAAA,UAGEA,WAHF,iCAGgB,iBAHhB;AAAA,kCAIEC,WAJF;AAAA,UAIEA,WAJF,iCAIgB,eAJhB;AAAA,2BAKEC,IALF;AAAA,UAKEA,IALF,0BAKS,CALT;AAAA,4BAMEC,KANF;AAAA,UAMEA,KANF,2BAMU;AACNC,QAAAA,MAAM,EAAE,KADF;AAENC,QAAAA,WAAW,EAAE,CAFP;AAGNC,QAAAA,UAAU,EAAE,oBAHN;AAINC,QAAAA,UAAU,EAAE,GAJN;AAKNC,QAAAA,WAAW,EAAE,KAAKC;AALZ,OANV;;AAcA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H,UAAAA,IAAI,EAAE,MADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAEnE,EAAE,CAAC8E,YAFJ;AAGNT,YAAAA,IAAI,EAAE,EAHA;AAINN,YAAAA,IAAI,EAAE/D,EAAE,CAACsE;AAJH,WAFE;AAQVC,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAQL,IAAR,GAAiBE,OAAjB,CAAQF,IAAR;AACA,mBAAO,CAACI,MAAM,CAAC,CAAD,CAAP,EAAYA,MAAM,CAAC,CAAD,CAAlB,CAAP;AACD;AAjBS;AAHoC,OAAlD;AAuBD;;;;EAnJyCzE,S;;SAAvBE,c","sourcesContent":["import { AttributeType, gl, IEncodeFeature, IModel } from '@antv/l7-core';\nimport { rgb2arr } from '@antv/l7-utils';\nimport BaseModel from '../../core/BaseModel';\nimport { PolygonExtrudeTriangulation } from '../../core/triangulation';\nimport buildFrag from '../shaders/build_frag.glsl';\nimport buildVert from '../shaders/build_vert.glsl';\ninterface ICityBuildLayerStyleOptions {\n opacity: number;\n baseColor: string;\n brightColor: string;\n windowColor: string;\n time: number;\n sweep: {\n enable: boolean;\n sweepRadius: number;\n sweepColor: string;\n sweepSpeed: number;\n sweepCenter?: [number, number];\n };\n}\nexport default class CityBuildModel extends BaseModel {\n private cityCenter: [number, number];\n private cityMinSize: number;\n\n public getUninforms() {\n const {\n opacity = 1,\n baseColor = 'rgb(16,16,16)',\n brightColor = 'rgb(255,176,38)',\n windowColor = 'rgb(30,60,89)',\n time = 0,\n sweep = {\n enable: false,\n sweepRadius: 1,\n sweepColor: 'rgb(255, 255, 255)',\n sweepSpeed: 0.4,\n sweepCenter: this.cityCenter,\n },\n } = this.layer.getLayerConfig() as ICityBuildLayerStyleOptions;\n return {\n u_cityCenter: sweep.sweepCenter || this.cityCenter,\n u_cityMinSize: this.cityMinSize * sweep.sweepRadius,\n u_circleSweep: sweep.enable ? 1.0 : 0.0,\n u_circleSweepColor: rgb2arr(sweep.sweepColor).slice(0, 3),\n u_circleSweepSpeed: sweep.sweepSpeed,\n\n u_opacity: opacity,\n u_baseColor: rgb2arr(baseColor),\n u_brightColor: rgb2arr(brightColor),\n u_windowColor: rgb2arr(windowColor),\n u_time: this.layer.getLayerAnimateTime() || time,\n };\n }\n\n public calCityGeo() {\n // @ts-ignore\n const [minLng, minLat, maxLng, maxLat] = this.layer.getSource().extent;\n if (this.mapService.version === 'GAODE2.x') {\n // @ts-ignore\n this.cityCenter = this.mapService.lngLatToCoord([\n (maxLng + minLng) / 2,\n (maxLat + minLat) / 2,\n ]);\n // @ts-ignore\n const l1 = this.mapService.lngLatToCoord([maxLng, maxLat]);\n // @ts-ignore\n const l2 = this.mapService.lngLatToCoord([minLng, minLat]);\n this.cityMinSize =\n Math.sqrt(Math.pow(l1[0] - l2[0], 2) + Math.pow(l1[1] - l2[1], 2)) / 4;\n } else {\n const w = maxLng - minLng;\n const h = maxLat - minLat;\n this.cityCenter = [(maxLng + minLng) / 2, (maxLat + minLat) / 2];\n this.cityMinSize = Math.sqrt(Math.pow(w, 2) + Math.pow(h, 2)) / 4;\n }\n }\n\n public initModels(): IModel[] {\n this.calCityGeo();\n\n this.startModelAnimate();\n return [\n this.layer.buildLayerModel({\n moduleName: 'cityBuilding',\n vertexShader: buildVert,\n fragmentShader: buildFrag,\n triangulation: PolygonExtrudeTriangulation,\n cull: {\n enable: true,\n face: gl.BACK,\n },\n }),\n ];\n }\n\n protected registerBuiltinAttributes() {\n // point layer size;\n this.styleAttributeService.registerStyleAttribute({\n name: 'normal',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Normal',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 3,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n normal: number[],\n ) => {\n return normal;\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'size',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Size',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 10 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Uv',\n buffer: {\n // give the WebGL driver a hint that this buffer may change\n usage: gl.DYNAMIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size } = feature;\n return [vertex[3], vertex[4]];\n },\n },\n });\n }\n}\n"],"file":"build.js"}
@@ -181,7 +181,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}> extends EventEmitter
181
181
  y: number;
182
182
  }): void;
183
183
  boxSelect(box: [number, number, number, number], cb: (...args: any[]) => void): void;
184
- buildLayerModel(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): Promise<IModel>;
184
+ buildLayerModel(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): IModel;
185
185
  createAttrubutes(options: ILayerModelInitializationOptions & Partial<IModelInitializationOptions>): any;
186
186
  getTime(): number;
187
187
  setAnimateStartTime(): void;
@@ -14,7 +14,7 @@ import _isUndefined from "lodash/isUndefined";
14
14
  import _isObject from "lodash/isObject";
15
15
  import _isFunction from "lodash/isFunction";
16
16
  var _excluded = ["passes"],
17
- _excluded2 = ["moduleName", "vertexShader", "fragmentShader", "triangulation", "segmentNumber", "workerEnabled", "workerOptions"];
17
+ _excluded2 = ["moduleName", "vertexShader", "fragmentShader", "triangulation", "segmentNumber"];
18
18
 
19
19
  var _dec, _class, _descriptor;
20
20
 
@@ -37,7 +37,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
37
37
  import { SyncBailHook, SyncHook, SyncWaterfallHook } from '@antv/async-hook';
38
38
  import { BlendType, lazyInject, TYPES } from '@antv/l7-core';
39
39
  import Source from '@antv/l7-source';
40
- import { encodePickingColor, WorkerSourceMap } from '@antv/l7-utils';
40
+ import { encodePickingColor } from '@antv/l7-utils';
41
41
  import { EventEmitter } from 'eventemitter3';
42
42
  import { BlendTypes } from '../utils/blend';
43
43
  import { handleStyleDataMapping } from '../utils/dataMappingStyle';
@@ -198,10 +198,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
198
198
  _defineProperty(_assertThisInitialized(_this), "sourceEvent", function () {
199
199
  _this.dataState.dataSourceNeedUpdate = true;
200
200
 
201
- var layerConfig = _this.getLayerConfig();
201
+ var _this$getLayerConfig = _this.getLayerConfig(),
202
+ autoFit = _this$getLayerConfig.autoFit,
203
+ fitBoundsOptions = _this$getLayerConfig.fitBoundsOptions;
202
204
 
203
- if (layerConfig && layerConfig.autoFit) {
204
- _this.fitBounds(layerConfig.fitBoundsOptions);
205
+ if (autoFit) {
206
+ _this.fitBounds(fitBoundsOptions);
205
207
  }
206
208
 
207
209
  _this.reRender();
@@ -302,9 +304,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
302
304
  this.pickingService = this.container.get(TYPES.IPickingService);
303
305
  this.mapService = this.container.get(TYPES.IMapService);
304
306
 
305
- var _this$getLayerConfig = this.getLayerConfig(),
306
- enableMultiPassRenderer = _this$getLayerConfig.enableMultiPassRenderer,
307
- passes = _this$getLayerConfig.passes;
307
+ var _this$getLayerConfig2 = this.getLayerConfig(),
308
+ enableMultiPassRenderer = _this$getLayerConfig2.enableMultiPassRenderer,
309
+ passes = _this$getLayerConfig2.passes;
308
310
 
309
311
  if (enableMultiPassRenderer && passes !== null && passes !== void 0 && passes.length && passes.length > 0) {
310
312
  this.mapService.on('mapAfterFrameChange', function () {
@@ -413,8 +415,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
413
415
  this.inited = true;
414
416
  this.updateLayerConfig(_objectSpread(_objectSpread({}, this.getDefaultConfig()), this.rawConfig));
415
417
 
416
- var _this$getLayerConfig2 = this.getLayerConfig(),
417
- animateOption = _this$getLayerConfig2.animateOption;
418
+ var _this$getLayerConfig3 = this.getLayerConfig(),
419
+ animateOption = _this$getLayerConfig3.animateOption;
418
420
 
419
421
  if (animateOption !== null && animateOption !== void 0 && animateOption.enable) {
420
422
  this.layerService.startAnimate();
@@ -565,9 +567,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
565
567
 
566
568
  if (lastConfig && lastConfig.mask === true && options.mask === false) {
567
569
  this.clearModels();
568
- this.layerModel.buildModels(function (models) {
569
- _this5.models = models;
570
- });
570
+ this.models = this.layerModel.buildModels();
571
571
  }
572
572
 
573
573
  return this;
@@ -598,7 +598,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
598
598
  return this;
599
599
  }
600
600
 
601
- if (this.getEncodedData() && this.getEncodedData().length !== 0) {
601
+ if (this.getEncodedData().length !== 0) {
602
602
  this.renderModels();
603
603
  }
604
604
 
@@ -612,7 +612,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
612
612
  while (1) {
613
613
  switch (_context.prev = _context.next) {
614
614
  case 0:
615
- if (!(this.getEncodedData() && this.getEncodedData().length !== 0)) {
615
+ if (!(this.getEncodedData().length !== 0)) {
616
616
  _context.next = 7;
617
617
  break;
618
618
  }
@@ -823,12 +823,12 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
823
823
  value: function isVisible() {
824
824
  var zoom = this.mapService.getZoom();
825
825
 
826
- var _this$getLayerConfig3 = this.getLayerConfig(),
827
- visible = _this$getLayerConfig3.visible,
828
- _this$getLayerConfig4 = _this$getLayerConfig3.minZoom,
829
- minZoom = _this$getLayerConfig4 === void 0 ? -Infinity : _this$getLayerConfig4,
830
- _this$getLayerConfig5 = _this$getLayerConfig3.maxZoom,
831
- maxZoom = _this$getLayerConfig5 === void 0 ? Infinity : _this$getLayerConfig5;
826
+ var _this$getLayerConfig4 = this.getLayerConfig(),
827
+ visible = _this$getLayerConfig4.visible,
828
+ _this$getLayerConfig5 = _this$getLayerConfig4.minZoom,
829
+ minZoom = _this$getLayerConfig5 === void 0 ? -Infinity : _this$getLayerConfig5,
830
+ _this$getLayerConfig6 = _this$getLayerConfig4.maxZoom,
831
+ maxZoom = _this$getLayerConfig6 === void 0 ? Infinity : _this$getLayerConfig6;
832
832
 
833
833
  return !!visible && zoom >= minZoom && zoom <= maxZoom;
834
834
  }
@@ -846,9 +846,9 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
846
846
  }
847
847
 
848
848
  if (enableMultiPass) {
849
- var _this$getLayerConfig6 = this.getLayerConfig(),
850
- _this$getLayerConfig7 = _this$getLayerConfig6.passes,
851
- passes = _this$getLayerConfig7 === void 0 ? [] : _this$getLayerConfig7;
849
+ var _this$getLayerConfig7 = this.getLayerConfig(),
850
+ _this$getLayerConfig8 = _this$getLayerConfig7.passes,
851
+ passes = _this$getLayerConfig8 === void 0 ? [] : _this$getLayerConfig8;
852
852
 
853
853
  this.multiPassRenderer = createMultiPassRenderer(this, passes, this.postProcessingPassFactory, this.normalPassFactory);
854
854
  this.multiPassRenderer.setRenderFlag(true);
@@ -873,16 +873,16 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
873
873
  }, {
874
874
  key: "getMinZoom",
875
875
  value: function getMinZoom() {
876
- var _this$getLayerConfig8 = this.getLayerConfig(),
877
- minZoom = _this$getLayerConfig8.minZoom;
876
+ var _this$getLayerConfig9 = this.getLayerConfig(),
877
+ minZoom = _this$getLayerConfig9.minZoom;
878
878
 
879
879
  return minZoom;
880
880
  }
881
881
  }, {
882
882
  key: "getMaxZoom",
883
883
  value: function getMaxZoom() {
884
- var _this$getLayerConfig9 = this.getLayerConfig(),
885
- maxZoom = _this$getLayerConfig9.maxZoom;
884
+ var _this$getLayerConfig10 = this.getLayerConfig(),
885
+ maxZoom = _this$getLayerConfig10.maxZoom;
886
886
 
887
887
  return maxZoom;
888
888
  }
@@ -951,7 +951,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
951
951
  });
952
952
  this.masks = [];
953
953
  this.hooks.beforeDestroy.call();
954
- this.layerSource.off('sourceUpdate', this.sourceEvent);
954
+ this.layerSource.off('update', this.sourceEvent);
955
955
  this.multiPassRenderer.destroy();
956
956
  this.styleAttributeService.clearAllAttributes();
957
957
  this.hooks.afterDestroy.call();
@@ -977,12 +977,10 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
977
977
  }, {
978
978
  key: "clearModels",
979
979
  value: function clearModels() {
980
- var _this$layerModel2;
981
-
982
980
  this.models.forEach(function (model) {
983
981
  return model.destroy();
984
982
  });
985
- (_this$layerModel2 = this.layerModel) === null || _this$layerModel2 === void 0 ? void 0 : _this$layerModel2.clearModels();
983
+ this.layerModel.clearModels();
986
984
  this.models = [];
987
985
  }
988
986
  }, {
@@ -995,10 +993,8 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
995
993
  }, {
996
994
  key: "setSource",
997
995
  value: function setSource(source) {
998
- var _this8 = this;
999
-
1000
996
  if (this.layerSource) {
1001
- this.layerSource.off('sourceUpdate', this.sourceEvent);
997
+ this.layerSource.off('update', this.sourceEvent);
1002
998
  }
1003
999
 
1004
1000
  this.layerSource = source;
@@ -1009,13 +1005,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
1009
1005
  this.layerSource.updateClusterData(zoom);
1010
1006
  }
1011
1007
 
1012
- if (this.layerSource.inited) {
1013
- this.sourceEvent();
1014
- }
1015
-
1016
- this.layerSource.on('sourceUpdate', function () {
1017
- _this8.sourceEvent();
1018
- });
1008
+ this.layerSource.on('update', this.sourceEvent);
1019
1009
  }
1020
1010
  }, {
1021
1011
  key: "getSource",
@@ -1098,16 +1088,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
1098
1088
  }, {
1099
1089
  key: "buildLayerModel",
1100
1090
  value: function buildLayerModel(options) {
1101
- var _this9 = this;
1102
-
1103
1091
  var moduleName = options.moduleName,
1104
1092
  vertexShader = options.vertexShader,
1105
1093
  fragmentShader = options.fragmentShader,
1106
1094
  triangulation = options.triangulation,
1107
1095
  segmentNumber = options.segmentNumber,
1108
- _options$workerEnable = options.workerEnabled,
1109
- workerEnabled = _options$workerEnable === void 0 ? false : _options$workerEnable,
1110
- workerOptions = options.workerOptions,
1111
1096
  rest = _objectWithoutProperties(options, _excluded2);
1112
1097
 
1113
1098
  this.shaderModuleService.registerModule(moduleName, {
@@ -1121,47 +1106,27 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
1121
1106
  uniforms = _this$shaderModuleSer.uniforms;
1122
1107
 
1123
1108
  var createModel = this.rendererService.createModel;
1124
- return new Promise(function (resolve, reject) {
1125
- if (workerOptions && workerOptions.modelType in WorkerSourceMap && workerEnabled) {
1126
- _this9.styleAttributeService.createAttributesAndIndicesAscy(_this9.encodedData, segmentNumber, workerOptions).then(function (_ref6) {
1127
- var attributes = _ref6.attributes,
1128
- elements = _ref6.elements;
1129
- var m = createModel(_objectSpread({
1130
- attributes: attributes,
1131
- uniforms: uniforms,
1132
- fs: fs,
1133
- vs: vs,
1134
- elements: elements,
1135
- blend: BlendTypes[BlendType.normal]
1136
- }, rest));
1137
- resolve(m);
1138
- }).catch(function (err) {
1139
- return reject(err);
1140
- });
1141
- } else {
1142
- var _this9$styleAttribute = _this9.styleAttributeService.createAttributesAndIndices(_this9.encodedData, triangulation, segmentNumber),
1143
- attributes = _this9$styleAttribute.attributes,
1144
- elements = _this9$styleAttribute.elements;
1145
-
1146
- var m = createModel(_objectSpread({
1147
- attributes: attributes,
1148
- uniforms: uniforms,
1149
- fs: fs,
1150
- vs: vs,
1151
- elements: elements,
1152
- blend: BlendTypes[BlendType.normal]
1153
- }, rest));
1154
- resolve(m);
1155
- }
1156
- });
1109
+
1110
+ var _this$styleAttributeS4 = this.styleAttributeService.createAttributesAndIndices(this.encodedData, triangulation, segmentNumber),
1111
+ attributes = _this$styleAttributeS4.attributes,
1112
+ elements = _this$styleAttributeS4.elements;
1113
+
1114
+ return createModel(_objectSpread({
1115
+ attributes: attributes,
1116
+ uniforms: uniforms,
1117
+ fs: fs,
1118
+ vs: vs,
1119
+ elements: elements,
1120
+ blend: BlendTypes[BlendType.normal]
1121
+ }, rest));
1157
1122
  }
1158
1123
  }, {
1159
1124
  key: "createAttrubutes",
1160
1125
  value: function createAttrubutes(options) {
1161
1126
  var triangulation = options.triangulation;
1162
1127
 
1163
- var _this$styleAttributeS4 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
1164
- attributes = _this$styleAttributeS4.attributes;
1128
+ var _this$styleAttributeS5 = this.styleAttributeService.createAttributes(this.encodedData, triangulation),
1129
+ attributes = _this$styleAttributeS5.attributes;
1165
1130
 
1166
1131
  return attributes;
1167
1132
  }
@@ -1196,11 +1161,11 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
1196
1161
  }, {
1197
1162
  key: "needPick",
1198
1163
  value: function needPick(type) {
1199
- var _this$getLayerConfig10 = this.getLayerConfig(),
1200
- _this$getLayerConfig11 = _this$getLayerConfig10.enableHighlight,
1201
- enableHighlight = _this$getLayerConfig11 === void 0 ? true : _this$getLayerConfig11,
1202
- _this$getLayerConfig12 = _this$getLayerConfig10.enableSelect,
1203
- enableSelect = _this$getLayerConfig12 === void 0 ? true : _this$getLayerConfig12;
1164
+ var _this$getLayerConfig11 = this.getLayerConfig(),
1165
+ _this$getLayerConfig12 = _this$getLayerConfig11.enableHighlight,
1166
+ enableHighlight = _this$getLayerConfig12 === void 0 ? true : _this$getLayerConfig12,
1167
+ _this$getLayerConfig13 = _this$getLayerConfig11.enableSelect,
1168
+ enableSelect = _this$getLayerConfig13 === void 0 ? true : _this$getLayerConfig13;
1204
1169
 
1205
1170
  var isPick = this.eventNames().indexOf(type) !== -1 || this.eventNames().indexOf('un' + type) !== -1;
1206
1171
 
@@ -1252,17 +1217,13 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
1252
1217
  }, {
1253
1218
  key: "renderModels",
1254
1219
  value: function renderModels(isPicking) {
1255
- var _this10 = this;
1220
+ var _this8 = this;
1256
1221
 
1257
- if (this.getEncodedData() && this.getEncodedData().length > 0) {
1222
+ if (this.getEncodedData().length > 0) {
1258
1223
  if (this.layerModelNeedUpdate && this.layerModel) {
1259
- this.layerModel.buildModels(function (models) {
1260
- _this10.models = models;
1261
-
1262
- _this10.hooks.beforeRender.call();
1263
-
1264
- _this10.layerModelNeedUpdate = false;
1265
- });
1224
+ this.models = this.layerModel.buildModels();
1225
+ this.hooks.beforeRender.call();
1226
+ this.layerModelNeedUpdate = false;
1266
1227
  }
1267
1228
 
1268
1229
  if (this.layerModel.renderUpdate) {
@@ -1271,7 +1232,7 @@ var BaseLayer = (_dec = lazyInject(TYPES.IGlobalConfigService), (_class = functi
1271
1232
 
1272
1233
  this.models.forEach(function (model) {
1273
1234
  model.draw({
1274
- uniforms: _this10.layerModel.getUninforms()
1235
+ uniforms: _this8.layerModel.getUninforms()
1275
1236
  }, isPicking);
1276
1237
  });
1277
1238
  }