@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
@@ -48,6 +48,8 @@ vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {
48
48
  // return mid;
49
49
  }
50
50
  float getSegmentRatio(float index) {
51
+ // dash: index / (segmentNumber - 1.);
52
+ // normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
51
53
  return index / (segmentNumber - 1.);
52
54
  }
53
55
  vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {
@@ -9,7 +9,7 @@ varying vec4 v_dash_array;
9
9
  #pragma include "picking"
10
10
 
11
11
  uniform float u_time;
12
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ]; // 控制运动
12
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // 控制运动
13
13
 
14
14
  varying mat4 styleMappingMat;
15
15
  // [animate, duration, interval, trailLength],
@@ -7,7 +7,7 @@ attribute vec4 a_Instance;
7
7
  attribute float a_Size;
8
8
  uniform mat4 u_ModelMatrix;
9
9
  uniform float segmentNumber;
10
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
10
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
11
11
  varying vec4 v_color;
12
12
  varying vec2 v_normal;
13
13
 
@@ -98,7 +98,7 @@ void main() {
98
98
  float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba);
99
99
  v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
100
100
  }
101
- if(u_aimate.x == Animate) {
101
+ if(u_animate.x == Animate) {
102
102
  v_distance_ratio = segmentIndex / segmentNumber;
103
103
  }
104
104
  float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
@@ -20,7 +20,7 @@ uniform float segmentNumber;
20
20
  varying vec2 v_iconMapUV;
21
21
 
22
22
  uniform float u_time;
23
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
23
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
24
24
 
25
25
  varying mat4 styleMappingMat;
26
26
 
@@ -42,16 +42,16 @@ void main() {
42
42
  gl_FragColor.a *=flag;
43
43
  }
44
44
 
45
- if(u_aimate.x == Animate && u_line_texture != LineTexture) {
46
- animateSpeed = u_time / u_aimate.y;
47
- float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);
45
+ if(u_animate.x == Animate && u_line_texture != LineTexture) {
46
+ animateSpeed = u_time / u_animate.y;
47
+ float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
48
48
 
49
- alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;
49
+ alpha = (alpha + u_animate.w -1.0) / u_animate.w;
50
50
  // alpha = smoothstep(0., 1., alpha);
51
51
  alpha = clamp(alpha, 0.0, 1.0);
52
52
  gl_FragColor.a *= alpha;
53
53
 
54
- // u_aimate
54
+ // u_animate
55
55
  // x enable
56
56
  // y duration
57
57
  // z interval
@@ -64,8 +64,8 @@ void main() {
64
64
  float count = styleMappingMat[3].b; // // 贴图在弧线上重复的数量
65
65
 
66
66
  float time = 0.0;
67
- if(u_aimate.x == Animate) {
68
- time = u_time / u_aimate.y;
67
+ if(u_animate.x == Animate) {
68
+ time = u_time / u_animate.y;
69
69
  }
70
70
  float redioCount = arcRadio * count;
71
71
 
@@ -75,9 +75,9 @@ void main() {
75
75
  vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
76
76
  vec4 pattern = texture2D(u_texture, uv);
77
77
 
78
- if(u_aimate.x == Animate) {
78
+ if(u_animate.x == Animate) {
79
79
  float currentPlane = floor(redioCount - time);
80
- float textureStep = floor(count * u_aimate.z);
80
+ float textureStep = floor(count * u_animate.z);
81
81
  float a = mod(currentPlane, textureStep);
82
82
  if(a < textureStep - 1.0) {
83
83
  pattern = vec4(0.0);
@@ -13,9 +13,9 @@ uniform float u_global_height: 10;
13
13
  uniform mat4 u_ModelMatrix;
14
14
  uniform mat4 u_Mvp;
15
15
  uniform float segmentNumber;
16
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
16
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
17
17
  varying vec4 v_color;
18
- // varying vec2 v_normal;
18
+
19
19
  uniform float u_line_type: 0.0;
20
20
  uniform vec4 u_dash_array: [10.0, 5., 0, 0];
21
21
  varying vec4 v_dash_array;
@@ -85,11 +85,11 @@ float torad(float deg) {
85
85
 
86
86
  vec3 lglt2xyz(vec2 lnglat) {
87
87
  float pi = 3.1415926;
88
- // TODO: + Math.PI/2 是为了对齐坐标
88
+ // + Math.PI/2 是为了对齐坐标
89
89
  float lng = torad(lnglat.x) + pi / 2.0;
90
90
  float lat = torad(lnglat.y);
91
91
 
92
- // TODO: 手动增加一些偏移,减轻面的冲突
92
+ // 手动增加一些偏移,减轻面的冲突
93
93
  float radius = u_globel_radius;
94
94
 
95
95
  float z = radius * cos(lat) * cos(lng);
@@ -135,7 +135,6 @@ void main() {
135
135
  float d_distance_ratio;
136
136
  if(u_line_type == LineTypeDash) {
137
137
  d_distance_ratio = segmentIndex / segmentNumber;
138
- // float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
139
138
  vec2 s = source;
140
139
  vec2 t = target;
141
140
 
@@ -146,7 +145,7 @@ void main() {
146
145
  float total_Distance = pixelDistance(s, t) / 2.0 * PI;
147
146
  v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
148
147
  }
149
- if(u_aimate.x == Animate) {
148
+ if(u_animate.x == Animate) {
150
149
  d_distance_ratio = segmentIndex / segmentNumber;
151
150
  }
152
151
  styleMappingMat[3].g = d_distance_ratio; // 当前点位距离占线总长的比例
@@ -11,7 +11,7 @@ varying vec4 v_dash_array;
11
11
  varying vec4 v_color;
12
12
 
13
13
  uniform float u_time;
14
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
14
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
15
15
 
16
16
  uniform float u_line_texture;
17
17
  uniform sampler2D u_texture;
@@ -34,10 +34,10 @@ void main() {
34
34
 
35
35
  gl_FragColor.a *= opacity;
36
36
 
37
- if(u_aimate.x == Animate && u_line_texture != LineTexture) {
38
- animateSpeed = u_time / u_aimate.y;
39
- float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);
40
- alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;
37
+ if(u_animate.x == Animate && u_line_texture != LineTexture) {
38
+ animateSpeed = u_time / u_animate.y;
39
+ float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
40
+ alpha = (alpha + u_animate.w -1.0) / u_animate.w;
41
41
  // alpha = smoothstep(0., 1., alpha);
42
42
  alpha = clamp(alpha, 0.0, 1.0);
43
43
  gl_FragColor.a *= alpha;
@@ -51,8 +51,8 @@ void main() {
51
51
  float count = styleMappingMat[3].g; // 贴图在弧线上重复的数量
52
52
 
53
53
  float time = 0.0;
54
- if(u_aimate.x == Animate) {
55
- time = u_time / u_aimate.y;
54
+ if(u_animate.x == Animate) {
55
+ time = u_time / u_animate.y;
56
56
  }
57
57
  float redioCount = arcRadio * count;
58
58
 
@@ -62,9 +62,9 @@ void main() {
62
62
 
63
63
  vec4 pattern = texture2D(u_texture, uv);
64
64
 
65
- if(u_aimate.x == Animate) {
65
+ if(u_animate.x == Animate) {
66
66
  float currentPlane = floor(redioCount - time);
67
- float textureStep = floor(count * u_aimate.z);
67
+ float textureStep = floor(count * u_animate.z);
68
68
  float a = mod(currentPlane, textureStep);
69
69
  if(a < textureStep - 1.0) {
70
70
  pattern = vec4(0.0);
@@ -85,5 +85,4 @@ void main() {
85
85
  } else {
86
86
  gl_FragColor = filterColor(gl_FragColor);
87
87
  }
88
- // gl_FragColor = filterColor(gl_FragColor);
89
88
  }
@@ -13,7 +13,7 @@ varying float v_distance_ratio;
13
13
  varying vec4 v_color;
14
14
 
15
15
  uniform float u_time;
16
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
16
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
17
17
 
18
18
  uniform float u_line_texture: 0.0;
19
19
  uniform sampler2D u_texture;
@@ -58,10 +58,10 @@ void main() {
58
58
  }
59
59
 
60
60
  // 设置弧线的动画模式
61
- if(u_aimate.x == Animate) {
62
- animateSpeed = u_time / u_aimate.y;
63
- float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);
64
- alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;
61
+ if(u_animate.x == Animate) {
62
+ animateSpeed = u_time / u_animate.y;
63
+ float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
64
+ alpha = (alpha + u_animate.w -1.0) / u_animate.w;
65
65
  alpha = smoothstep(0., 1., alpha);
66
66
  gl_FragColor.a *= alpha;
67
67
  }
@@ -73,7 +73,7 @@ void main() {
73
73
  float count = styleMappingMat[3].b; // 贴图在弧线上重复的数量
74
74
  float u = fract(arcRadio * count - animateSpeed * count);
75
75
  // float u = fract(arcRadio * count - animateSpeed);
76
- if(u_aimate.x == Animate) {
76
+ if(u_animate.x == Animate) {
77
77
  u = gl_FragColor.a/opacity;
78
78
  }
79
79
 
@@ -10,9 +10,8 @@ attribute float a_Size;
10
10
  uniform mat4 u_ModelMatrix;
11
11
  uniform mat4 u_Mvp;
12
12
  uniform float segmentNumber;
13
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
13
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
14
14
  varying vec4 v_color;
15
- // varying vec2 v_normal;
16
15
 
17
16
  varying float v_distance_ratio;
18
17
  uniform float u_line_type: 0.0;
@@ -172,7 +171,7 @@ void main() {
172
171
  v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
173
172
  }
174
173
 
175
- if(u_aimate.x == Animate) {
174
+ if(u_animate.x == Animate) {
176
175
  v_distance_ratio = segmentIndex / segmentNumber;
177
176
  }
178
177
 
@@ -8,7 +8,7 @@ attribute float a_Size;
8
8
  uniform mat4 u_ModelMatrix;
9
9
  uniform mat4 u_Mvp;
10
10
  uniform float segmentNumber;
11
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
11
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
12
12
  varying vec4 v_color;
13
13
 
14
14
  uniform float u_lineDir: 1.0;
@@ -52,8 +52,10 @@ vec2 midPoint(vec2 source, vec2 target, float arcThetaOffset) {
52
52
  // return mid;
53
53
  }
54
54
  float getSegmentRatio(float index) {
55
- // return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
56
- return index / (segmentNumber - 1.);
55
+ // dash: index / (segmentNumber - 1.);
56
+ // normal: smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
57
+ return smoothstep(0.0, 1.0, index / (segmentNumber - 1.));
58
+ // return index / (segmentNumber - 1.);
57
59
  }
58
60
  vec2 interpolate (vec2 source, vec2 target, float t, float arcThetaOffset) {
59
61
  // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation
@@ -121,7 +123,7 @@ void main() {
121
123
  float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
122
124
  float d_distance_ratio;
123
125
 
124
- if(u_aimate.x == Animate) {
126
+ if(u_animate.x == Animate) {
125
127
  d_distance_ratio = segmentIndex / segmentNumber;
126
128
  if(u_lineDir != 1.0) {
127
129
  d_distance_ratio = 1.0 - d_distance_ratio;
@@ -7,7 +7,7 @@ attribute vec4 a_Instance;
7
7
  attribute float a_Size;
8
8
  uniform mat4 u_ModelMatrix;
9
9
  uniform float segmentNumber;
10
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
10
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
11
11
  varying vec4 v_color;
12
12
  varying vec2 v_normal;
13
13
 
@@ -72,7 +72,7 @@ void main() {
72
72
  float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
73
73
  v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
74
74
  }
75
- if(u_aimate.x == Animate) {
75
+ if(u_animate.x == Animate) {
76
76
  v_distance_ratio = segmentIndex / segmentNumber;
77
77
  }
78
78
  vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio), 0.0, 1.0));
@@ -19,7 +19,7 @@ varying vec2 v_iconMapUV;
19
19
  #pragma include "picking"
20
20
 
21
21
  uniform float u_time;
22
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ]; // 控制运动
22
+ uniform vec4 u_animate: [ 1, 2., 1.0, 0.2 ]; // 控制运动
23
23
 
24
24
  varying mat4 styleMappingMat;
25
25
  // [animate, duration, interval, trailLength],
@@ -31,10 +31,10 @@ void main() {
31
31
  // anti-alias
32
32
  // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
33
33
  gl_FragColor.a *= opacity; // 全局透明度
34
- if(u_aimate.x == Animate) {
35
- animateSpeed = u_time / u_aimate.y;
36
- float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + animateSpeed);
37
- alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;
34
+ if(u_animate.x == Animate) {
35
+ animateSpeed = u_time / u_animate.y;
36
+ float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
37
+ alpha = (alpha + u_animate.w -1.0) / u_animate.w;
38
38
  alpha = smoothstep(0., 1., alpha);
39
39
  gl_FragColor.a *= alpha;
40
40
  }
@@ -95,6 +95,5 @@ void main() {
95
95
  gl_FragColor.a *= mix(u_blur.g, u_blur.b, (blurV - 0.5)/0.5);
96
96
  }
97
97
 
98
-
99
98
  gl_FragColor = filterColor(gl_FragColor);
100
99
  }
@@ -15,7 +15,7 @@ attribute vec2 a_DistanceAndIndex;
15
15
 
16
16
  uniform mat4 u_ModelMatrix;
17
17
  uniform mat4 u_Mvp;
18
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
18
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
19
19
  uniform float u_icon_step: 100;
20
20
 
21
21
  uniform float u_heightfixed: 0.0;
@@ -6,9 +6,8 @@ uniform float u_blur : 0.9;
6
6
  varying float v_segmentIndex;
7
7
  uniform float segmentNumber;
8
8
 
9
-
10
9
  uniform float u_time;
11
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
10
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
12
11
 
13
12
  uniform float u_linearColor: 0;
14
13
  uniform vec4 u_sourceColor;
@@ -27,16 +26,16 @@ void main() {
27
26
 
28
27
  gl_FragColor.a *= opacity;
29
28
 
30
- if(u_aimate.x == Animate) {
31
- animateSpeed = u_time / u_aimate.y;
32
- float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_aimate.z)* (1.0/ u_aimate.z) + u_time / u_aimate.y);
29
+ if(u_animate.x == Animate) {
30
+ animateSpeed = u_time / u_animate.y;
31
+ float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
33
32
 
34
- alpha = (alpha + u_aimate.w -1.0) / u_aimate.w;
33
+ alpha = (alpha + u_animate.w -1.0) / u_animate.w;
35
34
  // alpha = smoothstep(0., 1., alpha);
36
35
  alpha = clamp(alpha, 0.0, 1.0);
37
36
  gl_FragColor.a *= alpha;
38
37
 
39
- // u_aimate
38
+ // u_animate
40
39
  // x enable
41
40
  // y duration
42
41
  // z interval
@@ -6,6 +6,7 @@ attribute vec3 a_Position;
6
6
  attribute vec4 a_Instance;
7
7
  attribute vec4 a_Color;
8
8
  attribute float a_Size;
9
+ attribute vec2 a_iconMapUV;
9
10
 
10
11
  uniform float u_globel;
11
12
  uniform float u_globel_radius;
@@ -13,23 +14,21 @@ uniform float u_global_height: 10;
13
14
  uniform mat4 u_ModelMatrix;
14
15
  uniform mat4 u_Mvp;
15
16
  uniform float segmentNumber;
16
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
17
- varying vec4 v_color;
18
- // varying vec2 v_normal;
17
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
18
+
19
19
  uniform float u_line_type: 0.0;
20
20
  uniform vec4 u_dash_array: [10.0, 5., 0, 0];
21
- varying vec4 v_dash_array;
22
-
23
21
  uniform float u_icon_step: 100;
24
22
  uniform float u_line_texture: 0.0;
25
- varying float v_segmentIndex;
23
+ uniform float u_opacity: 1.0;
26
24
 
27
- attribute vec2 a_iconMapUV;
25
+ varying vec4 v_dash_array;
26
+ varying vec4 v_color;
27
+ varying float v_segmentIndex;
28
28
  varying vec2 v_iconMapUV;
29
-
30
- uniform float u_opacity: 1.0;
31
29
  varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
32
30
 
31
+
33
32
  #pragma include "styleMapping"
34
33
  #pragma include "styleMappingCalOpacity"
35
34
 
@@ -85,11 +84,11 @@ float torad(float deg) {
85
84
 
86
85
  vec3 lglt2xyz(vec2 lnglat) {
87
86
  float pi = 3.1415926;
88
- // TODO: + Math.PI/2 是为了对齐坐标
87
+ // + Math.PI/2 是为了对齐坐标
89
88
  float lng = torad(lnglat.x) + pi / 2.0;
90
89
  float lat = torad(lnglat.y);
91
90
 
92
- // TODO: 手动增加一些偏移,减轻面的冲突
91
+ // 手动增加一些偏移,减轻面的冲突
93
92
  float radius = u_globel_radius;
94
93
 
95
94
  float z = radius * cos(lat) * cos(lng);
@@ -146,7 +145,7 @@ void main() {
146
145
  float total_Distance = pixelDistance(s, t) / 2.0 * PI;
147
146
  v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
148
147
  }
149
- if(u_aimate.x == Animate) {
148
+ if(u_animate.x == Animate) {
150
149
  d_distance_ratio = segmentIndex / segmentNumber;
151
150
  }
152
151
  styleMappingMat[3].g = d_distance_ratio; // 当前点位距离占线总长的比例
@@ -10,7 +10,7 @@ varying vec4 v_dash_array;
10
10
  varying vec4 v_color;
11
11
 
12
12
  uniform float u_time;
13
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
13
+ uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
14
14
 
15
15
  uniform float u_line_texture;
16
16
  uniform sampler2D u_texture;
@@ -0,0 +1,25 @@
1
+ attribute float a_Miter;
2
+ attribute vec4 a_Color;
3
+ attribute vec3 a_Normal;
4
+ attribute vec3 a_Position;
5
+
6
+ uniform mat4 u_ModelMatrix;
7
+ uniform mat4 u_Mvp;
8
+ uniform float u_size;
9
+
10
+ #pragma include "projection"
11
+
12
+ void main() {
13
+
14
+ vec3 size = a_Miter * u_size * reverse_offset_normal(a_Normal);
15
+
16
+ vec2 offset = project_pixel(size.xy);
17
+
18
+ vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
19
+
20
+ if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
21
+ gl_Position = u_Mvp * (vec4(project_pos.xy + offset, 0.0, 1.0));
22
+ } else {
23
+ gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 0.0, 1.0));
24
+ }
25
+ }