@antv/l7-layers 2.9.17 → 2.9.20

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 (360) hide show
  1. package/es/Geometry/index.js +12 -2
  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 +11 -6
  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 +12 -7
  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 +11 -6
  11. package/es/Geometry/models/sprite.js.map +1 -1
  12. package/es/canvas/index.js +12 -2
  13. package/es/canvas/index.js.map +1 -1
  14. package/es/citybuliding/building.js +12 -2
  15. package/es/citybuliding/building.js.map +1 -1
  16. package/es/citybuliding/models/build.d.ts +2 -1
  17. package/es/citybuliding/models/build.js +16 -3
  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 +105 -62
  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 +2 -0
  26. package/es/core/interface.js.map +1 -1
  27. package/es/core/triangulation.d.ts +1 -0
  28. package/es/core/triangulation.js +37 -11
  29. package/es/core/triangulation.js.map +1 -1
  30. package/es/earth/index.js +8 -2
  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 +11 -6
  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 +11 -6
  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 +11 -6
  40. package/es/earth/models/bloomsphere.js.map +1 -1
  41. package/es/heatmap/index.js +17 -5
  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 +12 -8
  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 +12 -6
  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 +112 -62
  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 +11 -6
  54. package/es/heatmap/models/hexagon.js.map +1 -1
  55. package/es/image/index.js +12 -2
  56. package/es/image/index.js.map +1 -1
  57. package/es/image/models/dataImage.d.ts +3 -3
  58. package/es/image/models/dataImage.js +10 -5
  59. package/es/image/models/dataImage.js.map +1 -1
  60. package/es/image/models/image.d.ts +3 -3
  61. package/es/image/models/image.js +11 -7
  62. package/es/image/models/image.js.map +1 -1
  63. package/es/line/index.d.ts +0 -2
  64. package/es/line/index.js +12 -5
  65. package/es/line/index.js.map +1 -1
  66. package/es/line/models/arc.d.ts +2 -2
  67. package/es/line/models/arc.js +15 -10
  68. package/es/line/models/arc.js.map +1 -1
  69. package/es/line/models/arc_3d.d.ts +2 -2
  70. package/es/line/models/arc_3d.js +13 -8
  71. package/es/line/models/arc_3d.js.map +1 -1
  72. package/es/line/models/earthArc_3d.d.ts +2 -2
  73. package/es/line/models/earthArc_3d.js +17 -9
  74. package/es/line/models/earthArc_3d.js.map +1 -1
  75. package/es/line/models/great_circle.d.ts +2 -2
  76. package/es/line/models/great_circle.js +12 -7
  77. package/es/line/models/great_circle.js.map +1 -1
  78. package/es/line/models/half.d.ts +2 -2
  79. package/es/line/models/half.js +46 -29
  80. package/es/line/models/half.js.map +1 -1
  81. package/es/line/models/index.d.ts +1 -1
  82. package/es/line/models/index.js +0 -2
  83. package/es/line/models/index.js.map +1 -1
  84. package/es/line/models/line.d.ts +2 -2
  85. package/es/line/models/line.js +28 -16
  86. package/es/line/models/line.js.map +1 -1
  87. package/es/line/models/linearline.d.ts +2 -11
  88. package/es/line/models/linearline.js +14 -24
  89. package/es/line/models/linearline.js.map +1 -1
  90. package/es/line/models/simpleLine.d.ts +2 -2
  91. package/es/line/models/simpleLine.js +13 -8
  92. package/es/line/models/simpleLine.js.map +1 -1
  93. package/es/line/models/tile.d.ts +2 -11
  94. package/es/line/models/tile.js +45 -39
  95. package/es/line/models/tile.js.map +1 -1
  96. package/es/line/models/wall.d.ts +2 -2
  97. package/es/line/models/wall.js +13 -9
  98. package/es/line/models/wall.js.map +1 -1
  99. package/es/mask/index.js +12 -2
  100. package/es/mask/index.js.map +1 -1
  101. package/es/mask/models/fill.d.ts +2 -2
  102. package/es/mask/models/fill.js +53 -27
  103. package/es/mask/models/fill.js.map +1 -1
  104. package/es/plugins/DataMappingPlugin.js +29 -8
  105. package/es/plugins/DataMappingPlugin.js.map +1 -1
  106. package/es/plugins/DataSourcePlugin.js +14 -5
  107. package/es/plugins/DataSourcePlugin.js.map +1 -1
  108. package/es/plugins/LayerModelPlugin.d.ts +2 -0
  109. package/es/plugins/LayerModelPlugin.js +35 -7
  110. package/es/plugins/LayerModelPlugin.js.map +1 -1
  111. package/es/plugins/PixelPickingPlugin.js +16 -13
  112. package/es/plugins/PixelPickingPlugin.js.map +1 -1
  113. package/es/point/index.d.ts +1 -1
  114. package/es/point/index.js +26 -15
  115. package/es/point/index.js.map +1 -1
  116. package/es/point/models/earthExtrude.d.ts +2 -2
  117. package/es/point/models/earthExtrude.js +16 -14
  118. package/es/point/models/earthExtrude.js.map +1 -1
  119. package/es/point/models/earthFill.d.ts +2 -11
  120. package/es/point/models/earthFill.js +13 -22
  121. package/es/point/models/earthFill.js.map +1 -1
  122. package/es/point/models/extrude.d.ts +2 -2
  123. package/es/point/models/extrude.js +49 -27
  124. package/es/point/models/extrude.js.map +1 -1
  125. package/es/point/models/fill.d.ts +2 -2
  126. package/es/point/models/fill.js +59 -41
  127. package/es/point/models/fill.js.map +1 -1
  128. package/es/point/models/fillmage.d.ts +2 -7
  129. package/es/point/models/fillmage.js +13 -22
  130. package/es/point/models/fillmage.js.map +1 -1
  131. package/es/point/models/image.d.ts +2 -2
  132. package/es/point/models/image.js +11 -6
  133. package/es/point/models/image.js.map +1 -1
  134. package/es/point/models/index.d.ts +1 -1
  135. package/es/point/models/index.js +0 -2
  136. package/es/point/models/index.js.map +1 -1
  137. package/es/point/models/normal.d.ts +2 -2
  138. package/es/point/models/normal.js +11 -6
  139. package/es/point/models/normal.js.map +1 -1
  140. package/es/point/models/radar.d.ts +2 -11
  141. package/es/point/models/radar.js +13 -22
  142. package/es/point/models/radar.js.map +1 -1
  143. package/es/point/models/simplePoint.d.ts +2 -2
  144. package/es/point/models/simplePoint.js +11 -6
  145. package/es/point/models/simplePoint.js.map +1 -1
  146. package/es/point/models/text.d.ts +3 -2
  147. package/es/point/models/text.js +110 -75
  148. package/es/point/models/text.js.map +1 -1
  149. package/es/point/models/tile.d.ts +2 -11
  150. package/es/point/models/tile.js +22 -25
  151. package/es/point/models/tile.js.map +1 -1
  152. package/es/polygon/index.js +12 -2
  153. package/es/polygon/index.js.map +1 -1
  154. package/es/polygon/models/extrude.d.ts +2 -2
  155. package/es/polygon/models/extrude.js +10 -5
  156. package/es/polygon/models/extrude.js.map +1 -1
  157. package/es/polygon/models/fill.d.ts +2 -2
  158. package/es/polygon/models/fill.js +27 -13
  159. package/es/polygon/models/fill.js.map +1 -1
  160. package/es/polygon/models/ocean.d.ts +2 -2
  161. package/es/polygon/models/ocean.js +12 -6
  162. package/es/polygon/models/ocean.js.map +1 -1
  163. package/es/polygon/models/tile.d.ts +2 -3
  164. package/es/polygon/models/tile.js +17 -27
  165. package/es/polygon/models/tile.js.map +1 -1
  166. package/es/polygon/models/water.d.ts +2 -2
  167. package/es/polygon/models/water.js +12 -6
  168. package/es/polygon/models/water.js.map +1 -1
  169. package/es/raster/index.js +12 -2
  170. package/es/raster/index.js.map +1 -1
  171. package/es/raster/models/raster.d.ts +3 -3
  172. package/es/raster/models/raster.js +11 -7
  173. package/es/raster/models/raster.js.map +1 -1
  174. package/es/tile/manager/tileLayerManager.js +3 -0
  175. package/es/tile/manager/tileLayerManager.js.map +1 -1
  176. package/es/tile/manager/tilePickerManager.js +1 -0
  177. package/es/tile/manager/tilePickerManager.js.map +1 -1
  178. package/es/tile/tileFactory/base.js.map +1 -1
  179. package/es/tile/tileFactory/point.js.map +1 -1
  180. package/es/tile/tileFactory/rasterDataLayer.js +12 -2
  181. package/es/tile/tileFactory/rasterDataLayer.js.map +1 -1
  182. package/es/tile/tileFactory/vectorLayer.js +12 -2
  183. package/es/tile/tileFactory/vectorLayer.js.map +1 -1
  184. package/es/utils/extrude_polyline.d.ts +15 -0
  185. package/es/utils/extrude_polyline.js +146 -14
  186. package/es/utils/extrude_polyline.js.map +1 -1
  187. package/es/wind/index.js +12 -2
  188. package/es/wind/index.js.map +1 -1
  189. package/es/wind/models/wind.d.ts +4 -2
  190. package/es/wind/models/wind.js +50 -18
  191. package/es/wind/models/wind.js.map +1 -1
  192. package/es/wind/models/windRender.js +1 -1
  193. package/es/wind/models/windRender.js.map +1 -1
  194. package/lib/Geometry/index.js +12 -2
  195. package/lib/Geometry/index.js.map +1 -1
  196. package/lib/Geometry/models/billboard.js +11 -6
  197. package/lib/Geometry/models/billboard.js.map +1 -1
  198. package/lib/Geometry/models/plane.js +12 -7
  199. package/lib/Geometry/models/plane.js.map +1 -1
  200. package/lib/Geometry/models/sprite.js +11 -6
  201. package/lib/Geometry/models/sprite.js.map +1 -1
  202. package/lib/canvas/index.js +12 -2
  203. package/lib/canvas/index.js.map +1 -1
  204. package/lib/citybuliding/building.js +12 -2
  205. package/lib/citybuliding/building.js.map +1 -1
  206. package/lib/citybuliding/models/build.js +16 -3
  207. package/lib/citybuliding/models/build.js.map +1 -1
  208. package/lib/core/BaseLayer.js +104 -61
  209. package/lib/core/BaseLayer.js.map +1 -1
  210. package/lib/core/BaseModel.js +2 -2
  211. package/lib/core/BaseModel.js.map +1 -1
  212. package/lib/core/interface.js.map +1 -1
  213. package/lib/core/triangulation.js +40 -16
  214. package/lib/core/triangulation.js.map +1 -1
  215. package/lib/earth/index.js +8 -2
  216. package/lib/earth/index.js.map +1 -1
  217. package/lib/earth/models/atmosphere.js +11 -6
  218. package/lib/earth/models/atmosphere.js.map +1 -1
  219. package/lib/earth/models/base.js +11 -6
  220. package/lib/earth/models/base.js.map +1 -1
  221. package/lib/earth/models/bloomsphere.js +11 -6
  222. package/lib/earth/models/bloomsphere.js.map +1 -1
  223. package/lib/heatmap/index.js +17 -5
  224. package/lib/heatmap/index.js.map +1 -1
  225. package/lib/heatmap/models/grid.js +12 -8
  226. package/lib/heatmap/models/grid.js.map +1 -1
  227. package/lib/heatmap/models/grid3d.js +12 -6
  228. package/lib/heatmap/models/grid3d.js.map +1 -1
  229. package/lib/heatmap/models/heatmap.js +113 -62
  230. package/lib/heatmap/models/heatmap.js.map +1 -1
  231. package/lib/heatmap/models/hexagon.js +11 -6
  232. package/lib/heatmap/models/hexagon.js.map +1 -1
  233. package/lib/image/index.js +12 -2
  234. package/lib/image/index.js.map +1 -1
  235. package/lib/image/models/dataImage.js +10 -5
  236. package/lib/image/models/dataImage.js.map +1 -1
  237. package/lib/image/models/image.js +11 -7
  238. package/lib/image/models/image.js.map +1 -1
  239. package/lib/line/index.js +12 -5
  240. package/lib/line/index.js.map +1 -1
  241. package/lib/line/models/arc.js +15 -10
  242. package/lib/line/models/arc.js.map +1 -1
  243. package/lib/line/models/arc_3d.js +13 -8
  244. package/lib/line/models/arc_3d.js.map +1 -1
  245. package/lib/line/models/earthArc_3d.js +17 -9
  246. package/lib/line/models/earthArc_3d.js.map +1 -1
  247. package/lib/line/models/great_circle.js +12 -7
  248. package/lib/line/models/great_circle.js.map +1 -1
  249. package/lib/line/models/half.js +48 -29
  250. package/lib/line/models/half.js.map +1 -1
  251. package/lib/line/models/index.js +0 -3
  252. package/lib/line/models/index.js.map +1 -1
  253. package/lib/line/models/line.js +29 -18
  254. package/lib/line/models/line.js.map +1 -1
  255. package/lib/line/models/linearline.js +14 -24
  256. package/lib/line/models/linearline.js.map +1 -1
  257. package/lib/line/models/simpleLine.js +13 -8
  258. package/lib/line/models/simpleLine.js.map +1 -1
  259. package/lib/line/models/tile.js +47 -39
  260. package/lib/line/models/tile.js.map +1 -1
  261. package/lib/line/models/wall.js +13 -9
  262. package/lib/line/models/wall.js.map +1 -1
  263. package/lib/mask/index.js +12 -2
  264. package/lib/mask/index.js.map +1 -1
  265. package/lib/mask/models/fill.js +55 -27
  266. package/lib/mask/models/fill.js.map +1 -1
  267. package/lib/plugins/DataMappingPlugin.js +29 -8
  268. package/lib/plugins/DataMappingPlugin.js.map +1 -1
  269. package/lib/plugins/DataSourcePlugin.js +13 -4
  270. package/lib/plugins/DataSourcePlugin.js.map +1 -1
  271. package/lib/plugins/LayerModelPlugin.js +35 -7
  272. package/lib/plugins/LayerModelPlugin.js.map +1 -1
  273. package/lib/plugins/PixelPickingPlugin.js +16 -13
  274. package/lib/plugins/PixelPickingPlugin.js.map +1 -1
  275. package/lib/point/index.js +26 -15
  276. package/lib/point/index.js.map +1 -1
  277. package/lib/point/models/earthExtrude.js +16 -15
  278. package/lib/point/models/earthExtrude.js.map +1 -1
  279. package/lib/point/models/earthFill.js +13 -22
  280. package/lib/point/models/earthFill.js.map +1 -1
  281. package/lib/point/models/extrude.js +51 -28
  282. package/lib/point/models/extrude.js.map +1 -1
  283. package/lib/point/models/fill.js +61 -42
  284. package/lib/point/models/fill.js.map +1 -1
  285. package/lib/point/models/fillmage.js +13 -22
  286. package/lib/point/models/fillmage.js.map +1 -1
  287. package/lib/point/models/image.js +11 -6
  288. package/lib/point/models/image.js.map +1 -1
  289. package/lib/point/models/index.js +0 -3
  290. package/lib/point/models/index.js.map +1 -1
  291. package/lib/point/models/normal.js +11 -6
  292. package/lib/point/models/normal.js.map +1 -1
  293. package/lib/point/models/radar.js +13 -22
  294. package/lib/point/models/radar.js.map +1 -1
  295. package/lib/point/models/simplePoint.js +11 -6
  296. package/lib/point/models/simplePoint.js.map +1 -1
  297. package/lib/point/models/text.js +112 -78
  298. package/lib/point/models/text.js.map +1 -1
  299. package/lib/point/models/tile.js +22 -25
  300. package/lib/point/models/tile.js.map +1 -1
  301. package/lib/polygon/index.js +12 -2
  302. package/lib/polygon/index.js.map +1 -1
  303. package/lib/polygon/models/extrude.js +10 -5
  304. package/lib/polygon/models/extrude.js.map +1 -1
  305. package/lib/polygon/models/fill.js +25 -11
  306. package/lib/polygon/models/fill.js.map +1 -1
  307. package/lib/polygon/models/ocean.js +12 -6
  308. package/lib/polygon/models/ocean.js.map +1 -1
  309. package/lib/polygon/models/tile.js +17 -27
  310. package/lib/polygon/models/tile.js.map +1 -1
  311. package/lib/polygon/models/water.js +12 -6
  312. package/lib/polygon/models/water.js.map +1 -1
  313. package/lib/raster/index.js +12 -2
  314. package/lib/raster/index.js.map +1 -1
  315. package/lib/raster/models/raster.js +11 -7
  316. package/lib/raster/models/raster.js.map +1 -1
  317. package/lib/tile/manager/tileLayerManager.js +3 -0
  318. package/lib/tile/manager/tileLayerManager.js.map +1 -1
  319. package/lib/tile/manager/tilePickerManager.js +1 -0
  320. package/lib/tile/manager/tilePickerManager.js.map +1 -1
  321. package/lib/tile/tileFactory/base.js.map +1 -1
  322. package/lib/tile/tileFactory/point.js.map +1 -1
  323. package/lib/tile/tileFactory/rasterDataLayer.js +12 -2
  324. package/lib/tile/tileFactory/rasterDataLayer.js.map +1 -1
  325. package/lib/tile/tileFactory/vectorLayer.js +12 -2
  326. package/lib/tile/tileFactory/vectorLayer.js.map +1 -1
  327. package/lib/utils/extrude_polyline.js +148 -14
  328. package/lib/utils/extrude_polyline.js.map +1 -1
  329. package/lib/wind/index.js +12 -2
  330. package/lib/wind/index.js.map +1 -1
  331. package/lib/wind/models/wind.js +49 -18
  332. package/lib/wind/models/wind.js.map +1 -1
  333. package/lib/wind/models/windRender.js +1 -1
  334. package/lib/wind/models/windRender.js.map +1 -1
  335. package/package.json +9 -8
  336. package/es/line/models/arcmini.d.ts +0 -9
  337. package/es/line/models/arcmini.js +0 -145
  338. package/es/line/models/arcmini.js.map +0 -1
  339. package/es/point/models/icon-font.d.ts +0 -11
  340. package/es/point/models/icon-font.js +0 -181
  341. package/es/point/models/icon-font.js.map +0 -1
  342. package/es/raster/image.d.ts +0 -0
  343. package/es/raster/image.js +0 -2
  344. package/es/raster/image.js.map +0 -1
  345. package/es/raster/raster2d.d.ts +0 -27
  346. package/es/raster/raster2d.js +0 -158
  347. package/es/raster/raster2d.js.map +0 -1
  348. package/es/utils/geo.d.ts +0 -12
  349. package/es/utils/geo.js +0 -53
  350. package/es/utils/geo.js.map +0 -1
  351. package/lib/line/models/arcmini.js +0 -161
  352. package/lib/line/models/arcmini.js.map +0 -1
  353. package/lib/point/models/icon-font.js +0 -196
  354. package/lib/point/models/icon-font.js.map +0 -1
  355. package/lib/raster/image.js +0 -2
  356. package/lib/raster/image.js.map +0 -1
  357. package/lib/raster/raster2d.js +0 -172
  358. package/lib/raster/raster2d.js.map +0 -1
  359. package/lib/utils/geo.js +0 -65
  360. package/lib/utils/geo.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/line/models/arc_3d.ts"],"names":["lineStyleObj","solid","dash","Arc3DModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","gl","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","globalArcHeight","length","push","useLinearColor","sourceColorArr","targetColorArr","getDirty","bind","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_globel","mapService","version","u_globel_radius","EARTH_RADIUS","u_global_height","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","updateTexture","on","buildModels","destroy","off","frag","arc3d_linear_frag","vert","arc3d_linear_vert","arc3d_line_frag","arc3d_line_vert","mask","maskInside","getShaders","buildLayerModel","moduleName","vertexShader","fragmentShader","triangulation","LineArcTriangulation","blend","getBlend","stencil","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AAEA;;AAEA;;AACA;;;;;;;;;;AAQA,IAAMA,YAAuC,GAAG;AAC9CC,EAAAA,KAAK,EAAE,GADuC;AAE9CC,EAAAA,IAAI,EAAE;AAFwC,CAAhD;;IAIqBC,U;;;;;;;;;;;;;;;;gGAoOK,YAAM;AAC5B,UAAQC,eAAR,GAA4B,MAAKC,eAAjC,CAAQD,eAAR;;AACA,UAAI,MAAKE,OAAT,EAAkB;AAChB,cAAKA,OAAL,CAAaC,MAAb,CAAoB;AAClBC,UAAAA,IAAI,EAAE,MAAKC,WAAL,CAAiBC,SAAjB;AADY,SAApB;;AAGA,cAAKC,KAAL,CAAWC,MAAX;;AACA;AACD;;AACD,YAAKN,OAAL,GAAeF,eAAe,CAAC;AAC7BI,QAAAA,IAAI,EAAE,MAAKC,WAAL,CAAiBC,SAAjB,EADuB;AAE7BG,QAAAA,GAAG,EAAEC,WAAGC,OAFqB;AAG7BC,QAAAA,GAAG,EAAEF,WAAGC,OAHqB;AAI7BE,QAAAA,gBAAgB,EAAE,KAJW;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YAJM,EAKH;AACH,mBAAO,CAACD,MAAM,CAAC,CAAD,CAAP,EAAYA,MAAM,CAAC,CAAD,CAAlB,EAAuBA,MAAM,CAAC,CAAD,CAA7B,EAAkCA,MAAM,CAAC,CAAD,CAAxC,CAAP;AACD;AAfS;AAHoC,OAAlD;AAsBA,WAAKZ,qBAAL,CAA2BC,sBAA3B,CAAkD;AAChDC,QAAAA,IAAI,EAAE,IAD0C;AAEhDpD,QAAAA,IAAI,EAAEqD,sBAAcC,SAF4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,aADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAE/F,WAAGgG,YAFJ;AAGNtG,YAAAA,IAAI,EAAE,EAHA;AAIN4C,YAAAA,IAAI,EAAEtC,WAAGuC;AAJH,WAFE;AAQV0D,UAAAA,IAAI,EAAE,CARI;AASVxG,UAAAA,MAAM,EAAE,gBACNyG,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAMI,OAAO,GAAG,MAAI,CAAC9G,WAAL,CAAiB+G,UAAjB,EAAhB;;AACA,gBAAQlH,OAAR,GAAoB0G,OAApB,CAAQ1G,OAAR;;AACA,wBAAiBiH,OAAO,CAACjH,OAAD,CAAP,IAA8B;AAAEmH,cAAAA,CAAC,EAAE,CAAL;AAAQC,cAAAA,CAAC,EAAE;AAAX,aAA/C;AAAA,gBAAQD,CAAR,SAAQA,CAAR;AAAA,gBAAWC,CAAX,SAAWA,CAAX;;AACA,mBAAO,CAACD,CAAD,EAAIC,CAAJ,CAAP;AACD;AAnBS;AAHoC,OAAlD;AAyBD;;;EAlOqCC,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IAnimateOption,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\nimport { EARTH_RADIUS } from '../../earth/utils';\n// arc3d line layer\nimport arc3d_line_frag from '../shaders/line_arc_3d_frag.glsl';\nimport arc3d_line_vert from '../shaders/line_arc_3d_vert.glsl';\n// arc3d linear layer\nimport arc3d_linear_frag from '../shaders/linear/arc3d_linear_frag.glsl';\nimport arc3d_linear_vert from '../shaders/linear/arc3d_linear_vert.glsl';\n\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\nexport default class Arc3DModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n globalArcHeight = 10,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_globel: this.mapService.version === 'GLOBEL' ? 1 : 0,\n u_globel_radius: EARTH_RADIUS, // 地球半径\n u_global_height: globalArcHeight,\n\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(): IModel[] {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n return this.buildModels();\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public getShaders(): { frag: string; vert: string; type: string } {\n const {\n sourceColor,\n targetColor,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (sourceColor && targetColor) {\n // 分离 linear 功能\n return {\n frag: arc3d_linear_frag,\n vert: arc3d_linear_vert,\n type: 'linear',\n };\n } else {\n return {\n frag: arc3d_line_frag,\n vert: arc3d_line_vert,\n type: 'normal',\n };\n }\n }\n\n public buildModels(): IModel[] {\n const {\n segmentNumber = 30,\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n const { frag, vert, type } = this.getShaders();\n return [\n this.layer.buildLayerModel({\n moduleName: 'arc3Dline' + type,\n vertexShader: vert,\n fragmentShader: frag,\n triangulation: LineArcTriangulation,\n blend: this.getBlend(),\n segmentNumber,\n // primitive: gl.POINTS,\n stencil: getMask(mask, maskInside),\n }),\n ];\n }\n protected registerBuiltinAttributes() {\n // point layer size;\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 = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\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 iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"arc_3d.js"}
1
+ {"version":3,"sources":["../../../src/line/models/arc_3d.ts"],"names":["lineStyleObj","solid","dash","Arc3DModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","gl","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","globalArcHeight","length","push","useLinearColor","sourceColorArr","targetColorArr","getDirty","bind","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_globel","mapService","version","u_globel_radius","EARTH_RADIUS","u_global_height","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","callbackModel","updateTexture","on","buildModels","destroy","off","frag","arc3d_linear_frag","vert","arc3d_linear_vert","arc3d_line_frag","arc3d_line_vert","mask","maskInside","getShaders","buildLayerModel","moduleName","vertexShader","fragmentShader","triangulation","LineArcTriangulation","blend","getBlend","stencil","then","model","catch","err","console","warn","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AAEA;;AAEA;;AACA;;;;;;;;;;AAQA,IAAMA,YAAuC,GAAG;AAC9CC,EAAAA,KAAK,EAAE,GADuC;AAE9CC,EAAAA,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E,EAHA;AAIN4C,YAAAA,IAAI,EAAEtC,WAAGuC;AAJH,WAFE;AAQViE,UAAAA,IAAI,EAAE,CARI;AASV/G,UAAAA,MAAM,EAAE,gBACNgH,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAMI,OAAO,GAAG,MAAI,CAACrH,WAAL,CAAiBsH,UAAjB,EAAhB;;AACA,gBAAQzH,OAAR,GAAoBiH,OAApB,CAAQjH,OAAR;;AACA,wBAAiBwH,OAAO,CAACxH,OAAD,CAAP,IAA8B;AAAE0H,cAAAA,CAAC,EAAE,CAAL;AAAQC,cAAAA,CAAC,EAAE;AAAX,aAA/C;AAAA,gBAAQD,CAAR,SAAQA,CAAR;AAAA,gBAAWC,CAAX,SAAWA,CAAX;;AACA,mBAAO,CAACD,CAAD,EAAIC,CAAJ,CAAP;AACD;AAnBS;AAHoC,OAAlD;AAyBD;;;EAxOqCC,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IAnimateOption,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\nimport { EARTH_RADIUS } from '../../earth/utils';\n// arc3d line layer\nimport arc3d_line_frag from '../shaders/line_arc_3d_frag.glsl';\nimport arc3d_line_vert from '../shaders/line_arc_3d_vert.glsl';\n// arc3d linear layer\nimport arc3d_linear_frag from '../shaders/linear/arc3d_linear_frag.glsl';\nimport arc3d_linear_vert from '../shaders/linear/arc3d_linear_vert.glsl';\n\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\nexport default class Arc3DModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n globalArcHeight = 10,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_globel: this.mapService.version === 'GLOBEL' ? 1 : 0,\n u_globel_radius: EARTH_RADIUS, // 地球半径\n u_global_height: globalArcHeight,\n\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(callbackModel: (models: IModel[]) => void) {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n this.buildModels(callbackModel);\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public getShaders(): { frag: string; vert: string; type: string } {\n const {\n sourceColor,\n targetColor,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (sourceColor && targetColor) {\n // 分离 linear 功能\n return {\n frag: arc3d_linear_frag,\n vert: arc3d_linear_vert,\n type: 'Linear',\n };\n } else {\n return {\n frag: arc3d_line_frag,\n vert: arc3d_line_vert,\n type: '',\n };\n }\n }\n\n public buildModels(callbackModel: (models: IModel[]) => void) {\n const {\n segmentNumber = 30,\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n const { frag, vert, type } = this.getShaders();\n\n this.layer\n .buildLayerModel({\n moduleName: 'lineArc3d' + type,\n vertexShader: vert,\n fragmentShader: frag,\n triangulation: LineArcTriangulation,\n blend: this.getBlend(),\n segmentNumber,\n stencil: getMask(mask, maskInside),\n })\n .then((model) => {\n callbackModel([model]);\n })\n .catch((err) => {\n console.warn(err);\n callbackModel([]);\n });\n }\n protected registerBuiltinAttributes() {\n // point layer size;\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 = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\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 iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"arc_3d.js"}
@@ -160,7 +160,7 @@ var Arc3DModel = function (_BaseModel) {
160
160
  }
161
161
 
162
162
  return {
163
- u_globel: this.mapService.version === 'GLOBEL' ? 1 : 0,
163
+ u_globel: 1,
164
164
  u_globel_radius: _utils.EARTH_RADIUS,
165
165
  u_global_height: globalArcHeight,
166
166
  u_dataTexture: this.dataTexture,
@@ -192,10 +192,10 @@ var Arc3DModel = function (_BaseModel) {
192
192
  }
193
193
  }, {
194
194
  key: "initModels",
195
- value: function initModels() {
195
+ value: function initModels(callbackModel) {
196
196
  this.updateTexture();
197
197
  this.iconService.on('imageUpdate', this.updateTexture);
198
- return this.buildModels();
198
+ this.buildModels(callbackModel);
199
199
  }
200
200
  }, {
201
201
  key: "clearModels",
@@ -217,19 +217,19 @@ var Arc3DModel = function (_BaseModel) {
217
217
  return {
218
218
  frag: arc3d_linear_frag,
219
219
  vert: arc3d_linear_vert,
220
- type: 'linear'
220
+ type: 'Linear'
221
221
  };
222
222
  } else {
223
223
  return {
224
224
  frag: arc3d_line_frag,
225
225
  vert: arc3d_line_vert,
226
- type: 'normal'
226
+ type: ''
227
227
  };
228
228
  }
229
229
  }
230
230
  }, {
231
231
  key: "buildModels",
232
- value: function buildModels() {
232
+ value: function buildModels(callbackModel) {
233
233
  var _ref4 = this.layer.getLayerConfig(),
234
234
  _ref4$segmentNumber = _ref4.segmentNumber,
235
235
  segmentNumber = _ref4$segmentNumber === void 0 ? 30 : _ref4$segmentNumber,
@@ -243,15 +243,23 @@ var Arc3DModel = function (_BaseModel) {
243
243
  vert = _this$getShaders.vert,
244
244
  type = _this$getShaders.type;
245
245
 
246
- return [this.layer.buildLayerModel({
247
- moduleName: 'arc3Dline' + type,
246
+ this.layer.buildLayerModel({
247
+ moduleName: 'lineEarthArc3d' + type,
248
248
  vertexShader: vert,
249
249
  fragmentShader: frag,
250
250
  triangulation: _triangulation.LineArcTriangulation,
251
+ depth: {
252
+ enable: true
253
+ },
251
254
  blend: this.getBlend(),
252
255
  segmentNumber: segmentNumber,
253
256
  stencil: (0, _l7Utils.getMask)(mask, maskInside)
254
- })];
257
+ }).then(function (model) {
258
+ callbackModel([model]);
259
+ }).catch(function (err) {
260
+ console.warn(err);
261
+ callbackModel([]);
262
+ });
255
263
  }
256
264
  }, {
257
265
  key: "registerBuiltinAttributes",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/line/models/earthArc_3d.ts"],"names":["lineStyleObj","solid","dash","Arc3DModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","gl","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","globalArcHeight","length","push","useLinearColor","sourceColorArr","targetColorArr","getDirty","bind","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_globel","mapService","version","u_globel_radius","EARTH_RADIUS","u_global_height","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","updateTexture","on","buildModels","destroy","off","frag","arc3d_linear_frag","vert","arc3d_linear_vert","arc3d_line_frag","arc3d_line_vert","mask","maskInside","getShaders","buildLayerModel","moduleName","vertexShader","fragmentShader","triangulation","LineArcTriangulation","blend","getBlend","stencil","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AAEA;;AAEA;;AACA;;;;;;;;;;AAQA,IAAMA,YAAuC,GAAG;AAC9CC,EAAAA,KAAK,EAAE,GADuC;AAE9CC,EAAAA,IAAI,EAAE;AAFwC,CAAhD;;IAIqBC,U;;;;;;;;;;;;;;;;gGAoOK,YAAM;AAC5B,UAAQC,eAAR,GAA4B,MAAKC,eAAjC,CAAQD,eAAR;;AACA,UAAI,MAAKE,OAAT,EAAkB;AAChB,cAAKA,OAAL,CAAaC,MAAb,CAAoB;AAClBC,UAAAA,IAAI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R;AAAA,gBAAWC,CAAX,SAAWA,CAAX;;AACA,mBAAO,CAACD,CAAD,EAAIC,CAAJ,CAAP;AACD;AAnBS;AAHoC,OAAlD;AAyBD;;;EAlOqCC,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IAnimateOption,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\nimport { EARTH_RADIUS } from '../../earth/utils';\n// arc3d line layer\nimport arc3d_line_frag from '../shaders/line_arc_3d_frag.glsl';\nimport arc3d_line_vert from '../shaders/line_arc_3d_vert.glsl';\n// arc3d linear layer\nimport arc3d_linear_frag from '../shaders/linear/arc3d_linear_frag.glsl';\nimport arc3d_linear_vert from '../shaders/linear/arc3d_linear_vert.glsl';\n\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\nexport default class Arc3DModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n globalArcHeight = 10,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_globel: this.mapService.version === 'GLOBEL' ? 1 : 0,\n u_globel_radius: EARTH_RADIUS, // 地球半径\n u_global_height: globalArcHeight,\n\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(): IModel[] {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n return this.buildModels();\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public getShaders(): { frag: string; vert: string; type: string } {\n const {\n sourceColor,\n targetColor,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (sourceColor && targetColor) {\n // 分离 linear 功能\n return {\n frag: arc3d_linear_frag,\n vert: arc3d_linear_vert,\n type: 'linear',\n };\n } else {\n return {\n frag: arc3d_line_frag,\n vert: arc3d_line_vert,\n type: 'normal',\n };\n }\n }\n\n public buildModels(): IModel[] {\n const {\n segmentNumber = 30,\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n const { frag, vert, type } = this.getShaders();\n return [\n this.layer.buildLayerModel({\n moduleName: 'arc3Dline' + type,\n vertexShader: vert,\n fragmentShader: frag,\n triangulation: LineArcTriangulation,\n blend: this.getBlend(),\n segmentNumber,\n // primitive: gl.POINTS,\n stencil: getMask(mask, maskInside),\n }),\n ];\n }\n protected registerBuiltinAttributes() {\n // point layer size;\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 = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\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 iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"earthArc_3d.js"}
1
+ {"version":3,"sources":["../../../src/line/models/earthArc_3d.ts"],"names":["lineStyleObj","solid","dash","Arc3DModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","gl","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","globalArcHeight","length","push","useLinearColor","sourceColorArr","targetColorArr","getDirty","bind","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_globel","u_globel_radius","EARTH_RADIUS","u_global_height","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","callbackModel","updateTexture","on","buildModels","destroy","off","frag","arc3d_linear_frag","vert","arc3d_linear_vert","arc3d_line_frag","arc3d_line_vert","mask","maskInside","getShaders","buildLayerModel","moduleName","vertexShader","fragmentShader","triangulation","LineArcTriangulation","depth","enable","blend","getBlend","stencil","then","model","catch","err","console","warn","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AAEA;;AAEA;;AACA;;;;;;;;;;AAQA,IAAMA,YAAuC,GAAG;AAC9CC,EAAAA,KAAK,EAAE,GADuC;AAE9CC,EAAAA,IAAI,EAAE;AAFwC,CAAhD;;IAIqBC,U;;;;;;;;;;;;;;;;gGA0OK,YAAM;AAC5B,UAAQC,eAAR,GAA4B,MAAKC,eAAjC,CAAQD,eAAR;;AACA,UAAI,MAAKE,OAAT,EAAkB;AAChB,cAAKA,OAAL,CAAaC,MAAb,CAAoB;AAClBC,UAAAA,IAAI,EAAE,MAAKC,WAAL,CAAiBC,SAAjB;AADY,SAApB;;AAGA,cAAKC,KAAL,CAAWC,MAAX;;AACA;AACD;;AACD,YAAKN,OAAL,GAAeF,eAAe,CAAC;AAC7BI,QAAAA,IAAI,EAAE,MAAKC,WAAL,CAAiBC,SAAjB,EADuB;AAE7BG,QAAAA,GAAG,EAAEC,WAAGC,OAFqB;AAG7BC,QAAAA,GAAG,EAAEF,WAAGC,OAHqB;AAI7BE,QAAAA,gBAAgB,EAAE,KAJW;AAK7BC,QAAAA,KAAK,EAAE,IALsB;AAM7BC,QAAAA,MAAM,EAAE,MAAKV,WAAL,CAAiBW,YAAjB,IAAiC;AANZ,OAAD,CAA9B;AAQD,K;;;;;;WAzPD,wBAAqC;AACnC,iBAWI,KAAKT,KAAL,CAAWU,cAAX,EAXJ;AAAA,8BACEC,OADF;AAAA,UACEA,OADF,6BACY,CADZ;AAAA,UAEEC,WAFF,QAEEA,WAFF;AAAA,UAGEC,WAHF,QAGEA,WAHF;AAAA,mCAIEC,YAJF;AAAA,UAIEA,YAJF,kCAIiB,QAJjB;AAAA,+BAKEC,QALF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AD,CAAxC,CAAP;AACD;AAfS;AAHoC,OAAlD;AAsBA,WAAKZ,qBAAL,CAA2BC,sBAA3B,CAAkD;AAChDC,QAAAA,IAAI,EAAE,IAD0C;AAEhD3D,QAAAA,IAAI,EAAE4D,sBAAcC,SAF4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,aADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAEtG,WAAGuG,YAFJ;AAGN7G,YAAAA,IAAI,EAAE,EAHA;AAIN4C,YAAAA,IAAI,EAAEtC,WAAGuC;AAJH,WAFE;AAQViE,UAAAA,IAAI,EAAE,CARI;AASV/G,UAAAA,MAAM,EAAE,gBACNgH,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAMI,OAAO,GAAG,MAAI,CAACrH,WAAL,CAAiBsH,UAAjB,EAAhB;;AACA,gBAAQzH,OAAR,GAAoBiH,OAApB,CAAQjH,OAAR;;AACA,wBAAiBwH,OAAO,CAACxH,OAAD,CAAP,IAA8B;AAAE0H,cAAAA,CAAC,EAAE,CAAL;AAAQC,cAAAA,CAAC,EAAE;AAAX,aAA/C;AAAA,gBAAQD,CAAR,SAAQA,CAAR;AAAA,gBAAWC,CAAX,SAAWA,CAAX;;AACA,mBAAO,CAACD,CAAD,EAAIC,CAAJ,CAAP;AACD;AAnBS;AAHoC,OAAlD;AAyBD;;;EAxOqCC,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IAnimateOption,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\nimport { EARTH_RADIUS } from '../../earth/utils';\n// arc3d line layer\nimport arc3d_line_frag from '../shaders/line_arc_3d_frag.glsl';\nimport arc3d_line_vert from '../shaders/line_arc_3d_vert.glsl';\n// arc3d linear layer\nimport arc3d_linear_frag from '../shaders/linear/arc3d_linear_frag.glsl';\nimport arc3d_linear_vert from '../shaders/linear/arc3d_linear_vert.glsl';\n\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\nexport default class Arc3DModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n globalArcHeight = 10,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_globel: 1,\n u_globel_radius: EARTH_RADIUS, // 地球半径\n u_global_height: globalArcHeight,\n\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(callbackModel: (models: IModel[]) => void) {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n this.buildModels(callbackModel);\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public getShaders(): { frag: string; vert: string; type: string } {\n const {\n sourceColor,\n targetColor,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n if (sourceColor && targetColor) {\n // 分离 linear 功能\n return {\n frag: arc3d_linear_frag,\n vert: arc3d_linear_vert,\n type: 'Linear',\n };\n } else {\n return {\n frag: arc3d_line_frag,\n vert: arc3d_line_vert,\n type: '',\n };\n }\n }\n\n public buildModels(callbackModel: (models: IModel[]) => void) {\n const {\n segmentNumber = 30,\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n const { frag, vert, type } = this.getShaders();\n this.layer\n .buildLayerModel({\n moduleName: 'lineEarthArc3d' + type,\n vertexShader: vert,\n fragmentShader: frag,\n triangulation: LineArcTriangulation,\n depth: { enable: true },\n blend: this.getBlend(),\n segmentNumber,\n stencil: getMask(mask, maskInside),\n })\n .then((model) => {\n callbackModel([model]);\n })\n .catch((err) => {\n console.warn(err);\n callbackModel([]);\n });\n }\n protected registerBuiltinAttributes() {\n // point layer size;\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 = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\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 iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"earthArc_3d.js"}
@@ -35,7 +35,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
35
35
 
36
36
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
37
 
38
- var line_arc_frag = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_opacity;\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float segmentNumber;\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nvarying mat4 styleMappingMat;\n\n#pragma include \"picking\"\n#pragma include \"project\"\n#pragma include \"projection\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float animateSpeed = 0.0;\n float d_segmentIndex = styleMappingMat[3].g;\n \n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n // \u5B9E\u7EBF\u90E8\u5206\n } else {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n }\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F\n if(u_aimate.x == Animate) {\n animateSpeed = u_time / u_aimate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { \n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = styleMappingMat[3].b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_aimate.x == Animate) {\n u = gl_FragColor.a/opacity;\n }\n\n float v = styleMappingMat[3].a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n \n // \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}";
38
+ var line_arc_frag = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nuniform float u_opacity;\nuniform float u_textureBlend;\nuniform float u_blur : 0.9;\nuniform float u_line_type: 0.0;\n// varying vec2 v_normal;\nvarying vec4 v_dash_array;\nvarying float v_distance_ratio;\nvarying vec4 v_color;\n\nuniform float u_time;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\n\nuniform float u_line_texture: 0.0;\nuniform sampler2D u_texture;\nuniform vec2 u_textSize;\nuniform float segmentNumber;\n\nvarying vec2 v_iconMapUV;\n\nuniform float u_linearColor: 0;\nuniform vec4 u_sourceColor;\nuniform vec4 u_targetColor;\n\nvarying mat4 styleMappingMat;\n\n#pragma include \"picking\"\n#pragma include \"project\"\n#pragma include \"projection\"\n\nvoid main() {\n float opacity = styleMappingMat[0][0];\n float animateSpeed = 0.0;\n float d_segmentIndex = styleMappingMat[3].g;\n \n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u5E95\u8272\n if(u_linearColor == 1.0) { // \u4F7F\u7528\u6E10\u53D8\u989C\u8272\n gl_FragColor = mix(u_sourceColor, u_targetColor, d_segmentIndex/segmentNumber);\n } else { // \u4F7F\u7528 color \u65B9\u6CD5\u4F20\u5165\u7684\u989C\u8272\n gl_FragColor = v_color;\n }\n\n // float blur = 1.- smoothstep(u_blur, 1., length(v_normal.xy));\n // float blur = smoothstep(1.0, u_blur, length(v_normal.xy));\n gl_FragColor.a *= opacity;\n if(u_line_type == LineTypeDash) {\n float dashLength = mod(v_distance_ratio, v_dash_array.x + v_dash_array.y + v_dash_array.z + v_dash_array.w);\n if(dashLength < v_dash_array.x || (dashLength > (v_dash_array.x + v_dash_array.y) && dashLength < v_dash_array.x + v_dash_array.y + v_dash_array.z)) {\n // \u5B9E\u7EBF\u90E8\u5206\n } else {\n // \u865A\u7EBF\u90E8\u5206\n discard;\n };\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u52A8\u753B\u6A21\u5F0F\n if(u_aimate.x == Animate) {\n animateSpeed = u_time / u_aimate.y;\n float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);\n alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;\n alpha = smoothstep(0., 1., alpha);\n gl_FragColor.a *= alpha;\n }\n\n // \u8BBE\u7F6E\u5F27\u7EBF\u7684\u8D34\u56FE\n if(LineTexture == u_line_texture && u_line_type != LineTypeDash) { \n float arcRadio = smoothstep( 0.0, 1.0, (d_segmentIndex / (segmentNumber - 1.0)));\n // float arcRadio = d_segmentIndex / (segmentNumber - 1.0);\n float count = styleMappingMat[3].b; // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n float u = fract(arcRadio * count - animateSpeed * count);\n // float u = fract(arcRadio * count - animateSpeed);\n if(u_aimate.x == Animate) {\n u = gl_FragColor.a/opacity;\n }\n\n float v = styleMappingMat[3].a; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;\n vec4 pattern = texture2D(u_texture, uv);\n \n // \u8BBE\u7F6E\u8D34\u56FE\u548C\u5E95\u8272\u7684\u53E0\u52A0\u6A21\u5F0F\n if(u_textureBlend == 0.0) { // normal\n pattern.a = 0.0;\n gl_FragColor = filterColor(gl_FragColor + pattern);\n } else { // replace\n pattern.a *= opacity;\n if(gl_FragColor.a <= 0.0) {\n pattern.a = 0.0;\n }\n gl_FragColor = filterColor(pattern);\n }\n } else {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n // gl_FragColor = filterColor(gl_FragColor);\n}";
39
39
  var line_arc2d_vert = "#define LineTypeSolid 0.0\n#define LineTypeDash 1.0\n#define Animate 0.0\n#define LineTexture 1.0\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec4 a_Instance;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float segmentNumber;\nuniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];\nvarying vec4 v_color;\n// varying vec2 v_normal;\n\nvarying float v_distance_ratio;\nuniform float u_line_type: 0.0;\nuniform vec4 u_dash_array: [10.0, 5., 0, 0];\nvarying vec4 v_dash_array;\n\nuniform float u_icon_step: 100;\nuniform float u_line_texture: 0.0;\n\nattribute vec2 a_iconMapUV;\nvarying vec2 v_iconMapUV;\n\nuniform float u_opacity: 1.0;\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nfloat maps (float value, float start1, float stop1, float start2, float stop2) {\n return start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));\n}\n\nfloat getSegmentRatio(float index) {\n return index / (segmentNumber - 1.);\n}\n\nfloat paraboloid(vec2 source, vec2 target, float ratio) {\n vec2 x = mix(source, target, ratio);\n vec2 center = mix(source, target, 0.5);\n float dSourceCenter = distance(source, center);\n float dXCenter = distance(x, center);\n return (dSourceCenter + dXCenter) * (dSourceCenter - dXCenter);\n}\n\nvec3 getPos(vec2 source, vec2 target, float segmentRatio) {\n float vertex_height = paraboloid(source, target, segmentRatio);\n\n return vec3(\n mix(source, target, segmentRatio),\n sqrt(max(0.0, vertex_height))\n );\n}\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n vec2 offset = dir_screenspace * offset_direction * setPickingSize(a_Size)/ 2.0;\n return offset;\n}\nvec2 getNormal(vec2 line_clipspace, float offset_direction) {\n // normalized direction of the line\n vec2 dir_screenspace = normalize(line_clipspace);\n // rotate by 90 degrees\n dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n return reverse_offset_normal(vec3(dir_screenspace,1.0)).xy * sign(offset_direction);\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 delta = source - target;\n vec2 sin_half_delta = sin(delta / 2.0);\n float a =\n sin_half_delta.y * sin_half_delta.y +\n cos(source.y) * cos(target.y) *\n sin_half_delta.x * sin_half_delta.x;\n return 2.0 * atan(sqrt(a), sqrt(1.0 - a));\n}\n\nvec2 midPoint(vec2 source, vec2 target) {\n vec2 center = target - source;\n float r = length(center);\n float theta = atan(center.y, center.x);\n float thetaOffset = 0.314;\n float r2 = r / 2.0 / cos(thetaOffset);\n float theta2 = theta + thetaOffset;\n vec2 mid = vec2(r2*cos(theta2) + source.x, r2*sin(theta2) + source.y);\n return mid;\n}\nfloat bezier3(vec3 arr, float t) {\n float ut = 1. - t;\n return (arr.x * ut + arr.y * t) * ut + (arr.y * ut + arr.z * t) * t;\n}\n\nvec2 interpolate (vec2 source, vec2 target, float angularDist, float t) {\n // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n vec2 mid = midPoint(source, target);\n vec3 x = vec3(source.x, mid.x, target.x);\n vec3 y = vec3(source.y, mid.y, target.y);\n return vec2(bezier3(x ,t), bezier3(y,t));\n }else {\n if(abs(angularDist - PI) < 0.001) {\n return (1.0 - t) * source + t * target;\n }\n float a = sin((1.0 - t) * angularDist) / sin(angularDist);\n float b = sin(t * angularDist) / sin(angularDist);\n vec2 sin_source = sin(source);\n vec2 cos_source = cos(source);\n vec2 sin_target = sin(target);\n vec2 cos_target = cos(target);\n float x = a * cos_source.y * cos_source.x + b * cos_target.y * cos_target.x;\n float y = a * cos_source.y * sin_source.x + b * cos_target.y * sin_target.x;\n float z = a * sin_source.y + b * sin_target.y;\n return vec2(atan(y, x), atan(z, sqrt(x * x + y * y)));\n }\n}\n\nvoid main() {\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0 // dataset \u6570\u636E\u96C6\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n\n v_color = a_Color;\n vec2 source = radians(a_Instance.rg);\n vec2 target = radians(a_Instance.ba);\n float angularDist = getAngularDist(source, target);\n float segmentIndex = a_Position.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n\n if(u_line_type == LineTypeDash) {\n v_distance_ratio = segmentIndex / segmentNumber;\n vec2 s = source;\n vec2 t = target;\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n s = unProjCustomCoord(source);\n t = unProjCustomCoord(target);\n }\n float total_Distance = pixelDistance(s, t) / 2.0 * PI;\n total_Distance = total_Distance*16.0; // total_Distance*16.0 \u8C03\u6574\u9ED8\u8BA4\u7684\u6548\u679C\n v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;\n }\n\n if(u_aimate.x == Animate) {\n v_distance_ratio = segmentIndex / segmentNumber;\n }\n\n float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);\n v_distance_ratio = segmentIndex / segmentNumber;\n vec4 curr = project_position(vec4(degrees(interpolate(source, target, angularDist, segmentRatio)), 0.0, 1.0));\n vec4 next = project_position(vec4(degrees(interpolate(source, target, angularDist, nextSegmentRatio)), 0.0, 1.0));\n // v_normal = getNormal((next.xy - curr.xy) * indexDir, a_Position.y);\n vec2 offset = project_pixel(getExtrusionOffset((next.xy - curr.xy) * indexDir, a_Position.y));\n // vec4 project_pos = project_position(vec4(curr.xy, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n\n styleMappingMat[3].g = a_Position.x; // \u8BE5\u9876\u70B9\u5728\u5F27\u7EBF\u4E0A\u7684\u5206\u6BB5\u6392\u5E8F\n if(LineTexture == u_line_texture) { // \u5F00\u542F\u8D34\u56FE\u6A21\u5F0F \n // float mapZoomScale = u_CoordinateSystem !== COORDINATE_SYSTEM_P20_2?10000000.0:1.0;\n float d_arcDistrance = length(source - target);\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20) { // amap\n d_arcDistrance = d_arcDistrance * 1000000.0;\n }\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) { // mapbox\n d_arcDistrance = project_pixel_allmap(d_arcDistrance);\n }\n float d_pixelLen = project_pixel(u_icon_step)/8.0;\n styleMappingMat[3].b = floor(d_arcDistrance/d_pixelLen); // \u8D34\u56FE\u5728\u5F27\u7EBF\u4E0A\u91CD\u590D\u7684\u6570\u91CF\n\n float lineOffsetWidth = length(offset + offset * sign(a_Position.y)); // \u7EBF\u6A2A\u5411\u504F\u79FB\u7684\u8DDD\u79BB\n float linePixelSize = project_pixel(a_Size); // \u5B9A\u70B9\u4F4D\u7F6E\u504F\u79FB\uFF0C\u6309\u5730\u56FE\u7B49\u7EA7\u7F29\u653E\u540E\u7684\u8DDD\u79BB\n styleMappingMat[3].a = lineOffsetWidth/linePixelSize; // \u7EBF\u56FE\u5C42\u8D34\u56FE\u90E8\u5206\u7684 v \u5750\u6807\u503C\n\n v_iconMapUV = a_iconMapUV;\n }\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(curr.xy + offset, curr.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(curr.xy + offset, curr.z, 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n\n";
40
40
  var lineStyleObj = {
41
41
  solid: 0.0,
@@ -183,10 +183,10 @@ var GreatCircleModel = function (_BaseModel) {
183
183
  }
184
184
  }, {
185
185
  key: "initModels",
186
- value: function initModels() {
186
+ value: function initModels(callbackModel) {
187
187
  this.updateTexture();
188
188
  this.iconService.on('imageUpdate', this.updateTexture);
189
- return this.buildModels();
189
+ this.buildModels(callbackModel);
190
190
  }
191
191
  }, {
192
192
  key: "clearModels",
@@ -199,15 +199,15 @@ var GreatCircleModel = function (_BaseModel) {
199
199
  }
200
200
  }, {
201
201
  key: "buildModels",
202
- value: function buildModels() {
202
+ value: function buildModels(callbackModel) {
203
203
  var _ref3 = this.layer.getLayerConfig(),
204
204
  _ref3$mask = _ref3.mask,
205
205
  mask = _ref3$mask === void 0 ? false : _ref3$mask,
206
206
  _ref3$maskInside = _ref3.maskInside,
207
207
  maskInside = _ref3$maskInside === void 0 ? true : _ref3$maskInside;
208
208
 
209
- return [this.layer.buildLayerModel({
210
- moduleName: 'greatcircleline',
209
+ this.layer.buildLayerModel({
210
+ moduleName: 'lineGreatCircle',
211
211
  vertexShader: line_arc2d_vert,
212
212
  fragmentShader: line_arc_frag,
213
213
  triangulation: _triangulation.LineArcTriangulation,
@@ -216,7 +216,12 @@ var GreatCircleModel = function (_BaseModel) {
216
216
  },
217
217
  blend: this.getBlend(),
218
218
  stencil: (0, _l7Utils.getMask)(mask, maskInside)
219
- })];
219
+ }).then(function (model) {
220
+ callbackModel([model]);
221
+ }).catch(function (err) {
222
+ console.warn(err);
223
+ callbackModel([]);
224
+ });
220
225
  }
221
226
  }, {
222
227
  key: "registerBuiltinAttributes",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/line/models/great_circle.ts"],"names":["lineStyleObj","solid","dash","GreatCircleModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","gl","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","length","push","getDirty","bind","useLinearColor","sourceColorArr","targetColorArr","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","updateTexture","on","buildModels","destroy","off","mask","maskInside","buildLayerModel","moduleName","vertexShader","line_arc2d_vert","fragmentShader","line_arc_frag","triangulation","LineArcTriangulation","depth","enable","blend","getBlend","stencil","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AAEA;;AAEA;;;;;;;;AAGA,IAAMA,YAAuC,GAAG;AAC9CC,EAAAA,KAAK,EAAE,GADuC;AAE9CC,EAAAA,IAAI,EAAE;AAFwC,CAAhD;;IAKqBC,gB;;;;;;;;;;;;;;;;gGAqMK,YAAM;AAC5B,UAAQC,eAAR,GAA4B,MAAKC,eAAjC,CAAQD,eAAR;;AACA,UAAI,MAAKE,OAAT,EAAkB;AAChB,cAAKA,OAAL,CAAaC,MAAb,CAAoB;AAClBC,UAAAA,IAAI,EAAE,MAAKC,WAAL,CAAiBC,SAAjB;AADY,SAApB;;AAGA,cAAKC,KAAL,CAAWC,MAAX;;AACA;AACD;;AACD,YAAKN,OAAL,GAAeF,eAAe,CAAC;AAC7BI,QAAAA,IAAI,EAAE,MAAKC,WAAL,CAAiBC,SAAjB,EADuB;AAE7BG,QAAAA,GAAG,EAAEC,WAAGC,OAFqB;AAG7BC,QAAAA,GAAG,EAAEF,WAAGC,OAHqB;AAI7BE,QAAAA,gBAAgB,E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AAE,CAAL;AAAQC,cAAAA,CAAC,EAAE;AAAX,aAA/C;AAAA,gBAAQD,CAAR,SAAQA,CAAR;AAAA,gBAAWC,CAAX,SAAWA,CAAX;;AACA,mBAAO,CAACD,CAAD,EAAIC,CAAJ,CAAP;AACD;AApBS;AAHoC,OAAlD;AA0BD;;;EAnM2CC,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IAnimateOption,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions, lineStyleType } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\nimport line_arc_frag from '../shaders/line_arc_great_circle_frag.glsl';\nimport line_arc2d_vert from '../shaders/line_arc_great_circle_vert.glsl';\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\n\nexport default class GreatCircleModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n } = this.layer.getLayerConfig() as Partial<ILineLayerStyleOptions>;\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(): IModel[] {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n return this.buildModels();\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public buildModels(): IModel[] {\n const {\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n return [\n this.layer.buildLayerModel({\n moduleName: 'greatcircleline',\n vertexShader: line_arc2d_vert,\n fragmentShader: line_arc_frag,\n triangulation: LineArcTriangulation,\n depth: { enable: false },\n blend: this.getBlend(),\n stencil: getMask(mask, maskInside),\n }),\n ];\n }\n protected registerBuiltinAttributes() {\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 = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\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 iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n // console.log('icon feature', feature)\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"great_circle.js"}
1
+ {"version":3,"sources":["../../../src/line/models/great_circle.ts"],"names":["lineStyleObj","solid","dash","GreatCircleModel","createTexture2D","rendererService","texture","update","data","iconService","getCanvas","layer","render","mag","gl","NEAREST","min","premultiplyAlpha","width","height","canvasHeight","getLayerConfig","opacity","sourceColor","targetColor","textureBlend","lineType","dashArray","lineTexture","iconStep","segmentNumber","length","push","getDirty","bind","useLinearColor","sourceColorArr","targetColorArr","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","rowCount","dataTexture","flipY","format","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_textureBlend","u_line_type","u_dash_array","u_texture","u_line_texture","u_icon_step","u_textSize","u_linearColor","u_sourceColor","u_targetColor","animateOption","u_aimate","animateOption2Array","u_time","getLayerAnimateTime","callbackModel","updateTexture","on","buildModels","destroy","off","mask","maskInside","buildLayerModel","moduleName","vertexShader","line_arc2d_vert","fragmentShader","line_arc_frag","triangulation","LineArcTriangulation","depth","enable","blend","getBlend","stencil","then","model","catch","err","console","warn","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","DYNAMIC_DRAW","size","feature","featureIdx","vertex","attributeIdx","Array","isArray","STATIC_DRAW","iconMap","getIconMap","x","y","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AAEA;;AAEA;;;;;;;;AAGA,IAAMA,YAAuC,GAAG;AAC9CC,EAAAA,KAAK,EAAE,GADuC;AAE9CC,EAAAA,IAAI,EAAE;AAFwC,CAAhD;;IAKqBC,gB;;;;;;;;;;;;;;;;gGA2MK,YAAM;AAC5B,UAAQC,eAAR,GAA4B,MAAKC,eAAjC,CAAQD,eAAR;;AACA,UAAI,MAAKE,OAAT,EAAkB;AAChB,cAAKA,OAAL,CAAaC,MAAb,CAAoB;AAClBC,UAAAA,IAAI,EAAE,MAAKC,WA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AcC,SAF4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,aADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAE5F,WAAG6F,YAFJ;AAGNnG,YAAAA,IAAI,EAAE,EAHA;AAIN2C,YAAAA,IAAI,EAAErC,WAAGsC;AAJH,WAFE;AAQVwD,UAAAA,IAAI,EAAE,CARI;AASVrG,UAAAA,MAAM,EAAE,gBACNsG,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,gBAAMI,OAAO,GAAG,MAAI,CAAC3G,WAAL,CAAiB4G,UAAjB,EAAhB;;AACA,gBAAQ/G,OAAR,GAAoBuG,OAApB,CAAQvG,OAAR;;AAEA,wBAAiB8G,OAAO,CAAC9G,OAAD,CAAP,IAA8B;AAAEgH,cAAAA,CAAC,EAAE,CAAL;AAAQC,cAAAA,CAAC,EAAE;AAAX,aAA/C;AAAA,gBAAQD,CAAR,SAAQA,CAAR;AAAA,gBAAWC,CAAX,SAAWA,CAAX;;AACA,mBAAO,CAACD,CAAD,EAAIC,CAAJ,CAAP;AACD;AApBS;AAHoC,OAAlD;AA0BD;;;EAzM2CC,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IAnimateOption,\n IEncodeFeature,\n ILayerConfig,\n IModel,\n IModelUniform,\n ITexture2D,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions, lineStyleType } from '../../core/interface';\nimport { LineArcTriangulation } from '../../core/triangulation';\nimport line_arc_frag from '../shaders/line_arc_great_circle_frag.glsl';\nimport line_arc2d_vert from '../shaders/line_arc_great_circle_vert.glsl';\nconst lineStyleObj: { [key: string]: number } = {\n solid: 0.0,\n dash: 1.0,\n};\n\nexport default class GreatCircleModel extends BaseModel {\n protected texture: ITexture2D;\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n textureBlend = 'normal',\n lineType = 'solid',\n dashArray = [10, 5],\n lineTexture = false,\n iconStep = 100,\n segmentNumber = 30,\n } = this.layer.getLayerConfig() as Partial<ILineLayerStyleOptions>;\n if (dashArray.length === 2) {\n dashArray.push(0, 0);\n }\n\n if (this.rendererService.getDirty()) {\n this.texture.bind();\n }\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n\n return {\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,\n segmentNumber,\n u_line_type: lineStyleObj[lineType as string] || 0.0,\n u_dash_array: dashArray,\n\n // 纹理支持参数\n u_texture: this.texture, // 贴图\n u_line_texture: lineTexture ? 1.0 : 0.0, // 传入线的标识\n u_icon_step: iconStep,\n u_textSize: [1024, this.iconService.canvasHeight || 128],\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n };\n }\n public getAnimateUniforms(): IModelUniform {\n const { animateOption } = this.layer.getLayerConfig() as ILayerConfig;\n return {\n u_aimate: this.animateOption2Array(animateOption as IAnimateOption),\n u_time: this.layer.getLayerAnimateTime(),\n };\n }\n\n public initModels(callbackModel: (models: IModel[]) => void) {\n this.updateTexture();\n this.iconService.on('imageUpdate', this.updateTexture);\n\n this.buildModels(callbackModel);\n }\n\n public clearModels() {\n this.texture?.destroy();\n this.dataTexture?.destroy();\n this.iconService.off('imageUpdate', this.updateTexture);\n }\n\n public buildModels(callbackModel: (models: IModel[]) => void) {\n const {\n mask = false,\n maskInside = true,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n this.layer\n .buildLayerModel({\n moduleName: 'lineGreatCircle',\n vertexShader: line_arc2d_vert,\n fragmentShader: line_arc_frag,\n triangulation: LineArcTriangulation,\n depth: { enable: false },\n blend: this.getBlend(),\n stencil: getMask(mask, maskInside),\n })\n .then((model) => {\n callbackModel([model]);\n })\n .catch((err) => {\n console.warn(err);\n callbackModel([]);\n });\n }\n protected registerBuiltinAttributes() {\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 = 1 } = feature;\n return Array.isArray(size) ? [size[0]] : [size as number];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'instance', // 弧线起始点信息\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Instance',\n buffer: {\n usage: gl.STATIC_DRAW,\n data: [],\n type: gl.FLOAT,\n },\n size: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[3], vertex[4], vertex[5], vertex[6]];\n },\n },\n });\n\n this.styleAttributeService.registerStyleAttribute({\n name: 'uv',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_iconMapUV',\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 iconMap = this.iconService.getIconMap();\n const { texture } = feature;\n // console.log('icon feature', feature)\n const { x, y } = iconMap[texture as string] || { x: 0, y: 0 };\n return [x, y];\n },\n },\n });\n }\n\n private updateTexture = () => {\n const { createTexture2D } = this.rendererService;\n if (this.texture) {\n this.texture.update({\n data: this.iconService.getCanvas(),\n });\n this.layer.render();\n return;\n }\n this.texture = createTexture2D({\n data: this.iconService.getCanvas(),\n mag: gl.NEAREST,\n min: gl.NEAREST,\n premultiplyAlpha: false,\n width: 1024,\n height: this.iconService.canvasHeight || 128,\n });\n };\n}\n"],"file":"great_circle.js"}
@@ -7,6 +7,10 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = void 0;
9
9
 
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+
10
14
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
15
 
12
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -116,8 +120,8 @@ var LineModel = function (_BaseModel) {
116
120
  }
117
121
  }, {
118
122
  key: "initModels",
119
- value: function initModels() {
120
- return this.buildModels();
123
+ value: function initModels(callbackModel) {
124
+ this.buildModels(callbackModel);
121
125
  }
122
126
  }, {
123
127
  key: "clearModels",
@@ -128,33 +132,48 @@ var LineModel = function (_BaseModel) {
128
132
  }
129
133
  }, {
130
134
  key: "buildModels",
131
- value: function buildModels() {
132
- var _ref2 = this.layer.getLayerConfig(),
133
- _ref2$mask = _ref2.mask,
134
- mask = _ref2$mask === void 0 ? false : _ref2$mask,
135
- _ref2$maskInside = _ref2.maskInside,
136
- maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside,
137
- _ref2$depth = _ref2.depth,
138
- depth = _ref2$depth === void 0 ? false : _ref2$depth;
139
-
140
- var _this$getShaders = this.getShaders(),
141
- frag = _this$getShaders.frag,
142
- vert = _this$getShaders.vert;
143
-
144
- this.layer.triangulation = _triangulation.LineTriangulation;
145
- return [this.layer.buildLayerModel({
146
- moduleName: 'line_half',
147
- vertexShader: vert,
148
- fragmentShader: frag,
149
- triangulation: _triangulation.LineTriangulation,
150
- primitive: _l7Core.gl.TRIANGLES,
151
- blend: this.getBlend(),
152
- depth: {
153
- enable: depth
154
- },
155
- stencil: (0, _l7Utils.getMask)(mask, maskInside)
156
- })];
157
- }
135
+ value: function () {
136
+ var _buildModels = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(callbackModel) {
137
+ var _ref2, _ref2$mask, mask, _ref2$maskInside, maskInside, _ref2$depth, depth, _this$getShaders, frag, vert;
138
+
139
+ return _regenerator.default.wrap(function _callee$(_context) {
140
+ while (1) {
141
+ switch (_context.prev = _context.next) {
142
+ case 0:
143
+ _ref2 = this.layer.getLayerConfig(), _ref2$mask = _ref2.mask, mask = _ref2$mask === void 0 ? false : _ref2$mask, _ref2$maskInside = _ref2.maskInside, maskInside = _ref2$maskInside === void 0 ? true : _ref2$maskInside, _ref2$depth = _ref2.depth, depth = _ref2$depth === void 0 ? false : _ref2$depth;
144
+ _this$getShaders = this.getShaders(), frag = _this$getShaders.frag, vert = _this$getShaders.vert;
145
+ this.layer.triangulation = _triangulation.LineTriangulation;
146
+ this.layer.buildLayerModel({
147
+ moduleName: 'lineHalf',
148
+ vertexShader: vert,
149
+ fragmentShader: frag,
150
+ triangulation: _triangulation.LineTriangulation,
151
+ depth: {
152
+ enable: depth
153
+ },
154
+ blend: this.getBlend(),
155
+ stencil: (0, _l7Utils.getMask)(mask, maskInside)
156
+ }).then(function (model) {
157
+ callbackModel([model]);
158
+ }).catch(function (err) {
159
+ console.warn(err);
160
+ callbackModel([]);
161
+ });
162
+
163
+ case 4:
164
+ case "end":
165
+ return _context.stop();
166
+ }
167
+ }
168
+ }, _callee, this);
169
+ }));
170
+
171
+ function buildModels(_x) {
172
+ return _buildModels.apply(this, arguments);
173
+ }
174
+
175
+ return buildModels;
176
+ }()
158
177
  }, {
159
178
  key: "getShaders",
160
179
  value: function getShaders() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/line/models/half.ts"],"names":["LineModel","layer","getLayerConfig","opacity","sourceColor","targetColor","arrow","enable","arrowWidth","arrowHeight","tailWidth","useLinearColor","sourceColorArr","targetColorArr","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","width","height","rowCount","dataTexture","length","createTexture2D","flipY","format","gl","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_linearColor","u_sourceColor","u_targetColor","u_arrow","Number","u_arrowHeight","u_arrowWidth","u_tailWidth","undefined","buildModels","destroy","mask","maskInside","depth","getShaders","frag","vert","triangulation","LineTriangulation","buildLayerModel","moduleName","vertexShader","fragmentShader","primitive","TRIANGLES","blend","getBlend","stencil","line_half_frag","line_half_vert","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","STATIC_DRAW","size","update","feature","featureIdx","vertex","attributeIdx","normal","vertexIndex","startPoint","coordinates","endPoint","DYNAMIC_DRAW","Array","isArray","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;AAOA;;AAEA;;AAEA;;;;;;;;;IAIqBA,S;;;;;;;;;;;;WACnB,wBAAqC;AACnC,iBAUI,KAAKC,KAAL,CAAWC,cAAX,EAVJ;AAAA,8BACEC,OADF;AAAA,UACEA,OADF,6BACY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kD;AAChDC,QAAAA,IAAI,EAAE,OAD0C;AAEhDtC,QAAAA,IAAI,EAAEuC,sBAAcC,SAF4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,SADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAE7C,WAAG8C,WAFJ;AAGNvD,YAAAA,IAAI,EAAE,EAHA;AAINW,YAAAA,IAAI,EAAEF,WAAGG;AAJH,WAFE;AAQV4C,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,mBAAO,CAACD,MAAM,CAAC,CAAD,CAAP,CAAP;AACD;AAhBS;AAHoC,OAAlD;AAsBD;;;EA9OoCU,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IEncodeFeature,\n IModel,\n IModelUniform,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions } from '../../core/interface';\nimport { LineTriangulation } from '../../core/triangulation';\nimport line_half_frag from '../shaders/half/line_half_frag.glsl';\nimport line_half_vert from '../shaders/half/line_half_vert.glsl';\n\nexport default class LineModel extends BaseModel {\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n arrow = {\n enable: false,\n arrowWidth: 2,\n arrowHeight: 3,\n tailWidth: 1,\n },\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n return {\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n\n // arrow\n u_arrow: Number(arrow.enable),\n u_arrowHeight: arrow.arrowHeight || 3,\n u_arrowWidth: arrow.arrowWidth || 2,\n u_tailWidth: arrow.tailWidth === undefined ? 1 : arrow.tailWidth,\n };\n }\n\n public initModels(): IModel[] {\n return this.buildModels();\n }\n\n public clearModels() {\n this.dataTexture?.destroy();\n }\n\n public buildModels(): IModel[] {\n const {\n mask = false,\n maskInside = true,\n depth = false,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n const { frag, vert } = this.getShaders();\n this.layer.triangulation = LineTriangulation;\n return [\n this.layer.buildLayerModel({\n moduleName: 'line_half',\n vertexShader: vert,\n fragmentShader: frag,\n triangulation: LineTriangulation,\n primitive: gl.TRIANGLES,\n blend: this.getBlend(),\n depth: { enable: depth },\n stencil: getMask(mask, maskInside),\n }),\n ];\n }\n\n /**\n * 根据参数获取不同的 shader 代码\n * @returns\n */\n public getShaders(): { frag: string; vert: string; type: string } {\n return {\n frag: line_half_frag,\n vert: line_half_vert,\n type: 'normal',\n };\n }\n\n protected registerBuiltinAttributes() {\n this.styleAttributeService.registerStyleAttribute({\n name: 'distanceAndIndex',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_DistanceAndIndex',\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 vertexIndex?: number,\n ) => {\n return vertexIndex === undefined\n ? [vertex[3], 10, vertex[5]]\n : [vertex[3], vertexIndex, vertex[5]];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'dirPoints',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_dirPoints',\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: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n // console.log(feature)\n const startPoint = (feature.coordinates[0] || [0, 0]) as number[];\n const endPoint = (feature.coordinates[3] || [0, 0]) as number[];\n\n return [startPoint[0], startPoint[1], endPoint[0], endPoint[1]];\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: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 1 } = feature;\n return Array.isArray(size) ? [size[0], size[1]] : [size as number, 0];\n },\n },\n });\n\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: 'miter',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Miter',\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: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[4]];\n },\n },\n });\n }\n}\n"],"file":"half.js"}
1
+ {"version":3,"sources":["../../../src/line/models/half.ts"],"names":["LineModel","layer","getLayerConfig","opacity","sourceColor","targetColor","arrow","enable","arrowWidth","arrowHeight","tailWidth","useLinearColor","sourceColorArr","targetColorArr","dataTextureTest","dataTextureNeedUpdate","judgeStyleAttributes","encodeData","getEncodedData","calDataFrame","cellLength","cellProperties","data","width","height","rowCount","dataTexture","length","createTexture2D","flipY","format","gl","LUMINANCE","type","FLOAT","u_dataTexture","u_cellTypeLayout","getCellTypeLayout","u_opacity","u_linearColor","u_sourceColor","u_targetColor","u_arrow","Number","u_arrowHeight","u_arrowWidth","u_tailWidth","undefined","callbackModel","buildModels","destroy","mask","maskInside","depth","getShaders","frag","vert","triangulation","LineTriangulation","buildLayerModel","moduleName","vertexShader","fragmentShader","blend","getBlend","stencil","then","model","catch","err","console","warn","line_half_frag","line_half_vert","styleAttributeService","registerStyleAttribute","name","AttributeType","Attribute","descriptor","buffer","usage","STATIC_DRAW","size","update","feature","featureIdx","vertex","attributeIdx","normal","vertexIndex","startPoint","coordinates","endPoint","DYNAMIC_DRAW","Array","isArray","BaseModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAOA;;AAEA;;AAEA;;;;;;;;;IAIqBA,S;;;;;;;;;;;;WACnB,wBAAqC;AACnC,iBAUI,KAAKC,KAAL,CAAWC,cAAX,EAVJ;AAAA,8BACEC,OADF;AAAA,UACEA,OADF,6BACY,CADZ;AAAA,UA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;AAJH,WAFE;AAQViD,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKNC,MALM,EAMH;AACH,mBAAOA,MAAP;AACD;AAjBS;AAHoC,OAAlD;AAwBA,WAAKf,qBAAL,CAA2BC,sBAA3B,CAAkD;AAChDC,QAAAA,IAAI,EAAE,OAD0C;AAEhD3C,QAAAA,IAAI,EAAE4C,sBAAcC,SAF4B;AAGhDC,QAAAA,UAAU,EAAE;AACVH,UAAAA,IAAI,EAAE,SADI;AAEVI,UAAAA,MAAM,EAAE;AAENC,YAAAA,KAAK,EAAElD,WAAGmD,WAFJ;AAGN5D,YAAAA,IAAI,EAAE,EAHA;AAINW,YAAAA,IAAI,EAAEF,WAAGG;AAJH,WAFE;AAQViD,UAAAA,IAAI,EAAE,CARI;AASVC,UAAAA,MAAM,EAAE,gBACNC,OADM,EAENC,UAFM,EAGNC,MAHM,EAINC,YAJM,EAKH;AACH,mBAAO,CAACD,MAAM,CAAC,CAAD,CAAP,CAAP;AACD;AAhBS;AAHoC,OAAlD;AAsBD;;;EApPoCU,mB","sourcesContent":["import {\n AttributeType,\n gl,\n IEncodeFeature,\n IModel,\n IModelUniform,\n} from '@antv/l7-core';\nimport { getMask, rgb2arr } from '@antv/l7-utils';\nimport { isNumber } from 'lodash';\nimport BaseModel from '../../core/BaseModel';\nimport { ILineLayerStyleOptions } from '../../core/interface';\nimport { LineTriangulation } from '../../core/triangulation';\nimport line_half_frag from '../shaders/half/line_half_frag.glsl';\nimport line_half_vert from '../shaders/half/line_half_vert.glsl';\n\nexport default class LineModel extends BaseModel {\n public getUninforms(): IModelUniform {\n const {\n opacity = 1,\n sourceColor,\n targetColor,\n arrow = {\n enable: false,\n arrowWidth: 2,\n arrowHeight: 3,\n tailWidth: 1,\n },\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n\n // 转化渐变色\n let useLinearColor = 0; // 默认不生效\n let sourceColorArr = [0, 0, 0, 0];\n let targetColorArr = [0, 0, 0, 0];\n if (sourceColor && targetColor) {\n sourceColorArr = rgb2arr(sourceColor);\n targetColorArr = rgb2arr(targetColor);\n useLinearColor = 1;\n }\n\n if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {\n this.judgeStyleAttributes({ opacity });\n const encodeData = this.layer.getEncodedData();\n const { data, width, height } = this.calDataFrame(\n this.cellLength,\n encodeData,\n this.cellProperties,\n );\n this.rowCount = height; // 当前数据纹理有多少行\n\n this.dataTexture =\n this.cellLength > 0 && data.length > 0\n ? this.createTexture2D({\n flipY: true,\n data,\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width,\n height,\n })\n : this.createTexture2D({\n flipY: true,\n data: [1],\n format: gl.LUMINANCE,\n type: gl.FLOAT,\n width: 1,\n height: 1,\n });\n }\n return {\n u_dataTexture: this.dataTexture, // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]\n u_cellTypeLayout: this.getCellTypeLayout(),\n u_opacity: isNumber(opacity) ? opacity : 1.0,\n\n // 渐变色支持参数\n u_linearColor: useLinearColor,\n u_sourceColor: sourceColorArr,\n u_targetColor: targetColorArr,\n\n // arrow\n u_arrow: Number(arrow.enable),\n u_arrowHeight: arrow.arrowHeight || 3,\n u_arrowWidth: arrow.arrowWidth || 2,\n u_tailWidth: arrow.tailWidth === undefined ? 1 : arrow.tailWidth,\n };\n }\n\n public initModels(callbackModel: (models: IModel[]) => void) {\n this.buildModels(callbackModel);\n }\n\n public clearModels() {\n this.dataTexture?.destroy();\n }\n\n public async buildModels(callbackModel: (models: IModel[]) => void) {\n const {\n mask = false,\n maskInside = true,\n depth = false,\n } = this.layer.getLayerConfig() as ILineLayerStyleOptions;\n const { frag, vert } = this.getShaders();\n this.layer.triangulation = LineTriangulation;\n\n this.layer\n .buildLayerModel({\n moduleName: 'lineHalf',\n vertexShader: vert,\n fragmentShader: frag,\n triangulation: LineTriangulation,\n depth: { enable: depth },\n blend: this.getBlend(),\n stencil: getMask(mask, maskInside),\n })\n .then((model) => {\n callbackModel([model]);\n })\n .catch((err) => {\n console.warn(err);\n callbackModel([]);\n });\n }\n\n /**\n * 根据参数获取不同的 shader 代码\n * @returns\n */\n public getShaders(): { frag: string; vert: string; type: string } {\n return {\n frag: line_half_frag,\n vert: line_half_vert,\n type: 'normal',\n };\n }\n\n protected registerBuiltinAttributes() {\n this.styleAttributeService.registerStyleAttribute({\n name: 'distanceAndIndex',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_DistanceAndIndex',\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 vertexIndex?: number,\n ) => {\n return vertexIndex === undefined\n ? [vertex[3], 10, vertex[5]]\n : [vertex[3], vertexIndex, vertex[5]];\n },\n },\n });\n this.styleAttributeService.registerStyleAttribute({\n name: 'dirPoints',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_dirPoints',\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: 4,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n // console.log(feature)\n const startPoint = (feature.coordinates[0] || [0, 0]) as number[];\n const endPoint = (feature.coordinates[3] || [0, 0]) as number[];\n\n return [startPoint[0], startPoint[1], endPoint[0], endPoint[1]];\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: 2,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n const { size = 1 } = feature;\n return Array.isArray(size) ? [size[0], size[1]] : [size as number, 0];\n },\n },\n });\n\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: 'miter',\n type: AttributeType.Attribute,\n descriptor: {\n name: 'a_Miter',\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: 1,\n update: (\n feature: IEncodeFeature,\n featureIdx: number,\n vertex: number[],\n attributeIdx: number,\n ) => {\n return [vertex[4]];\n },\n },\n });\n }\n}\n"],"file":"half.js"}
@@ -13,8 +13,6 @@ var _arc = _interopRequireDefault(require("./arc"));
13
13
 
14
14
  var _arc_3d = _interopRequireDefault(require("./arc_3d"));
15
15
 
16
- var _arcmini = _interopRequireDefault(require("./arcmini"));
17
-
18
16
  var _earthArc_3d = _interopRequireDefault(require("./earthArc_3d"));
19
17
 
20
18
  var _great_circle = _interopRequireDefault(require("./great_circle"));
@@ -33,7 +31,6 @@ var _wall = _interopRequireDefault(require("./wall"));
33
31
 
34
32
  var LineModels = {
35
33
  arc: _arc.default,
36
- arcmini: _arcmini.default,
37
34
  arc3d: _arc_3d.default,
38
35
  greatcircle: _great_circle.default,
39
36
  wall: _wall.default,