@antv/l7-layers 2.9.27-alpha.1 → 2.9.27-alpha.3

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 (302) hide show
  1. package/es/Geometry/index.d.ts +13 -0
  2. package/es/Geometry/index.js +20 -2
  3. package/es/Geometry/models/billboard.js +1 -2
  4. package/es/Geometry/models/plane.js +2 -4
  5. package/es/Geometry/models/sprite.js +2 -4
  6. package/es/canvas/index.d.ts +4 -0
  7. package/es/canvas/index.js +38 -2
  8. package/es/citybuliding/building.js +6 -2
  9. package/es/citybuliding/models/build.js +2 -3
  10. package/es/core/BaseLayer.d.ts +17 -6
  11. package/es/core/BaseLayer.js +89 -94
  12. package/es/core/BaseModel.d.ts +1 -1
  13. package/es/core/BaseModel.js +7 -3
  14. package/es/core/interface.d.ts +18 -0
  15. package/es/core/triangulation.d.ts +6 -0
  16. package/es/core/triangulation.js +64 -2
  17. package/es/earth/index.d.ts +5 -0
  18. package/es/earth/index.js +12 -1
  19. package/es/earth/models/base.js +2 -4
  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.js +6 -2
  23. package/es/heatmap/models/heatmap.js +5 -3
  24. package/es/image/index.js +6 -2
  25. package/es/image/models/dataImage.js +4 -7
  26. package/es/image/models/image.js +4 -7
  27. package/es/line/index.d.ts +1 -0
  28. package/es/line/index.js +8 -2
  29. package/es/line/models/arc.js +6 -5
  30. package/es/line/models/half.js +3 -4
  31. package/es/line/models/line.js +9 -8
  32. package/es/line/models/simpleLine.js +2 -1
  33. package/es/line/models/simpleTileLine.d.ts +9 -0
  34. package/es/line/models/simpleTileLine.js +100 -0
  35. package/es/line/models/tile.d.ts +1 -4
  36. package/es/line/models/tile.js +49 -222
  37. package/es/line/models/wall.js +10 -46
  38. package/es/line/shaders/dash/arc_dash_vert.glsl +2 -0
  39. package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
  40. package/es/line/shaders/line_arc2d_vert.glsl +1 -1
  41. package/es/line/shaders/line_arc_3d_frag.glsl +1 -1
  42. package/es/line/shaders/line_arc_3d_vert.glsl +3 -3
  43. package/es/line/shaders/line_arc_frag.glsl +1 -1
  44. package/es/line/shaders/line_arc_great_circle_frag.glsl +1 -1
  45. package/es/line/shaders/line_arc_great_circle_vert.glsl +1 -1
  46. package/es/line/shaders/line_arc_vert.glsl +5 -3
  47. package/es/line/shaders/line_bezier_vert.glsl +1 -1
  48. package/es/line/shaders/line_frag.glsl +1 -2
  49. package/es/line/shaders/line_vert.glsl +1 -1
  50. package/es/line/shaders/linear/arc3d_linear_frag.glsl +1 -1
  51. package/es/line/shaders/linear/arc3d_linear_vert.glsl +3 -3
  52. package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
  53. package/es/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  54. package/es/line/shaders/tile/line_tile_vert.glsl +19 -177
  55. package/es/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  56. package/es/line/shaders/tile/simpleline_vert.glsl +21 -0
  57. package/es/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +17 -21
  58. package/es/line/shaders/wall/wall_vert.glsl +77 -0
  59. package/es/mask/index.d.ts +1 -0
  60. package/es/mask/index.js +80 -5
  61. package/es/mask/models/fill.d.ts +2 -1
  62. package/es/mask/models/fill.js +13 -10
  63. package/es/mask/shaders/mask_vert.glsl +0 -6
  64. package/es/plugins/DataMappingPlugin.d.ts +4 -3
  65. package/es/plugins/DataMappingPlugin.js +129 -58
  66. package/es/plugins/DataSourcePlugin.js +3 -2
  67. package/es/plugins/FeatureScalePlugin.d.ts +0 -2
  68. package/es/plugins/FeatureScalePlugin.js +8 -51
  69. package/es/plugins/LayerAnimateStylePlugin.d.ts +0 -2
  70. package/es/plugins/LayerAnimateStylePlugin.js +7 -27
  71. package/es/plugins/LayerModelPlugin.js +2 -6
  72. package/es/plugins/LightingPlugin.js +1 -7
  73. package/es/plugins/MultiPassRendererPlugin.d.ts +0 -1
  74. package/es/plugins/MultiPassRendererPlugin.js +4 -16
  75. package/es/plugins/PixelPickingPlugin.d.ts +1 -1
  76. package/es/plugins/PixelPickingPlugin.js +8 -28
  77. package/es/plugins/RegisterStyleAttributePlugin.d.ts +4 -0
  78. package/es/plugins/RegisterStyleAttributePlugin.js +56 -5
  79. package/es/plugins/UpdateStyleAttributePlugin.js +2 -9
  80. package/es/point/index.js +6 -2
  81. package/es/point/models/fill.js +2 -2
  82. package/es/point/models/fillmage.js +1 -1
  83. package/es/point/models/image.js +1 -1
  84. package/es/point/models/normal.d.ts +0 -1
  85. package/es/point/models/normal.js +9 -60
  86. package/es/point/models/radar.js +4 -69
  87. package/es/point/models/simplePoint.d.ts +0 -1
  88. package/es/point/models/simplePoint.js +2 -11
  89. package/es/point/models/text.js +6 -7
  90. package/es/point/models/tile.d.ts +0 -7
  91. package/es/point/models/tile.js +22 -155
  92. package/es/point/models/tileText.d.ts +0 -4
  93. package/es/point/models/tileText.js +98 -185
  94. package/es/point/shaders/animate/wave_frag.glsl +3 -3
  95. package/es/point/shaders/earth/fill_vert.glsl +0 -1
  96. package/es/point/shaders/fill_vert.glsl +0 -1
  97. package/es/point/shaders/normal_frag.glsl +1 -10
  98. package/es/point/shaders/normal_vert.glsl +5 -60
  99. package/es/point/shaders/radar/radar_frag.glsl +4 -15
  100. package/es/point/shaders/radar/radar_vert.glsl +4 -54
  101. package/es/point/shaders/tile/fill_tile_frag.glsl +10 -17
  102. package/es/point/shaders/tile/fill_tile_vert.glsl +20 -123
  103. package/es/point/shaders/tile/text_frag.glsl +33 -0
  104. package/es/point/shaders/tile/text_map_frag.glsl +31 -0
  105. package/es/point/shaders/tile/text_map_vert.glsl +38 -0
  106. package/es/point/shaders/tile/text_vert.glsl +48 -0
  107. package/es/polygon/index.js +6 -2
  108. package/es/polygon/models/extrude.js +1 -3
  109. package/es/polygon/models/fill.js +3 -4
  110. package/es/polygon/models/ocean.d.ts +0 -2
  111. package/es/polygon/models/ocean.js +13 -47
  112. package/es/polygon/models/tile.d.ts +1 -4
  113. package/es/polygon/models/tile.js +25 -57
  114. package/es/polygon/models/water.d.ts +0 -2
  115. package/es/polygon/models/water.js +13 -47
  116. package/es/polygon/shaders/polygon_frag.glsl +2 -2
  117. package/es/polygon/shaders/polygon_vert.glsl +2 -2
  118. package/es/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  119. package/es/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  120. package/es/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  121. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  122. package/es/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  123. package/es/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  124. package/es/raster/buffers/triangulation.js +1 -4
  125. package/es/raster/index.js +6 -2
  126. package/es/raster/models/raster.js +3 -2
  127. package/es/shader/minify_frag.glsl +7 -0
  128. package/es/shader/minify_picking_frag.glsl +10 -0
  129. package/es/tile/manager/baseMapTileLayerManager.d.ts +29 -0
  130. package/es/tile/manager/baseMapTileLayerManager.js +207 -0
  131. package/es/tile/manager/tileLayerManager.d.ts +2 -2
  132. package/es/tile/manager/tileLayerManager.js +2 -2
  133. package/es/tile/manager/tilePickerManager.d.ts +2 -3
  134. package/es/tile/manager/tilePickerManager.js +1 -2
  135. package/es/tile/models/tileModel.d.ts +1 -0
  136. package/es/tile/models/tileModel.js +18 -2
  137. package/es/tile/tileFactory/base.d.ts +1 -1
  138. package/es/tile/tileFactory/base.js +58 -33
  139. package/es/tile/tileFactory/line.js +3 -0
  140. package/es/tile/tileFactory/point.js +3 -0
  141. package/es/tile/tileFactory/polygon.js +3 -0
  142. package/es/tile/tileFactory/raster.js +3 -0
  143. package/es/tile/tileFactory/rasterData.js +3 -0
  144. package/es/tile/tileFactory/rasterDataLayer.js +6 -2
  145. package/es/tile/tileFactory/test.js +26 -5
  146. package/es/tile/tileFactory/vectorLayer.d.ts +4 -1
  147. package/es/tile/tileFactory/vectorLayer.js +110 -7
  148. package/es/tile/tileLayer/baseMapTileLayer.d.ts +29 -0
  149. package/es/tile/tileLayer/baseMapTileLayer.js +188 -0
  150. package/es/tile/tileLayer/baseTileLayer.d.ts +4 -4
  151. package/es/tile/tileLayer/baseTileLayer.js +46 -75
  152. package/es/tile/tileTest.d.ts +1 -0
  153. package/es/tile/tileTest.js +3 -2
  154. package/es/tile/tmsMapTileLayer.d.ts +9 -0
  155. package/es/tile/tmsMapTileLayer.js +119 -0
  156. package/es/tile/tmsTileLayer.d.ts +2 -0
  157. package/es/tile/tmsTileLayer.js +24 -2
  158. package/es/tile/utils.d.ts +4 -0
  159. package/es/tile/utils.js +30 -0
  160. package/es/utils/dataMappingStyle.js +3 -0
  161. package/es/utils/layerData.js +2 -2
  162. package/es/utils/updateShape.js +2 -2
  163. package/es/wind/index.js +6 -2
  164. package/es/wind/models/wind.js +8 -8
  165. package/es/wind/shaders/wind_vert.glsl +1 -1
  166. package/lib/Geometry/index.js +19 -2
  167. package/lib/Geometry/models/billboard.js +1 -2
  168. package/lib/Geometry/models/plane.js +2 -4
  169. package/lib/Geometry/models/sprite.js +2 -4
  170. package/lib/canvas/index.js +37 -2
  171. package/lib/citybuliding/building.js +6 -2
  172. package/lib/citybuliding/models/build.js +2 -3
  173. package/lib/core/BaseLayer.js +86 -94
  174. package/lib/core/BaseModel.js +7 -3
  175. package/lib/core/triangulation.js +66 -2
  176. package/lib/earth/index.js +11 -1
  177. package/lib/earth/models/base.js +2 -4
  178. package/lib/earth/shaders/atmosphere_frag.glsl +1 -1
  179. package/lib/earth/shaders/bloomsphere_frag.glsl +1 -1
  180. package/lib/heatmap/index.js +6 -2
  181. package/lib/heatmap/models/heatmap.js +5 -3
  182. package/lib/image/index.js +6 -2
  183. package/lib/image/models/dataImage.js +4 -7
  184. package/lib/image/models/image.js +4 -7
  185. package/lib/line/index.js +7 -2
  186. package/lib/line/models/arc.js +6 -5
  187. package/lib/line/models/half.js +3 -4
  188. package/lib/line/models/line.js +9 -8
  189. package/lib/line/models/simpleLine.js +2 -1
  190. package/lib/line/models/simpleTileLine.js +115 -0
  191. package/lib/line/models/tile.js +49 -223
  192. package/lib/line/models/wall.js +10 -46
  193. package/lib/line/shaders/dash/arc_dash_vert.glsl +2 -0
  194. package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
  195. package/lib/line/shaders/line_arc2d_vert.glsl +1 -1
  196. package/lib/line/shaders/line_arc_3d_frag.glsl +1 -1
  197. package/lib/line/shaders/line_arc_3d_vert.glsl +3 -3
  198. package/lib/line/shaders/line_arc_frag.glsl +1 -1
  199. package/lib/line/shaders/line_arc_great_circle_frag.glsl +1 -1
  200. package/lib/line/shaders/line_arc_great_circle_vert.glsl +1 -1
  201. package/lib/line/shaders/line_arc_vert.glsl +5 -3
  202. package/lib/line/shaders/line_bezier_vert.glsl +1 -1
  203. package/lib/line/shaders/line_frag.glsl +1 -2
  204. package/lib/line/shaders/line_vert.glsl +1 -1
  205. package/lib/line/shaders/linear/arc3d_linear_frag.glsl +1 -1
  206. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +3 -3
  207. package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
  208. package/lib/line/shaders/tile/line_tile_map_vert.glsl +25 -0
  209. package/lib/line/shaders/tile/line_tile_vert.glsl +19 -177
  210. package/lib/line/shaders/tile/simpleline_map_vert.glsl +15 -0
  211. package/lib/line/shaders/tile/simpleline_vert.glsl +21 -0
  212. package/lib/line/shaders/{wall_frag.glsl → wall/wall_frag.glsl} +17 -21
  213. package/lib/line/shaders/wall/wall_vert.glsl +77 -0
  214. package/lib/mask/index.js +82 -5
  215. package/lib/mask/models/fill.js +14 -10
  216. package/lib/mask/shaders/mask_vert.glsl +0 -6
  217. package/lib/plugins/DataMappingPlugin.js +127 -57
  218. package/lib/plugins/DataSourcePlugin.js +3 -2
  219. package/lib/plugins/FeatureScalePlugin.js +6 -50
  220. package/lib/plugins/LayerAnimateStylePlugin.js +6 -29
  221. package/lib/plugins/LayerModelPlugin.js +2 -6
  222. package/lib/plugins/LightingPlugin.js +1 -7
  223. package/lib/plugins/MultiPassRendererPlugin.js +3 -19
  224. package/lib/plugins/PixelPickingPlugin.js +8 -28
  225. package/lib/plugins/RegisterStyleAttributePlugin.js +56 -5
  226. package/lib/plugins/UpdateStyleAttributePlugin.js +2 -9
  227. package/lib/point/index.js +6 -2
  228. package/lib/point/models/fill.js +2 -2
  229. package/lib/point/models/fillmage.js +1 -1
  230. package/lib/point/models/image.js +1 -1
  231. package/lib/point/models/normal.js +8 -59
  232. package/lib/point/models/radar.js +4 -69
  233. package/lib/point/models/simplePoint.js +1 -10
  234. package/lib/point/models/text.js +6 -7
  235. package/lib/point/models/tile.js +21 -156
  236. package/lib/point/models/tileText.js +97 -184
  237. package/lib/point/shaders/animate/wave_frag.glsl +3 -3
  238. package/lib/point/shaders/earth/fill_vert.glsl +0 -1
  239. package/lib/point/shaders/fill_vert.glsl +0 -1
  240. package/lib/point/shaders/normal_frag.glsl +1 -10
  241. package/lib/point/shaders/normal_vert.glsl +5 -60
  242. package/lib/point/shaders/radar/radar_frag.glsl +4 -15
  243. package/lib/point/shaders/radar/radar_vert.glsl +4 -54
  244. package/lib/point/shaders/tile/fill_tile_frag.glsl +10 -17
  245. package/lib/point/shaders/tile/fill_tile_vert.glsl +20 -123
  246. package/lib/point/shaders/tile/text_frag.glsl +33 -0
  247. package/lib/point/shaders/tile/text_map_frag.glsl +31 -0
  248. package/lib/point/shaders/tile/text_map_vert.glsl +38 -0
  249. package/lib/point/shaders/tile/text_vert.glsl +48 -0
  250. package/lib/polygon/index.js +6 -2
  251. package/lib/polygon/models/extrude.js +1 -3
  252. package/lib/polygon/models/fill.js +3 -4
  253. package/lib/polygon/models/ocean.js +14 -47
  254. package/lib/polygon/models/tile.js +24 -57
  255. package/lib/polygon/models/water.js +14 -47
  256. package/lib/polygon/shaders/polygon_frag.glsl +2 -2
  257. package/lib/polygon/shaders/polygon_vert.glsl +2 -2
  258. package/lib/polygon/shaders/tile/polygon_tile_map_vert.glsl +16 -0
  259. package/lib/polygon/shaders/tile/polygon_tile_vert.glsl +20 -60
  260. package/lib/polygon/shaders/water/polygon_ocean_frag.glsl +1 -2
  261. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +0 -31
  262. package/lib/polygon/shaders/water/polygon_water_frag.glsl +1 -3
  263. package/lib/polygon/shaders/water/polygon_water_vert.glsl +0 -29
  264. package/lib/raster/buffers/triangulation.js +1 -4
  265. package/lib/raster/index.js +6 -2
  266. package/lib/raster/models/raster.js +3 -2
  267. package/lib/shader/minify_frag.glsl +7 -0
  268. package/lib/shader/minify_picking_frag.glsl +10 -0
  269. package/lib/tile/manager/baseMapTileLayerManager.js +222 -0
  270. package/lib/tile/manager/tileLayerManager.js +2 -2
  271. package/lib/tile/manager/tilePickerManager.js +1 -2
  272. package/lib/tile/models/tileModel.js +19 -2
  273. package/lib/tile/tileFactory/base.js +60 -33
  274. package/lib/tile/tileFactory/line.js +3 -0
  275. package/lib/tile/tileFactory/point.js +3 -0
  276. package/lib/tile/tileFactory/polygon.js +3 -0
  277. package/lib/tile/tileFactory/raster.js +3 -0
  278. package/lib/tile/tileFactory/rasterData.js +3 -0
  279. package/lib/tile/tileFactory/rasterDataLayer.js +6 -2
  280. package/lib/tile/tileFactory/test.js +26 -5
  281. package/lib/tile/tileFactory/vectorLayer.js +112 -8
  282. package/lib/tile/tileLayer/baseMapTileLayer.js +195 -0
  283. package/lib/tile/tileLayer/baseTileLayer.js +46 -75
  284. package/lib/tile/tileTest.js +3 -2
  285. package/lib/tile/tmsMapTileLayer.js +136 -0
  286. package/lib/tile/tmsTileLayer.js +25 -2
  287. package/lib/tile/utils.js +38 -0
  288. package/lib/utils/dataMappingStyle.js +3 -0
  289. package/lib/utils/layerData.js +2 -2
  290. package/lib/utils/updateShape.js +2 -2
  291. package/lib/wind/index.js +6 -2
  292. package/lib/wind/models/wind.js +7 -7
  293. package/lib/wind/shaders/wind_vert.glsl +1 -1
  294. package/package.json +8 -7
  295. package/es/line/shaders/tile/line_tile_frag.glsl +0 -79
  296. package/es/line/shaders/wall_vert.glsl +0 -111
  297. package/es/mask/shaders/mask_frag.glsl +0 -7
  298. package/es/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
  299. package/lib/line/shaders/tile/line_tile_frag.glsl +0 -79
  300. package/lib/line/shaders/wall_vert.glsl +0 -111
  301. package/lib/mask/shaders/mask_frag.glsl +0 -7
  302. package/lib/polygon/shaders/tile/polygon_tile_frag.glsl +0 -12
@@ -8,7 +8,7 @@ varying vec2 v_texCoord;
8
8
  void main() {
9
9
  v_texCoord = a_Uv;
10
10
  vec4 project_pos = project_position(vec4(a_Position, 1.0));
11
- // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
11
+
12
12
  if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
13
13
  gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));
14
14
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-layers",
3
- "version": "2.9.27-alpha.1",
3
+ "version": "2.9.27-alpha.3",
4
4
  "description": "L7's collection of built-in layers",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -26,13 +26,14 @@
26
26
  "author": "xiaoiver",
27
27
  "license": "ISC",
28
28
  "dependencies": {
29
- "@antv/async-hook": "^2.1.0",
30
- "@antv/l7-core": "2.9.27-alpha.1",
31
- "@antv/l7-maps": "2.9.27-alpha.1",
32
- "@antv/l7-source": "2.9.27-alpha.1",
33
- "@antv/l7-utils": "2.9.27-alpha.1",
29
+ "@antv/async-hook": "^2.2.2",
30
+ "@antv/l7-core": "2.9.27-alpha.3",
31
+ "@antv/l7-maps": "2.9.27-alpha.3",
32
+ "@antv/l7-source": "2.9.27-alpha.3",
33
+ "@antv/l7-utils": "2.9.27-alpha.3",
34
34
  "@babel/runtime": "^7.7.7",
35
35
  "@mapbox/martini": "^0.2.0",
36
+ "@turf/clone": "^6.5.0",
36
37
  "@turf/helpers": "^6.1.4",
37
38
  "@turf/meta": "^6.0.2",
38
39
  "@turf/polygon-to-line": "^6.5.0",
@@ -60,7 +61,7 @@
60
61
  "@types/gl-matrix": "^2.4.5",
61
62
  "@types/lodash": "^4.14.138"
62
63
  },
63
- "gitHead": "4de1a35dd04dcb651d469b77aa66ab821453005c",
64
+ "gitHead": "395ceeac3d64e838604f6acf8a84668488762ee3",
64
65
  "publishConfig": {
65
66
  "access": "public"
66
67
  }
@@ -1,79 +0,0 @@
1
- #define LineTexture 1.0
2
- uniform float u_blur : 0.99;
3
- uniform float u_opacity : 1.0;
4
- uniform float u_textureBlend;
5
-
6
- uniform float u_borderWidth: 0.0;
7
- uniform vec4 u_borderColor;
8
- varying vec4 v_color;
9
-
10
- // line texture
11
- uniform float u_line_texture;
12
- uniform sampler2D u_texture;
13
- uniform vec2 u_textSize;
14
-
15
- varying vec2 v_iconMapUV;
16
-
17
- #pragma include "picking"
18
-
19
- varying mat4 styleMappingMat;
20
-
21
- void main() {
22
- float opacity = styleMappingMat[0][0];
23
- float d_distance_ratio = styleMappingMat[3].r; // 当前点位距离占线总长的比例
24
- gl_FragColor = v_color;
25
- // anti-alias
26
- // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
27
- gl_FragColor.a *= opacity; // 全局透明度
28
-
29
-
30
- if(u_line_texture == LineTexture) { // while load texture
31
- float aDistance = styleMappingMat[3].g; // 当前顶点的距离
32
- float d_texPixelLen = styleMappingMat[3].b; // 贴图的像素长度,根据地图层级缩放
33
- float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen);
34
- float v = styleMappingMat[3].a; // 线图层贴图部分的 v 坐标值
35
-
36
- // v = max(smoothstep(0.95, 1.0, v), v);
37
- vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
38
-
39
- // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, vec2(u, v)));
40
- // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv));
41
- vec4 pattern = texture2D(u_texture, uv);
42
-
43
- if(u_textureBlend == 0.0) { // normal
44
- pattern.a = 0.0;
45
- gl_FragColor += pattern;
46
- } else { // replace
47
- pattern.a *= opacity;
48
- if(gl_FragColor.a <= 0.0) {
49
- pattern.a = 0.0;
50
- }
51
- gl_FragColor = pattern;
52
- }
53
- }
54
-
55
- float v = styleMappingMat[3].a;
56
- float borderWidth = min(0.5, u_borderWidth);
57
- // 绘制 border
58
- if(borderWidth > 0.01) {
59
- float borderOuterWidth = borderWidth/2.0;
60
-
61
- if(v >= 1.0 - borderWidth || v <= borderWidth) {
62
- if(v > borderWidth) {
63
- float linear = smoothstep(0.0, 1.0, (v - (1.0 - borderWidth))/borderWidth);
64
- gl_FragColor.rgb = mix(gl_FragColor.rgb, u_borderColor.rgb, linear);
65
- } else if(v <= borderWidth) {
66
- float linear = smoothstep(0.0, 1.0, v/borderWidth);
67
- gl_FragColor.rgb = mix(u_borderColor.rgb, gl_FragColor.rgb, linear);
68
- }
69
- }
70
-
71
- if(v < borderOuterWidth) {
72
- gl_FragColor.a = mix(0.0, gl_FragColor.a, v/borderOuterWidth);
73
- } else if(v > 1.0 - borderOuterWidth) {
74
- gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);
75
- }
76
- }
77
-
78
- gl_FragColor = filterColor(gl_FragColor);
79
- }
@@ -1,111 +0,0 @@
1
- #define Animate 0.0
2
-
3
- attribute float a_Miter;
4
- attribute vec4 a_Color;
5
- attribute vec2 a_Size;
6
- attribute vec3 a_Normal;
7
- attribute vec3 a_Position;
8
- attribute vec2 a_iconMapUV;
9
-
10
- attribute float a_Total_Distance;
11
- attribute float a_Distance;
12
-
13
- uniform mat4 u_ModelMatrix;
14
- uniform mat4 u_Mvp;
15
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
16
- uniform float u_icon_step: 100;
17
- uniform float u_heightfixed;
18
-
19
- #pragma include "projection"
20
- #pragma include "light"
21
- #pragma include "picking"
22
-
23
- varying vec4 v_color;
24
- varying float v_blur;
25
-
26
- // texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)
27
- varying vec2 v_iconMapUV;
28
-
29
- uniform float u_linearColor: 0;
30
-
31
- uniform float u_opacity: 1.0;
32
- varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
33
-
34
- #pragma include "styleMapping"
35
- #pragma include "light"
36
- #pragma include "styleMappingCalOpacity"
37
-
38
- void main() {
39
- // cal style mapping - 数据纹理映射部分的计算
40
- styleMappingMat = mat4(
41
- 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
42
- 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
43
- 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
44
- 0.0, 0.0, 0.0, 0.0 // distance_ratio/distance/pixelLen/texV
45
- );
46
-
47
- float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
48
- float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
49
- float columnWidth = 1.0/columnCount; // 列宽
50
- float rowHeight = 1.0/rowCount; // 行高
51
- float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
52
- float id = a_vertexId; // 第n个顶点
53
- float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
54
- float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
55
-
56
- // cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
57
- // 按顺序从 cell 中取值、若没有则自动往下取值
58
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
59
-
60
- vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
61
- styleMappingMat[0][0] = opacityAndOffset.r;
62
- textureOffset = opacityAndOffset.g;
63
- // cal style mapping - 数据纹理映射部分的计算
64
-
65
- float d_distance_ratio; // 当前点位距离占线总长的比例
66
- float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放
67
-
68
- v_iconMapUV = a_iconMapUV;
69
- if(u_heightfixed < 1.0) { // 高度随 zoom 调整
70
- d_texPixelLen = project_pixel(u_icon_step);
71
- } else {
72
- d_texPixelLen = u_icon_step;
73
- }
74
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
75
- d_texPixelLen *= 10.0;
76
- }
77
-
78
- if(u_aimate.x == Animate || u_linearColor == 1.0) {
79
- d_distance_ratio = a_Distance / a_Total_Distance;
80
- }
81
-
82
- float miter = (a_Miter + 1.0)/2.0;
83
- // 设置数据集的参数
84
- styleMappingMat[3][0] = d_distance_ratio; // 当前点位距离占线总长的比例
85
- styleMappingMat[3][1] = a_Distance; // 当前顶点的距离
86
- styleMappingMat[3][2] = d_texPixelLen; // 贴图的像素长度,根据地图层级缩放
87
- styleMappingMat[3][3] = miter; // 线图层贴图部分的 v 坐标值 0 - 1
88
-
89
- vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
90
-
91
- float originSize = a_Size.x; // 固定高度
92
- if(u_heightfixed < 1.0) { // 高度随 zoom 调整
93
- originSize = project_float_pixel(a_Size.x);
94
- }
95
-
96
- float wallHeight = originSize * miter;
97
- float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));
98
-
99
- v_blur = min(project_float_pixel(2.0) / originSize, 0.05);
100
-
101
- v_color = vec4(a_Color.rgb * lightWeight, a_Color.w);
102
- // v_color = a_Color;
103
-
104
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
105
- gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));
106
- } else {
107
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));
108
- }
109
-
110
- setPickingColor(a_PickingColor);
111
- }
@@ -1,7 +0,0 @@
1
- uniform float u_opacity;
2
- varying vec4 v_Color;
3
-
4
- void main() {
5
- gl_FragColor = v_Color;
6
- gl_FragColor.a *= u_opacity;
7
- }
@@ -1,12 +0,0 @@
1
- uniform float u_opacity: 1.0;
2
- varying vec4 v_Color;
3
- varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
4
-
5
- #pragma include "picking"
6
-
7
- void main() {
8
- float opacity = styleMappingMat[0][0];
9
- gl_FragColor = v_Color;
10
- gl_FragColor.a *= opacity;
11
- gl_FragColor = filterColor(gl_FragColor);
12
- }
@@ -1,79 +0,0 @@
1
- #define LineTexture 1.0
2
- uniform float u_blur : 0.99;
3
- uniform float u_opacity : 1.0;
4
- uniform float u_textureBlend;
5
-
6
- uniform float u_borderWidth: 0.0;
7
- uniform vec4 u_borderColor;
8
- varying vec4 v_color;
9
-
10
- // line texture
11
- uniform float u_line_texture;
12
- uniform sampler2D u_texture;
13
- uniform vec2 u_textSize;
14
-
15
- varying vec2 v_iconMapUV;
16
-
17
- #pragma include "picking"
18
-
19
- varying mat4 styleMappingMat;
20
-
21
- void main() {
22
- float opacity = styleMappingMat[0][0];
23
- float d_distance_ratio = styleMappingMat[3].r; // 当前点位距离占线总长的比例
24
- gl_FragColor = v_color;
25
- // anti-alias
26
- // float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
27
- gl_FragColor.a *= opacity; // 全局透明度
28
-
29
-
30
- if(u_line_texture == LineTexture) { // while load texture
31
- float aDistance = styleMappingMat[3].g; // 当前顶点的距离
32
- float d_texPixelLen = styleMappingMat[3].b; // 贴图的像素长度,根据地图层级缩放
33
- float u = fract(mod(aDistance, d_texPixelLen)/d_texPixelLen);
34
- float v = styleMappingMat[3].a; // 线图层贴图部分的 v 坐标值
35
-
36
- // v = max(smoothstep(0.95, 1.0, v), v);
37
- vec2 uv= v_iconMapUV / u_textSize + vec2(u, v) / u_textSize * 64.;
38
-
39
- // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, vec2(u, v)));
40
- // gl_FragColor = filterColor(gl_FragColor + texture2D(u_texture, uv));
41
- vec4 pattern = texture2D(u_texture, uv);
42
-
43
- if(u_textureBlend == 0.0) { // normal
44
- pattern.a = 0.0;
45
- gl_FragColor += pattern;
46
- } else { // replace
47
- pattern.a *= opacity;
48
- if(gl_FragColor.a <= 0.0) {
49
- pattern.a = 0.0;
50
- }
51
- gl_FragColor = pattern;
52
- }
53
- }
54
-
55
- float v = styleMappingMat[3].a;
56
- float borderWidth = min(0.5, u_borderWidth);
57
- // 绘制 border
58
- if(borderWidth > 0.01) {
59
- float borderOuterWidth = borderWidth/2.0;
60
-
61
- if(v >= 1.0 - borderWidth || v <= borderWidth) {
62
- if(v > borderWidth) {
63
- float linear = smoothstep(0.0, 1.0, (v - (1.0 - borderWidth))/borderWidth);
64
- gl_FragColor.rgb = mix(gl_FragColor.rgb, u_borderColor.rgb, linear);
65
- } else if(v <= borderWidth) {
66
- float linear = smoothstep(0.0, 1.0, v/borderWidth);
67
- gl_FragColor.rgb = mix(u_borderColor.rgb, gl_FragColor.rgb, linear);
68
- }
69
- }
70
-
71
- if(v < borderOuterWidth) {
72
- gl_FragColor.a = mix(0.0, gl_FragColor.a, v/borderOuterWidth);
73
- } else if(v > 1.0 - borderOuterWidth) {
74
- gl_FragColor.a = mix(gl_FragColor.a, 0.0, (v - (1.0 - borderOuterWidth))/borderOuterWidth);
75
- }
76
- }
77
-
78
- gl_FragColor = filterColor(gl_FragColor);
79
- }
@@ -1,111 +0,0 @@
1
- #define Animate 0.0
2
-
3
- attribute float a_Miter;
4
- attribute vec4 a_Color;
5
- attribute vec2 a_Size;
6
- attribute vec3 a_Normal;
7
- attribute vec3 a_Position;
8
- attribute vec2 a_iconMapUV;
9
-
10
- attribute float a_Total_Distance;
11
- attribute float a_Distance;
12
-
13
- uniform mat4 u_ModelMatrix;
14
- uniform mat4 u_Mvp;
15
- uniform vec4 u_aimate: [ 0, 2., 1.0, 0.2 ];
16
- uniform float u_icon_step: 100;
17
- uniform float u_heightfixed;
18
-
19
- #pragma include "projection"
20
- #pragma include "light"
21
- #pragma include "picking"
22
-
23
- varying vec4 v_color;
24
- varying float v_blur;
25
-
26
- // texV 线图层 - 贴图部分的 v 坐标(线的宽度方向)
27
- varying vec2 v_iconMapUV;
28
-
29
- uniform float u_linearColor: 0;
30
-
31
- uniform float u_opacity: 1.0;
32
- varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
33
-
34
- #pragma include "styleMapping"
35
- #pragma include "light"
36
- #pragma include "styleMappingCalOpacity"
37
-
38
- void main() {
39
- // cal style mapping - 数据纹理映射部分的计算
40
- styleMappingMat = mat4(
41
- 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty
42
- 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA
43
- 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]
44
- 0.0, 0.0, 0.0, 0.0 // distance_ratio/distance/pixelLen/texV
45
- );
46
-
47
- float rowCount = u_cellTypeLayout[0][0]; // 当前的数据纹理有几行
48
- float columnCount = u_cellTypeLayout[0][1]; // 当看到数据纹理有几列
49
- float columnWidth = 1.0/columnCount; // 列宽
50
- float rowHeight = 1.0/rowCount; // 行高
51
- float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets
52
- float id = a_vertexId; // 第n个顶点
53
- float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // 起始点在第几行
54
- float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // 起始点在第几列
55
-
56
- // cell 固定顺序 opacity -> strokeOpacity -> strokeWidth -> stroke ...
57
- // 按顺序从 cell 中取值、若没有则自动往下取值
58
- float textureOffset = 0.0; // 在 cell 中取值的偏移量
59
-
60
- vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);
61
- styleMappingMat[0][0] = opacityAndOffset.r;
62
- textureOffset = opacityAndOffset.g;
63
- // cal style mapping - 数据纹理映射部分的计算
64
-
65
- float d_distance_ratio; // 当前点位距离占线总长的比例
66
- float d_texPixelLen; // 贴图的像素长度,根据地图层级缩放
67
-
68
- v_iconMapUV = a_iconMapUV;
69
- if(u_heightfixed < 1.0) { // 高度随 zoom 调整
70
- d_texPixelLen = project_pixel(u_icon_step);
71
- } else {
72
- d_texPixelLen = u_icon_step;
73
- }
74
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) {
75
- d_texPixelLen *= 10.0;
76
- }
77
-
78
- if(u_aimate.x == Animate || u_linearColor == 1.0) {
79
- d_distance_ratio = a_Distance / a_Total_Distance;
80
- }
81
-
82
- float miter = (a_Miter + 1.0)/2.0;
83
- // 设置数据集的参数
84
- styleMappingMat[3][0] = d_distance_ratio; // 当前点位距离占线总长的比例
85
- styleMappingMat[3][1] = a_Distance; // 当前顶点的距离
86
- styleMappingMat[3][2] = d_texPixelLen; // 贴图的像素长度,根据地图层级缩放
87
- styleMappingMat[3][3] = miter; // 线图层贴图部分的 v 坐标值 0 - 1
88
-
89
- vec4 project_pos = project_position(vec4(a_Position.xy, 0, 1.0));
90
-
91
- float originSize = a_Size.x; // 固定高度
92
- if(u_heightfixed < 1.0) { // 高度随 zoom 调整
93
- originSize = project_float_pixel(a_Size.x);
94
- }
95
-
96
- float wallHeight = originSize * miter;
97
- float lightWeight = calc_lighting(vec4(project_pos.xy, wallHeight, 1.0));
98
-
99
- v_blur = min(project_float_pixel(2.0) / originSize, 0.05);
100
-
101
- v_color = vec4(a_Color.rgb * lightWeight, a_Color.w);
102
- // v_color = a_Color;
103
-
104
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
105
- gl_Position = u_Mvp * (vec4(project_pos.xy, wallHeight, 1.0));
106
- } else {
107
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, wallHeight, 1.0));
108
- }
109
-
110
- setPickingColor(a_PickingColor);
111
- }
@@ -1,7 +0,0 @@
1
- uniform float u_opacity;
2
- varying vec4 v_Color;
3
-
4
- void main() {
5
- gl_FragColor = v_Color;
6
- gl_FragColor.a *= u_opacity;
7
- }
@@ -1,12 +0,0 @@
1
- uniform float u_opacity: 1.0;
2
- varying vec4 v_Color;
3
- varying mat4 styleMappingMat; // 传递从片元中传递的映射数据
4
-
5
- #pragma include "picking"
6
-
7
- void main() {
8
- float opacity = styleMappingMat[0][0];
9
- gl_FragColor = v_Color;
10
- gl_FragColor.a *= opacity;
11
- gl_FragColor = filterColor(gl_FragColor);
12
- }