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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/es/Geometry/index.js +6 -2
  2. package/es/Geometry/models/billboard.js +3 -7
  3. package/es/Geometry/models/plane.js +5 -7
  4. package/es/Geometry/models/sprite.js +4 -7
  5. package/es/canvas/index.d.ts +4 -0
  6. package/es/canvas/index.js +38 -2
  7. package/es/citybuliding/building.js +6 -2
  8. package/es/citybuliding/models/build.js +2 -3
  9. package/es/core/BaseLayer.d.ts +20 -12
  10. package/es/core/BaseLayer.js +61 -85
  11. package/es/core/BaseModel.d.ts +2 -2
  12. package/es/core/BaseModel.js +22 -19
  13. package/es/core/interface.d.ts +20 -1
  14. package/es/core/triangulation.d.ts +6 -0
  15. package/es/core/triangulation.js +64 -2
  16. package/es/earth/index.js +3 -1
  17. package/es/earth/models/atmosphere.js +4 -7
  18. package/es/earth/models/base.js +12 -18
  19. package/es/earth/models/bloomsphere.js +4 -8
  20. package/es/earth/shaders/atmosphere_frag.glsl +1 -1
  21. package/es/earth/shaders/bloomsphere_frag.glsl +1 -1
  22. package/es/heatmap/index.d.ts +2 -2
  23. package/es/heatmap/index.js +7 -5
  24. package/es/heatmap/models/grid.js +1 -3
  25. package/es/heatmap/models/grid3d.js +4 -11
  26. package/es/heatmap/models/heatmap.js +8 -9
  27. package/es/heatmap/models/hexagon.js +2 -6
  28. package/es/heatmap/triangulation.js +0 -1
  29. package/es/image/index.d.ts +1 -1
  30. package/es/image/index.js +10 -3
  31. package/es/image/models/dataImage.d.ts +1 -1
  32. package/es/image/models/dataImage.js +14 -39
  33. package/es/image/models/image.js +5 -10
  34. package/es/image/models/index.d.ts +1 -1
  35. package/es/image/models/index.js +3 -1
  36. package/es/image/models/tileDataImage.d.ts +19 -0
  37. package/es/image/models/tileDataImage.js +174 -0
  38. package/es/line/index.d.ts +1 -0
  39. package/es/line/index.js +8 -2
  40. package/es/line/models/arc.js +10 -10
  41. package/es/line/models/arc_3d.js +8 -10
  42. package/es/line/models/earthArc_3d.js +8 -10
  43. package/es/line/models/great_circle.js +7 -7
  44. package/es/line/models/half.js +3 -4
  45. package/es/line/models/line.js +10 -9
  46. package/es/line/models/linearline.js +3 -4
  47. package/es/line/models/simpleLine.js +5 -4
  48. package/es/line/models/simpleTileLine.d.ts +9 -0
  49. package/es/line/models/simpleTileLine.js +100 -0
  50. package/es/line/models/tile.d.ts +1 -4
  51. package/es/line/models/tile.js +50 -223
  52. package/es/line/models/wall.js +11 -47
  53. package/es/line/shaders/dash/arc_dash_vert.glsl +2 -0
  54. package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
  55. package/es/line/shaders/line_arc2d_vert.glsl +2 -2
  56. package/es/line/shaders/line_arc_3d_frag.glsl +10 -10
  57. package/es/line/shaders/line_arc_3d_vert.glsl +5 -6
  58. package/es/line/shaders/line_arc_frag.glsl +9 -10
  59. package/es/line/shaders/line_arc_great_circle_frag.glsl +6 -6
  60. package/es/line/shaders/line_arc_great_circle_vert.glsl +2 -3
  61. package/es/line/shaders/line_arc_vert.glsl +6 -4
  62. package/es/line/shaders/line_bezier_vert.glsl +2 -2
  63. package/es/line/shaders/line_frag.glsl +5 -6
  64. package/es/line/shaders/line_vert.glsl +1 -1
  65. package/es/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
  66. package/es/line/shaders/linear/arc3d_linear_vert.glsl +11 -12
  67. package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
  68. package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  69. package/es/line/shaders/tile/line_tile_vert.glsl +19 -177
  70. package/es/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  71. package/es/line/shaders/tile/simpleline_vert.glsl +21 -0
  72. package/es/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +21 -25
  73. package/es/line/shaders/wall/wall_vert.glsl +77 -0
  74. package/es/mask/index.d.ts +1 -0
  75. package/es/mask/index.js +80 -5
  76. package/es/mask/models/fill.d.ts +2 -1
  77. package/es/mask/models/fill.js +13 -10
  78. package/es/mask/shaders/mask_vert.glsl +0 -6
  79. package/es/plugins/DataMappingPlugin.d.ts +4 -3
  80. package/es/plugins/DataMappingPlugin.js +129 -58
  81. package/es/plugins/DataSourcePlugin.js +3 -2
  82. package/es/plugins/FeatureScalePlugin.d.ts +0 -2
  83. package/es/plugins/FeatureScalePlugin.js +8 -51
  84. package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -2
  85. package/es/plugins/LayerAnimateStylePlugin.js +7 -27
  86. package/es/plugins/LayerModelPlugin.js +2 -6
  87. package/es/plugins/LightingPlugin.js +1 -7
  88. package/es/plugins/MultiPassRendererPlugin.d.ts +0 -1
  89. package/es/plugins/MultiPassRendererPlugin.js +4 -16
  90. package/es/plugins/PixelPickingPlugin.d.ts +1 -1
  91. package/es/plugins/PixelPickingPlugin.js +8 -28
  92. package/es/plugins/RegisterStyleAttributePlugin.d.ts +4 -0
  93. package/es/plugins/RegisterStyleAttributePlugin.js +56 -5
  94. package/es/plugins/UpdateStyleAttributePlugin.js +2 -9
  95. package/es/point/index.js +9 -6
  96. package/es/point/models/earthExtrude.d.ts +1 -1
  97. package/es/point/models/earthExtrude.js +9 -14
  98. package/es/point/models/earthFill.js +2 -2
  99. package/es/point/models/extrude.d.ts +1 -1
  100. package/es/point/models/extrude.js +9 -12
  101. package/es/point/models/fill.d.ts +1 -1
  102. package/es/point/models/fill.js +8 -9
  103. package/es/point/models/fillmage.js +5 -6
  104. package/es/point/models/image.js +3 -3
  105. package/es/point/models/index.d.ts +1 -1
  106. package/es/point/models/index.js +3 -3
  107. package/es/point/models/normal.d.ts +0 -1
  108. package/es/point/models/normal.js +9 -62
  109. package/es/point/models/radar.js +5 -70
  110. package/es/point/models/simplePoint.d.ts +0 -1
  111. package/es/point/models/simplePoint.js +2 -11
  112. package/es/point/models/text.js +7 -10
  113. package/es/point/models/tile.d.ts +0 -7
  114. package/es/point/models/tile.js +24 -158
  115. package/es/point/models/tileText.d.ts +0 -4
  116. package/es/point/models/tileText.js +99 -188
  117. package/es/point/shaders/animate/wave_frag.glsl +4 -4
  118. package/es/point/shaders/earth/fill_vert.glsl +0 -1
  119. package/es/point/shaders/fill_vert.glsl +0 -1
  120. package/es/point/shaders/normal_frag.glsl +1 -10
  121. package/es/point/shaders/normal_vert.glsl +5 -60
  122. package/es/point/shaders/radar/radar_frag.glsl +4 -15
  123. package/es/point/shaders/radar/radar_vert.glsl +4 -54
  124. package/es/point/shaders/tile/fill_tile_frag.glsl +10 -17
  125. package/es/point/shaders/tile/fill_tile_vert.glsl +20 -123
  126. package/es/point/shaders/tile/text_frag.glsl +33 -0
  127. package/es/point/shaders/tile/text_map_frag.glsl +31 -0
  128. package/es/point/shaders/tile/text_map_vert.glsl +38 -0
  129. package/es/point/shaders/tile/text_vert.glsl +48 -0
  130. package/es/polygon/index.js +6 -2
  131. package/es/polygon/models/extrude.js +4 -8
  132. package/es/polygon/models/fill.js +3 -4
  133. package/es/polygon/models/ocean.d.ts +0 -2
  134. package/es/polygon/models/ocean.js +13 -47
  135. package/es/polygon/models/tile.d.ts +1 -4
  136. package/es/polygon/models/tile.js +25 -57
  137. package/es/polygon/models/water.d.ts +0 -2
  138. package/es/polygon/models/water.js +13 -47
  139. package/es/polygon/shaders/polygon_frag.glsl +2 -2
  140. package/es/polygon/shaders/polygon_vert.glsl +2 -2
  141. package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  142. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  143. package/es/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  144. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  145. package/es/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  146. package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  147. package/es/raster/buffers/triangulation.js +1 -4
  148. package/es/raster/index.js +6 -2
  149. package/es/raster/models/raster.d.ts +1 -1
  150. package/es/raster/models/raster.js +6 -5
  151. package/es/shader/minify_frag.glsl +7 -0
  152. package/es/shader/minify_picking_frag.glsl +10 -0
  153. package/es/tile/manager/baseMapTileLayerManager.d.ts +29 -0
  154. package/es/tile/manager/baseMapTileLayerManager.js +207 -0
  155. package/es/tile/manager/tileLayerManager.d.ts +2 -2
  156. package/es/tile/manager/tileLayerManager.js +12 -2
  157. package/es/tile/manager/tilePickerManager.d.ts +2 -3
  158. package/es/tile/manager/tilePickerManager.js +1 -2
  159. package/es/tile/models/tileModel.d.ts +1 -0
  160. package/es/tile/models/tileModel.js +18 -2
  161. package/es/tile/tileFactory/base.d.ts +1 -1
  162. package/es/tile/tileFactory/base.js +58 -33
  163. package/es/tile/tileFactory/line.js +3 -0
  164. package/es/tile/tileFactory/point.js +3 -0
  165. package/es/tile/tileFactory/polygon.js +3 -0
  166. package/es/tile/tileFactory/raster.js +3 -0
  167. package/es/tile/tileFactory/rasterData.js +3 -0
  168. package/es/tile/tileFactory/rasterDataLayer.js +6 -2
  169. package/es/tile/tileFactory/test.js +26 -5
  170. package/es/tile/tileFactory/vectorLayer.d.ts +4 -1
  171. package/es/tile/tileFactory/vectorLayer.js +110 -7
  172. package/es/tile/tileLayer/baseMapTileLayer.d.ts +29 -0
  173. package/es/tile/tileLayer/baseMapTileLayer.js +188 -0
  174. package/es/tile/tileLayer/baseTileLayer.d.ts +4 -4
  175. package/es/tile/tileLayer/baseTileLayer.js +46 -75
  176. package/es/tile/tileTest.d.ts +1 -0
  177. package/es/tile/tileTest.js +3 -2
  178. package/es/tile/tmsMapTileLayer.d.ts +9 -0
  179. package/es/tile/tmsMapTileLayer.js +119 -0
  180. package/es/tile/tmsTileLayer.d.ts +2 -0
  181. package/es/tile/tmsTileLayer.js +24 -2
  182. package/es/tile/utils.d.ts +4 -0
  183. package/es/tile/utils.js +30 -0
  184. package/es/utils/dataMappingStyle.js +3 -0
  185. package/es/utils/layerData.js +2 -2
  186. package/es/utils/updateShape.js +2 -2
  187. package/es/wind/index.js +6 -2
  188. package/es/wind/models/wind.js +8 -8
  189. package/es/wind/shaders/wind_vert.glsl +1 -1
  190. package/lib/Geometry/index.js +6 -2
  191. package/lib/Geometry/models/billboard.js +3 -7
  192. package/lib/Geometry/models/plane.js +5 -7
  193. package/lib/Geometry/models/sprite.js +4 -7
  194. package/lib/canvas/index.js +37 -2
  195. package/lib/citybuliding/building.js +6 -2
  196. package/lib/citybuliding/models/build.js +2 -3
  197. package/lib/core/BaseLayer.js +61 -85
  198. package/lib/core/BaseModel.js +22 -19
  199. package/lib/core/triangulation.js +66 -2
  200. package/lib/earth/index.js +3 -1
  201. package/lib/earth/models/atmosphere.js +4 -7
  202. package/lib/earth/models/base.js +12 -18
  203. package/lib/earth/models/bloomsphere.js +4 -8
  204. package/lib/earth/shaders/atmosphere_frag.glsl +1 -1
  205. package/lib/earth/shaders/bloomsphere_frag.glsl +1 -1
  206. package/lib/heatmap/index.js +7 -5
  207. package/lib/heatmap/models/grid.js +1 -3
  208. package/lib/heatmap/models/grid3d.js +4 -11
  209. package/lib/heatmap/models/heatmap.js +8 -9
  210. package/lib/heatmap/models/hexagon.js +2 -6
  211. package/lib/heatmap/triangulation.js +0 -1
  212. package/lib/image/index.js +10 -3
  213. package/lib/image/models/dataImage.js +13 -38
  214. package/lib/image/models/image.js +5 -10
  215. package/lib/image/models/index.js +4 -1
  216. package/lib/image/models/tileDataImage.js +188 -0
  217. package/lib/line/index.js +7 -2
  218. package/lib/line/models/arc.js +10 -10
  219. package/lib/line/models/arc_3d.js +8 -10
  220. package/lib/line/models/earthArc_3d.js +8 -10
  221. package/lib/line/models/great_circle.js +7 -7
  222. package/lib/line/models/half.js +3 -4
  223. package/lib/line/models/line.js +10 -9
  224. package/lib/line/models/linearline.js +3 -4
  225. package/lib/line/models/simpleLine.js +5 -4
  226. package/lib/line/models/simpleTileLine.js +115 -0
  227. package/lib/line/models/tile.js +50 -224
  228. package/lib/line/models/wall.js +11 -47
  229. package/lib/line/shaders/dash/arc_dash_vert.glsl +2 -0
  230. package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
  231. package/lib/line/shaders/line_arc2d_vert.glsl +2 -2
  232. package/lib/line/shaders/line_arc_3d_frag.glsl +10 -10
  233. package/lib/line/shaders/line_arc_3d_vert.glsl +5 -6
  234. package/lib/line/shaders/line_arc_frag.glsl +9 -10
  235. package/lib/line/shaders/line_arc_great_circle_frag.glsl +6 -6
  236. package/lib/line/shaders/line_arc_great_circle_vert.glsl +2 -3
  237. package/lib/line/shaders/line_arc_vert.glsl +6 -4
  238. package/lib/line/shaders/line_bezier_vert.glsl +2 -2
  239. package/lib/line/shaders/line_frag.glsl +5 -6
  240. package/lib/line/shaders/line_vert.glsl +1 -1
  241. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
  242. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +11 -12
  243. package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
  244. package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  245. package/lib/line/shaders/tile/line_tile_vert.glsl +19 -177
  246. package/lib/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  247. package/lib/line/shaders/tile/simpleline_vert.glsl +21 -0
  248. package/lib/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +21 -25
  249. package/lib/line/shaders/wall/wall_vert.glsl +77 -0
  250. package/lib/mask/index.js +82 -5
  251. package/lib/mask/models/fill.js +14 -10
  252. package/lib/mask/shaders/mask_vert.glsl +0 -6
  253. package/lib/plugins/DataMappingPlugin.js +127 -57
  254. package/lib/plugins/DataSourcePlugin.js +3 -2
  255. package/lib/plugins/FeatureScalePlugin.js +6 -50
  256. package/lib/plugins/LayerAnimateStylePlugin.js +6 -29
  257. package/lib/plugins/LayerModelPlugin.js +2 -6
  258. package/lib/plugins/LightingPlugin.js +1 -7
  259. package/lib/plugins/MultiPassRendererPlugin.js +3 -19
  260. package/lib/plugins/PixelPickingPlugin.js +8 -28
  261. package/lib/plugins/RegisterStyleAttributePlugin.js +56 -5
  262. package/lib/plugins/UpdateStyleAttributePlugin.js +2 -9
  263. package/lib/point/index.js +9 -6
  264. package/lib/point/models/earthExtrude.js +9 -14
  265. package/lib/point/models/earthFill.js +2 -2
  266. package/lib/point/models/extrude.js +9 -12
  267. package/lib/point/models/fill.js +8 -9
  268. package/lib/point/models/fillmage.js +5 -6
  269. package/lib/point/models/image.js +3 -3
  270. package/lib/point/models/index.js +1 -1
  271. package/lib/point/models/normal.js +8 -61
  272. package/lib/point/models/radar.js +5 -70
  273. package/lib/point/models/simplePoint.js +1 -10
  274. package/lib/point/models/text.js +7 -10
  275. package/lib/point/models/tile.js +23 -159
  276. package/lib/point/models/tileText.js +98 -187
  277. package/lib/point/shaders/animate/wave_frag.glsl +4 -4
  278. package/lib/point/shaders/earth/fill_vert.glsl +0 -1
  279. package/lib/point/shaders/fill_vert.glsl +0 -1
  280. package/lib/point/shaders/normal_frag.glsl +1 -10
  281. package/lib/point/shaders/normal_vert.glsl +5 -60
  282. package/lib/point/shaders/radar/radar_frag.glsl +4 -15
  283. package/lib/point/shaders/radar/radar_vert.glsl +4 -54
  284. package/lib/point/shaders/tile/fill_tile_frag.glsl +10 -17
  285. package/lib/point/shaders/tile/fill_tile_vert.glsl +20 -123
  286. package/lib/point/shaders/tile/text_frag.glsl +33 -0
  287. package/lib/point/shaders/tile/text_map_frag.glsl +31 -0
  288. package/lib/point/shaders/tile/text_map_vert.glsl +38 -0
  289. package/lib/point/shaders/tile/text_vert.glsl +48 -0
  290. package/lib/polygon/index.js +6 -2
  291. package/lib/polygon/models/extrude.js +4 -8
  292. package/lib/polygon/models/fill.js +3 -4
  293. package/lib/polygon/models/ocean.js +14 -47
  294. package/lib/polygon/models/tile.js +24 -57
  295. package/lib/polygon/models/water.js +14 -47
  296. package/lib/polygon/shaders/polygon_frag.glsl +2 -2
  297. package/lib/polygon/shaders/polygon_vert.glsl +2 -2
  298. package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  299. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  300. package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  301. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  302. package/lib/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  303. package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  304. package/lib/raster/buffers/triangulation.js +1 -4
  305. package/lib/raster/index.js +6 -2
  306. package/lib/raster/models/raster.js +6 -5
  307. package/lib/shader/minify_frag.glsl +7 -0
  308. package/lib/shader/minify_picking_frag.glsl +10 -0
  309. package/lib/tile/manager/baseMapTileLayerManager.js +222 -0
  310. package/lib/tile/manager/tileLayerManager.js +12 -2
  311. package/lib/tile/manager/tilePickerManager.js +1 -2
  312. package/lib/tile/models/tileModel.js +19 -2
  313. package/lib/tile/tileFactory/base.js +60 -33
  314. package/lib/tile/tileFactory/line.js +3 -0
  315. package/lib/tile/tileFactory/point.js +3 -0
  316. package/lib/tile/tileFactory/polygon.js +3 -0
  317. package/lib/tile/tileFactory/raster.js +3 -0
  318. package/lib/tile/tileFactory/rasterData.js +3 -0
  319. package/lib/tile/tileFactory/rasterDataLayer.js +6 -2
  320. package/lib/tile/tileFactory/test.js +26 -5
  321. package/lib/tile/tileFactory/vectorLayer.js +112 -8
  322. package/lib/tile/tileLayer/baseMapTileLayer.js +195 -0
  323. package/lib/tile/tileLayer/baseTileLayer.js +46 -75
  324. package/lib/tile/tileTest.js +3 -2
  325. package/lib/tile/tmsMapTileLayer.js +136 -0
  326. package/lib/tile/tmsTileLayer.js +25 -2
  327. package/lib/tile/utils.js +38 -0
  328. package/lib/utils/dataMappingStyle.js +3 -0
  329. package/lib/utils/layerData.js +2 -2
  330. package/lib/utils/updateShape.js +2 -2
  331. package/lib/wind/index.js +6 -2
  332. package/lib/wind/models/wind.js +7 -7
  333. package/lib/wind/shaders/wind_vert.glsl +1 -1
  334. package/package.json +8 -7
  335. package/es/line/shaders/tile/line_tile_frag.glsl +0 -79
  336. package/es/line/shaders/wall_vert.glsl +0 -111
  337. package/es/mask/shaders/mask_frag.glsl +0 -7
  338. package/es/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
  339. package/lib/line/shaders/tile/line_tile_frag.glsl +0 -79
  340. package/lib/line/shaders/wall_vert.glsl +0 -111
  341. package/lib/mask/shaders/mask_frag.glsl +0 -7
  342. package/lib/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
@@ -55,11 +55,10 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
55
55
  mag: 'linear',
56
56
  min: 'linear mipmap nearest',
57
57
  mipmap: true
58
- }); // this.layer.render();
59
- // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
58
+ }); // 更新完纹理后在更新的图层的时候需要更新所有的图层
60
59
 
61
60
 
62
- _this.layer.renderLayers();
61
+ _this.layerService.throttleRenderLayers();
63
62
 
64
63
  return;
65
64
  }
@@ -284,7 +283,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
284
283
  type: gl.FLOAT
285
284
  },
286
285
  size: 1,
287
- update: function update(feature, featureIdx, vertex, attributeIdx) {
286
+ update: function update(feature) {
288
287
  var _feature$rotate = feature.rotate,
289
288
  rotate = _feature$rotate === void 0 ? 0 : _feature$rotate;
290
289
  return Array.isArray(rotate) ? [rotate[0]] : [rotate];
@@ -303,7 +302,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
303
302
  type: gl.FLOAT
304
303
  },
305
304
  size: 2,
306
- update: function update(feature, featureIdx, vertex, attributeIdx) {
305
+ update: function update(feature) {
307
306
  var iconMap = _this2.iconService.getIconMap();
308
307
 
309
308
  var shape = feature.shape;
@@ -351,7 +350,7 @@ var FillImageModel = /*#__PURE__*/function (_BaseModel) {
351
350
  type: gl.FLOAT
352
351
  },
353
352
  size: 1,
354
- update: function update(feature, featureIdx, vertex, attributeIdx) {
353
+ update: function update(feature) {
355
354
  var _feature$size = feature.size,
356
355
  size = _feature$size === void 0 ? 5 : _feature$size;
357
356
  return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
@@ -47,10 +47,10 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
47
47
  mag: 'linear',
48
48
  min: 'linear mipmap nearest',
49
49
  mipmap: true
50
- }); // TODO: 更新完纹理后在更新的图层的时候需要更新所有的图层
50
+ }); // 更新完纹理后在更新的图层的时候需要更新所有的图层
51
51
 
52
52
 
53
- _this.layer.renderLayers();
53
+ _this.layerService.throttleRenderLayers();
54
54
 
55
55
  return;
56
56
  }
@@ -194,7 +194,7 @@ var ImageModel = /*#__PURE__*/function (_BaseModel) {
194
194
  type: gl.FLOAT
195
195
  },
196
196
  size: 1,
197
- update: function update(feature, featureIdx, vertex, attributeIdx) {
197
+ update: function update(feature) {
198
198
  var _feature$size = feature.size,
199
199
  size = _feature$size === void 0 ? 5 : _feature$size;
200
200
  return Array.isArray(size) ? [size[0]] : [size];
@@ -1,4 +1,4 @@
1
- export declare type PointType = 'fillImage' | 'fill' | 'radar' | 'image' | 'normal' | 'simplePoint' | 'extrude' | 'text' | 'vectorpoint' | 'tile' | 'tileText' | 'earthFill' | 'earthExtrude';
1
+ export declare type PointType = 'fillImage' | 'fill' | 'radar' | 'image' | 'normal' | 'simplePoint' | 'extrude' | 'text' | 'vectorPoint' | 'tile' | 'tileText' | 'earthFill' | 'earthExtrude';
2
2
  declare const PointModels: {
3
3
  [key in PointType]: any;
4
4
  };
@@ -8,7 +8,7 @@ import FillImageModel from "./fillmage";
8
8
  import IMageModel from "./image";
9
9
  import NormalModel from "./normal";
10
10
  import Radar from "./radar";
11
- import SimplePopint from "./simplePoint";
11
+ import SimplePoint from "./simplePoint";
12
12
  import TextModel from "./text";
13
13
  import TileTextModel from "./tileText";
14
14
  import TileFillModel from "./tile";
@@ -18,10 +18,10 @@ var PointModels = {
18
18
  radar: Radar,
19
19
  image: IMageModel,
20
20
  normal: NormalModel,
21
- simplePoint: SimplePopint,
21
+ simplePoint: SimplePoint,
22
22
  extrude: ExtrudeModel,
23
23
  text: TextModel,
24
- vectorpoint: PointTileModel,
24
+ vectorPoint: PointTileModel,
25
25
  tile: TileFillModel,
26
26
  tileText: TileTextModel,
27
27
  earthFill: EarthFillModel,
@@ -13,5 +13,4 @@ export default class NormalModel extends BaseModel {
13
13
  buildModels(callbackModel: (models: IModel[]) => void): void;
14
14
  clearModels(): void;
15
15
  protected registerBuiltinAttributes(): void;
16
- private defaultStyleOptions;
17
16
  }
@@ -9,16 +9,16 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
9
9
 
10
10
  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; } }
11
11
 
12
- import { AttributeType, BlendType, gl } from '@antv/l7-core';
12
+ import { AttributeType, gl } from '@antv/l7-core';
13
13
  import { getMask } from '@antv/l7-utils';
14
14
  import { isNumber } from 'lodash';
15
15
  import BaseModel from "../../core/BaseModel";
16
16
 
17
17
  /* babel-plugin-inline-import '../shaders/normal_frag.glsl' */
18
- var normalFrag = "\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\nvarying vec4 v_color;\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\n#pragma include \"picking\"\nvoid main() {\n float opacity = styleMappingMat[0][0];\n\n gl_FragColor = v_color;\n // gl_FragColor.a =gl_FragColor.a * u_opacity;\n gl_FragColor.a =gl_FragColor.a * opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
18
+ var normalFrag = "uniform float u_opacity : 1;\nvarying vec4 v_color;\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n}\n";
19
19
 
20
20
  /* babel-plugin-inline-import '../shaders/normal_vert.glsl' */
21
- var normalVert = "\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\nvarying vec4 v_color;\n\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\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 \"picking\"\n#pragma include \"project\"\nvoid main() {\n v_color = a_Color;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\nstyleMappingMat = 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\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\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n \n // vec2 offset = project_pixel(u_offsets);\n vec2 offset = project_pixel(textrueOffsets);\n // vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n // gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\\\n // \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // vec2 offset = project_pixel((u_offsets));\n gl_Position = u_Mvp * vec4(a_Position.xy + offset, a_Position.z, 1.0);\n } else { // else\n // vec2 offset = project_pixel(u_offsets);\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy+offset),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n setPickingColor(a_PickingColor);\n}\n";
21
+ var normalVert = "\nattribute vec3 a_Position;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute float a_Size;\nattribute vec4 a_Color;\n\nvarying vec4 v_color;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n\nvoid main() {\n v_color = a_Color;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(a_Position.xy, a_Position.z, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(a_Position, 1.0)) + vec4(a_Size / 2.,-a_Size /2.,0.,0.);\n gl_Position = project_common_position_to_clipspace(vec4(vec2(project_pos.xy),project_pos.z,project_pos.w));\n }\n\n gl_PointSize = a_Size * 2.0 * u_DevicePixelRatio;\n}\n";
22
22
  export function PointTriangulation(feature) {
23
23
  var coordinates = feature.coordinates;
24
24
  return {
@@ -51,51 +51,10 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
51
51
  value: function getUninforms() {
52
52
  var _ref = this.layer.getLayerConfig(),
53
53
  _ref$opacity = _ref.opacity,
54
- opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
55
- _ref$offsets = _ref.offsets,
56
- offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets;
57
-
58
- if (this.dataTextureTest && this.dataTextureNeedUpdate({
59
- opacity: opacity,
60
- offsets: offsets
61
- })) {
62
- // 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
63
- this.judgeStyleAttributes({
64
- opacity: opacity,
65
- offsets: offsets
66
- });
67
- var encodeData = this.layer.getEncodedData();
68
-
69
- var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
70
- data = _this$calDataFrame.data,
71
- width = _this$calDataFrame.width,
72
- height = _this$calDataFrame.height;
73
-
74
- this.rowCount = height; // 当前数据纹理有多少行
75
-
76
- this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
77
- flipY: true,
78
- data: data,
79
- format: gl.LUMINANCE,
80
- type: gl.FLOAT,
81
- width: width,
82
- height: height
83
- }) : this.createTexture2D({
84
- flipY: true,
85
- data: [1],
86
- format: gl.LUMINANCE,
87
- type: gl.FLOAT,
88
- width: 1,
89
- height: 1
90
- });
91
- }
54
+ opacity = _ref$opacity === void 0 ? 1 : _ref$opacity;
92
55
 
93
56
  return {
94
- u_dataTexture: this.dataTexture,
95
- // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
96
- u_cellTypeLayout: this.getCellTypeLayout(),
97
- u_opacity: isNumber(opacity) ? opacity : 1.0,
98
- u_offsets: this.isOffsetStatic(offsets) ? offsets : [0, 0]
57
+ u_opacity: isNumber(opacity) ? opacity : 1.0
99
58
  };
100
59
  }
101
60
  }, {
@@ -123,7 +82,8 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
123
82
  },
124
83
  primitive: gl.POINTS,
125
84
  blend: this.getBlend(),
126
- stencil: getMask(mask, maskInside)
85
+ stencil: getMask(mask, maskInside),
86
+ pick: false
127
87
  }).then(function (model) {
128
88
  callbackModel([model]);
129
89
  }).catch(function (err) {
@@ -133,28 +93,22 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
133
93
  }
134
94
  }, {
135
95
  key: "clearModels",
136
- value: function clearModels() {
137
- var _this$dataTexture;
138
-
139
- (_this$dataTexture = this.dataTexture) === null || _this$dataTexture === void 0 ? void 0 : _this$dataTexture.destroy();
140
- }
96
+ value: function clearModels() {}
141
97
  }, {
142
98
  key: "registerBuiltinAttributes",
143
99
  value: function registerBuiltinAttributes() {
144
- // point layer size;
145
100
  this.styleAttributeService.registerStyleAttribute({
146
101
  name: 'size',
147
102
  type: AttributeType.Attribute,
148
103
  descriptor: {
149
104
  name: 'a_Size',
150
105
  buffer: {
151
- // give the WebGL driver a hint that this buffer may change
152
106
  usage: gl.DYNAMIC_DRAW,
153
107
  data: [],
154
108
  type: gl.FLOAT
155
109
  },
156
110
  size: 1,
157
- update: function update(feature, featureIdx, vertex, attributeIdx) {
111
+ update: function update(feature) {
158
112
  var _feature$size = feature.size,
159
113
  size = _feature$size === void 0 ? 1 : _feature$size;
160
114
  return Array.isArray(size) ? [size[0]] : [size];
@@ -162,13 +116,6 @@ var NormalModel = /*#__PURE__*/function (_BaseModel) {
162
116
  }
163
117
  });
164
118
  }
165
- }, {
166
- key: "defaultStyleOptions",
167
- value: function defaultStyleOptions() {
168
- return {
169
- blend: BlendType.additive
170
- };
171
- }
172
119
  }]);
173
120
 
174
121
  return NormalModel;
@@ -18,10 +18,10 @@ import BaseModel from "../../core/BaseModel";
18
18
  import { PointFillTriangulation } from "../../core/triangulation";
19
19
 
20
20
  /* babel-plugin-inline-import '../shaders/radar/radar_frag.glsl' */
21
- var pointFillFrag = "\nuniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n } else {\n gl_FragColor.a *= opacity_t;\n }\n\n if(gl_FragColor.a > 0.0) {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n vec2 extrude = styleMappingMat[2].ba;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n // full circle\n // float rades = dot(dir, baseDir);\n // float flag = sign(dir.y);\n // float radar_v = (flag - 1.0) * -0.5 + flag * acos(rades)/pi/2.0;\n \n // half circle\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n gl_FragColor.a *= radar_v;\n}\n";
21
+ var pointFillFrag = "\nuniform float u_additive;\nuniform float u_opacity: 1.0;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\nvoid main() {\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius);\n\n float outer_df = sdCircle(v_data.xy, 1.0);\n float inner_df = sdCircle(v_data.xy, r);\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * u_opacity);\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n } else {\n gl_FragColor.a *= opacity_t;\n }\n\n if(gl_FragColor.a > 0.0) {\n gl_FragColor = filterColor(gl_FragColor);\n }\n\n vec2 extrude = v_exteude;\n vec2 dir = normalize(extrude);\n vec2 baseDir = vec2(1.0, 0.0);\n float pi = 3.14159265359;\n // full circle\n // float rades = dot(dir, baseDir);\n // float flag = sign(dir.y);\n // float radar_v = (flag - 1.0) * -0.5 + flag * acos(rades)/pi/2.0;\n \n // half circle\n float flag = sign(dir.y);\n float rades = dot(dir, baseDir);\n float radar_v = (flag - 1.0) * -0.5 * acos(rades)/pi;\n // simple AA\n if(radar_v > 0.99) {\n radar_v = 1.0 - (radar_v - 0.99)/0.01;\n }\n\n gl_FragColor.a *= radar_v;\n}\n";
22
22
 
23
23
  /* babel-plugin-inline-import '../shaders/radar/radar_vert.glsl' */
24
- var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\nuniform float u_speed: 1.0;\nuniform float u_time;\n\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\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_isMeter;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform vec2 u_offsets;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n float newSize = setPickingSize(a_Size);\n\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 - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // empty - empty - empty - empty\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1] - a_Extrude.x - a_Extrude.y\n 0.0, 0.0, 0.0, 0.0 // \n );\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2( \n cos(time), sin(time), \n -sin(time), cos(time)\n );\n styleMappingMat[2].ba = rotateMatrix * a_Extrude.xy;\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 -> empty -> empty ... \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\n\n vec2 textrueOffsets = vec2(0.0, 0.0);\n if(hasOffsets()) {\n vec2 valueXPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.r = pos2value(valueXPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n\n vec2 valueYPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n textrueOffsets.g = pos2value(valueYPos, columnWidth, rowHeight); // x\n textureOffset += 1.0;\n } else {\n textrueOffsets = u_offsets;\n }\n\n // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n vec2 offset = (extrude.xy * (newSize) + textrueOffsets);\n vec3 aPosition = a_Position;\n if(u_isMeter < 1.0) {\n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n } else {\n // \u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n antialiasblur *= pow(19.0 - u_Zoom, 2.0);\n antialiasblur = max(antialiasblur, -0.01);\n // offset *= 0.5;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\n\n v_data = vec4(extrude.x, extrude.y, antialiasblur,shape_type);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
24
+ var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nuniform float u_speed: 1.0;\nuniform float u_time;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_isMeter;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\nvarying vec2 v_exteude;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float newSize = setPickingSize(a_Size);\n\n float time = u_time * u_speed;\n mat2 rotateMatrix = mat2( \n cos(time), sin(time), \n -sin(time), cos(time)\n );\n v_exteude = rotateMatrix * a_Extrude.xy;\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n float blur = 0.0;\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / a_Size, blur);\n\n vec2 offset = (extrude.xy * (newSize));\n vec3 aPosition = a_Position;\n if(u_isMeter < 1.0) {\n // \u4E0D\u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n offset = project_pixel(offset);\n } else {\n // \u4EE5\u7C73\u4E3A\u5B9E\u9645\u5355\u4F4D\n antialiasblur *= pow(19.0 - u_Zoom, 2.0);\n antialiasblur = max(antialiasblur, -0.01);\n // offset *= 0.5;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n aPosition.xy += offset;\n offset.x = 0.0;\n offset.y = 0.0;\n }\n }\n\n v_data = vec4(extrude.x, extrude.y, antialiasblur, -1.0);\n\n vec4 project_pos = project_position(vec4(aPosition.xy, 0.0, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * vec4(project_pos.xy + offset, 0.0, 1.0);\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, project_pixel(setPickingOrder(0.0)), 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
25
25
  import { Version } from '@antv/l7-maps';
26
26
 
27
27
  var RadarModel = /*#__PURE__*/function (_BaseModel) {
@@ -53,56 +53,15 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
53
53
  var _ref = this.layer.getLayerConfig(),
54
54
  _ref$opacity = _ref.opacity,
55
55
  opacity = _ref$opacity === void 0 ? 1 : _ref$opacity,
56
- _ref$offsets = _ref.offsets,
57
- offsets = _ref$offsets === void 0 ? [0, 0] : _ref$offsets,
58
56
  blend = _ref.blend,
59
57
  _ref$speed = _ref.speed,
60
58
  speed = _ref$speed === void 0 ? 1 : _ref$speed;
61
59
 
62
- if (this.dataTextureTest && this.dataTextureNeedUpdate({
63
- opacity: opacity,
64
- offsets: offsets
65
- })) {
66
- // 判断当前的样式中哪些是需要进行数据映射的,哪些是常量,同时计算用于构建数据纹理的一些中间变量
67
- this.judgeStyleAttributes({
68
- opacity: opacity,
69
- offsets: offsets
70
- });
71
- var encodeData = this.layer.getEncodedData();
72
-
73
- var _this$calDataFrame = this.calDataFrame(this.cellLength, encodeData, this.cellProperties),
74
- data = _this$calDataFrame.data,
75
- width = _this$calDataFrame.width,
76
- height = _this$calDataFrame.height;
77
-
78
- this.rowCount = height; // 当前数据纹理有多少行
79
-
80
- this.dataTexture = this.cellLength > 0 && data.length > 0 ? this.createTexture2D({
81
- flipY: true,
82
- data: data,
83
- format: gl.LUMINANCE,
84
- type: gl.FLOAT,
85
- width: width,
86
- height: height
87
- }) : this.createTexture2D({
88
- flipY: true,
89
- data: [1],
90
- format: gl.LUMINANCE,
91
- type: gl.FLOAT,
92
- width: 1,
93
- height: 1
94
- });
95
- }
96
-
97
60
  return {
98
61
  u_isMeter: Number(this.isMeter),
99
62
  u_speed: speed,
100
63
  u_additive: blend === 'additive' ? 1.0 : 0.0,
101
- u_dataTexture: this.dataTexture,
102
- // 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
103
- u_cellTypeLayout: this.getCellTypeLayout(),
104
- u_opacity: isNumber(opacity) ? opacity : 1.0,
105
- u_offsets: this.isOffsetStatic(offsets) ? offsets : [0, 0]
64
+ u_opacity: isNumber(opacity) ? opacity : 1.0
106
65
  };
107
66
  }
108
67
  }, {
@@ -115,7 +74,7 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
115
74
  } : _ref2$animateOption;
116
75
 
117
76
  return {
118
- u_aimate: this.animateOption2Array(animateOption),
77
+ u_animate: this.animateOption2Array(animateOption),
119
78
  u_time: this.layer.getLayerAnimateTime()
120
79
  };
121
80
  }
@@ -257,36 +216,12 @@ var RadarModel = /*#__PURE__*/function (_BaseModel) {
257
216
  type: gl.FLOAT
258
217
  },
259
218
  size: 1,
260
- update: function update(feature, featureIdx, vertex, attributeIdx) {
219
+ update: function update(feature) {
261
220
  var _feature$size = feature.size,
262
221
  size = _feature$size === void 0 ? 5 : _feature$size;
263
222
  return Array.isArray(size) ? [size[0] * _this2.meter2coord] : [size * _this2.meter2coord];
264
223
  }
265
224
  }
266
- }); // point layer size;
267
-
268
- this.styleAttributeService.registerStyleAttribute({
269
- name: 'shape',
270
- type: AttributeType.Attribute,
271
- descriptor: {
272
- name: 'a_Shape',
273
- buffer: {
274
- // give the WebGL driver a hint that this buffer may change
275
- usage: gl.DYNAMIC_DRAW,
276
- data: [],
277
- type: gl.FLOAT
278
- },
279
- size: 1,
280
- update: function update(feature, featureIdx, vertex, attributeIdx) {
281
- var _feature$shape = feature.shape,
282
- shape = _feature$shape === void 0 ? 2 : _feature$shape;
283
-
284
- var shape2d = _this2.layer.getLayerConfig().shape2d;
285
-
286
- var shapeIndex = shape2d.indexOf(shape);
287
- return [shapeIndex];
288
- }
289
- }
290
225
  });
291
226
  }
292
227
  }]);
@@ -13,5 +13,4 @@ export default class SimplePointModel extends BaseModel {
13
13
  buildModels(callbackModel: (models: IModel[]) => void): void;
14
14
  clearModels(): void;
15
15
  protected registerBuiltinAttributes(): void;
16
- private defaultStyleOptions;
17
16
  }
@@ -9,7 +9,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
9
9
 
10
10
  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; } }
11
11
 
12
- import { AttributeType, BlendType, gl } from '@antv/l7-core';
12
+ import { AttributeType, gl } from '@antv/l7-core';
13
13
  import { getMask } from '@antv/l7-utils';
14
14
  import { isNumber } from 'lodash';
15
15
  import BaseModel from "../../core/BaseModel";
@@ -152,20 +152,18 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
152
152
  }, {
153
153
  key: "registerBuiltinAttributes",
154
154
  value: function registerBuiltinAttributes() {
155
- // point layer size;
156
155
  this.styleAttributeService.registerStyleAttribute({
157
156
  name: 'size',
158
157
  type: AttributeType.Attribute,
159
158
  descriptor: {
160
159
  name: 'a_Size',
161
160
  buffer: {
162
- // give the WebGL driver a hint that this buffer may change
163
161
  usage: gl.DYNAMIC_DRAW,
164
162
  data: [],
165
163
  type: gl.FLOAT
166
164
  },
167
165
  size: 1,
168
- update: function update(feature, featureIdx, vertex, attributeIdx) {
166
+ update: function update(feature) {
169
167
  var _feature$size = feature.size,
170
168
  size = _feature$size === void 0 ? 1 : _feature$size;
171
169
  return Array.isArray(size) ? [size[0]] : [size];
@@ -173,13 +171,6 @@ var SimplePointModel = /*#__PURE__*/function (_BaseModel) {
173
171
  }
174
172
  });
175
173
  }
176
- }, {
177
- key: "defaultStyleOptions",
178
- value: function defaultStyleOptions() {
179
- return {
180
- blend: BlendType.additive
181
- };
182
- }
183
174
  }]);
184
175
 
185
176
  return SimplePointModel;
@@ -289,7 +289,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
289
289
  type: gl.FLOAT
290
290
  },
291
291
  size: 1,
292
- update: function update(feature, featureIdx, vertex, attributeIdx) {
292
+ update: function update(feature) {
293
293
  var _feature$rotate = feature.rotate,
294
294
  rotate = _feature$rotate === void 0 ? 0 : _feature$rotate;
295
295
  return Array.isArray(rotate) ? [rotate[0]] : [rotate];
@@ -308,7 +308,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
308
308
  type: gl.FLOAT
309
309
  },
310
310
  size: 2,
311
- update: function update(feature, featureIdx, vertex, attributeIdx) {
311
+ update: function update(feature, featureIdx, vertex) {
312
312
  return [vertex[5], vertex[6]];
313
313
  }
314
314
  }
@@ -326,27 +326,25 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
326
326
  type: gl.FLOAT
327
327
  },
328
328
  size: 1,
329
- update: function update(feature, featureIdx, vertex, attributeIdx) {
329
+ update: function update(feature) {
330
330
  var _feature$size = feature.size,
331
331
  size = _feature$size === void 0 ? 12 : _feature$size;
332
332
  return Array.isArray(size) ? [size[0]] : [size];
333
333
  }
334
334
  }
335
- }); // point layer size;
336
-
335
+ });
337
336
  this.styleAttributeService.registerStyleAttribute({
338
337
  name: 'textUv',
339
338
  type: AttributeType.Attribute,
340
339
  descriptor: {
341
340
  name: 'a_tex',
342
341
  buffer: {
343
- // give the WebGL driver a hint that this buffer may change
344
342
  usage: gl.DYNAMIC_DRAW,
345
343
  data: [],
346
344
  type: gl.FLOAT
347
345
  },
348
346
  size: 2,
349
- update: function update(feature, featureIdx, vertex, attributeIdx) {
347
+ update: function update(feature, featureIdx, vertex) {
350
348
  return [vertex[3], vertex[4]];
351
349
  }
352
350
  }
@@ -443,7 +441,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
443
441
  value: function generateGlyphLayout(iconfont) {
444
442
  var _this2 = this;
445
443
 
446
- // TODO:更新文字布局
444
+ // 更新文字布局
447
445
  var mapping = this.fontService.mapping;
448
446
 
449
447
  var _ref8 = this.layer.getLayerConfig(),
@@ -531,7 +529,6 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
531
529
  box = _collisionIndex$place.box;
532
530
 
533
531
  if (box && box.length) {
534
- // TODO:featureIndex
535
532
  collisionIndex.insertCollisionBox(box, id);
536
533
  return true;
537
534
  } else {
@@ -608,7 +605,7 @@ var TextModel = /*#__PURE__*/function (_BaseModel) {
608
605
  }).then(function (model) {
609
606
  _this4.layer.models = [model];
610
607
 
611
- _this4.layer.renderLayers();
608
+ _this4.layerService.throttleRenderLayers();
612
609
  }).catch(function (err) {
613
610
  console.warn(err);
614
611
  _this4.layer.models = [];
@@ -1,8 +1,6 @@
1
1
  import { IAttribute, IElements, IModel, IModelUniform } from '@antv/l7-core';
2
2
  import BaseModel from '../../core/BaseModel';
3
3
  export default class FillModel extends BaseModel {
4
- meter2coord: number;
5
- private isMeter;
6
4
  getUninforms(): IModelUniform;
7
5
  getAttribute(): {
8
6
  attributes: {
@@ -11,11 +9,6 @@ export default class FillModel extends BaseModel {
11
9
  elements: IElements;
12
10
  };
13
11
  initModels(callbackModel: (models: IModel[]) => void): void;
14
- /**
15
- * 计算等面积点图层(unit meter)笛卡尔坐标标度与世界坐标标度的比例
16
- * @returns
17
- */
18
- calMeter2Coord(): void;
19
12
  buildModels(callbackModel: (models: IModel[]) => void): void;
20
13
  clearModels(): void;
21
14
  protected registerBuiltinAttributes(): void;