@antv/l7-layers 2.18.0 → 2.19.0

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 (218) hide show
  1. package/es/citybuliding/models/build.js +1 -1
  2. package/es/citybuliding/shaders/build_vert.glsl +0 -1
  3. package/es/core/BaseModel.d.ts +0 -20
  4. package/es/core/BaseModel.js +6 -2
  5. package/es/core/CommonStyleAttribute.js +40 -0
  6. package/es/core/interface.d.ts +5 -0
  7. package/es/{Geometry → geometry}/models/billboard.js +1 -1
  8. package/es/{Geometry → geometry}/models/plane.js +1 -1
  9. package/es/{Geometry → geometry}/models/sprite.js +1 -1
  10. package/{lib/Geometry → es/geometry}/shaders/billboard_vert.glsl +1 -8
  11. package/es/geometry/shaders/plane_vert.glsl +31 -0
  12. package/es/{Geometry → geometry}/shaders/sprite_vert.glsl +2 -8
  13. package/es/heatmap/models/grid.js +1 -1
  14. package/es/heatmap/models/grid3d.js +1 -1
  15. package/es/heatmap/models/heatmap.js +1 -1
  16. package/es/heatmap/models/hexagon.js +1 -1
  17. package/es/heatmap/shaders/grid_vert.glsl +1 -1
  18. package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +1 -1
  19. package/es/heatmap/shaders/hexagon_3d_vert.glsl +1 -1
  20. package/es/heatmap/shaders/hexagon_vert.glsl +1 -1
  21. package/es/image/models/image.js +1 -1
  22. package/es/image/shaders/image_vert.glsl +3 -7
  23. package/es/index.d.ts +1 -1
  24. package/es/index.js +1 -1
  25. package/es/line/models/arc.js +3 -3
  26. package/es/line/models/arc_3d.js +2 -2
  27. package/es/line/models/earthArc_3d.js +2 -2
  28. package/es/line/models/flow.js +1 -1
  29. package/es/line/models/great_circle.js +1 -1
  30. package/es/line/models/line.js +2 -2
  31. package/es/line/models/linearline.js +1 -1
  32. package/es/line/models/simpleLine.js +1 -1
  33. package/es/line/models/wall.js +1 -1
  34. package/es/line/shaders/dash/arc_dash_vert.glsl +3 -6
  35. package/es/line/shaders/dash/line_dash_vert.glsl +2 -1
  36. package/es/line/shaders/flow/flow_line_vert.glsl +2 -7
  37. package/es/line/shaders/line_arc2d_vert.glsl +1 -1
  38. package/es/line/shaders/line_arc_3d_vert.glsl +3 -8
  39. package/es/line/shaders/line_arc_great_circle_vert.glsl +4 -6
  40. package/es/line/shaders/line_arc_vert.glsl +3 -9
  41. package/es/line/shaders/line_bezier_vert.glsl +1 -1
  42. package/es/line/shaders/line_vert.glsl +1 -1
  43. package/es/line/shaders/linear/arc3d_linear_vert.glsl +2 -8
  44. package/es/line/shaders/linear/arc_linear_vert.glsl +3 -6
  45. package/es/line/shaders/linearLine/line_linear_vert.glsl +1 -1
  46. package/es/line/shaders/simple/simpleline_vert.glsl +1 -1
  47. package/es/line/shaders/wall/wall_vert.glsl +1 -1
  48. package/es/mask/models/fill.js +1 -1
  49. package/es/mask/shaders/mask_vert.glsl +1 -1
  50. package/es/plugins/FeatureScalePlugin.js +2 -1
  51. package/es/point/index.js +5 -3
  52. package/es/point/models/{simplePoint.js → billboard_point.js} +3 -3
  53. package/es/point/models/earthExtrude.js +1 -1
  54. package/es/point/models/earthFill.js +1 -1
  55. package/es/point/models/extrude.js +1 -1
  56. package/es/point/models/fill.js +1 -1
  57. package/es/point/models/fillmage.js +8 -37
  58. package/es/point/models/image.js +7 -7
  59. package/es/point/models/index.js +1 -1
  60. package/es/point/models/normal.js +4 -4
  61. package/es/point/models/radar.js +2 -2
  62. package/es/point/models/text.js +1 -19
  63. package/es/point/shaders/{simplePoint_vert.glsl → billboard_point_vert.glsl} +2 -2
  64. package/es/point/shaders/earth/extrude_vert.glsl +1 -1
  65. package/es/point/shaders/earth/fill_vert.glsl +1 -1
  66. package/es/point/shaders/extrude/extrude_vert.glsl +2 -6
  67. package/es/point/shaders/fill_vert.glsl +6 -14
  68. package/es/point/shaders/image/fillImage_frag.glsl +2 -1
  69. package/es/point/shaders/image/fillImage_vert.glsl +11 -19
  70. package/es/point/shaders/image_frag.glsl +2 -4
  71. package/es/point/shaders/image_vert.glsl +6 -10
  72. package/es/point/shaders/normal_vert.glsl +2 -3
  73. package/es/point/shaders/radar/radar_frag.glsl +0 -6
  74. package/es/point/shaders/radar/radar_vert.glsl +2 -9
  75. package/es/point/shaders/text_vert.glsl +6 -13
  76. package/es/polygon/index.js +3 -1
  77. package/es/polygon/models/extrude.js +3 -3
  78. package/es/polygon/models/extrusion.d.ts +17 -0
  79. package/es/polygon/models/extrusion.js +137 -0
  80. package/es/polygon/models/fill.js +2 -2
  81. package/es/polygon/models/index.d.ts +1 -1
  82. package/es/polygon/models/index.js +3 -1
  83. package/es/polygon/models/ocean.js +1 -1
  84. package/es/polygon/models/water.js +1 -1
  85. package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +2 -10
  86. package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +2 -8
  87. package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +2 -8
  88. package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +13 -0
  89. package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +34 -0
  90. package/es/polygon/shaders/polygon_linear_vert.glsl +2 -7
  91. package/es/polygon/shaders/polygon_vert.glsl +3 -6
  92. package/es/polygon/shaders/water/polygon_ocean_vert.glsl +2 -7
  93. package/es/polygon/shaders/water/polygon_water_vert.glsl +2 -6
  94. package/es/raster/models/raster.js +1 -1
  95. package/es/raster/models/rasterRgb.js +1 -1
  96. package/es/raster/models/rasterTerrainRgb.js +1 -1
  97. package/es/raster/shaders/raster_2d_vert.glsl +2 -6
  98. package/es/raster/shaders/raster_vert.glsl +2 -12
  99. package/es/raster/shaders/rater_terrain_rgb_vert.glsl +2 -7
  100. package/es/wind/models/wind.js +1 -1
  101. package/es/wind/shaders/wind_vert.glsl +3 -7
  102. package/lib/citybuliding/models/build.js +1 -1
  103. package/lib/citybuliding/shaders/build_vert.glsl +0 -1
  104. package/lib/core/BaseModel.js +6 -2
  105. package/lib/core/CommonStyleAttribute.js +40 -0
  106. package/lib/{Geometry → geometry}/models/billboard.js +1 -1
  107. package/lib/{Geometry → geometry}/models/plane.js +1 -1
  108. package/lib/{Geometry → geometry}/models/sprite.js +1 -1
  109. package/{es/Geometry → lib/geometry}/shaders/billboard_vert.glsl +1 -8
  110. package/lib/geometry/shaders/plane_vert.glsl +31 -0
  111. package/lib/{Geometry → geometry}/shaders/sprite_vert.glsl +2 -8
  112. package/lib/heatmap/models/grid.js +1 -1
  113. package/lib/heatmap/models/grid3d.js +1 -1
  114. package/lib/heatmap/models/heatmap.js +1 -1
  115. package/lib/heatmap/models/hexagon.js +1 -1
  116. package/lib/heatmap/shaders/grid_vert.glsl +1 -1
  117. package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +1 -1
  118. package/lib/heatmap/shaders/hexagon_3d_vert.glsl +1 -1
  119. package/lib/heatmap/shaders/hexagon_vert.glsl +1 -1
  120. package/lib/image/models/image.js +1 -1
  121. package/lib/image/shaders/image_vert.glsl +3 -7
  122. package/lib/index.js +2 -2
  123. package/lib/line/models/arc.js +3 -3
  124. package/lib/line/models/arc_3d.js +2 -2
  125. package/lib/line/models/earthArc_3d.js +2 -2
  126. package/lib/line/models/flow.js +1 -1
  127. package/lib/line/models/great_circle.js +1 -1
  128. package/lib/line/models/line.js +2 -2
  129. package/lib/line/models/linearline.js +1 -1
  130. package/lib/line/models/simpleLine.js +1 -1
  131. package/lib/line/models/wall.js +1 -1
  132. package/lib/line/shaders/dash/arc_dash_vert.glsl +3 -6
  133. package/lib/line/shaders/dash/line_dash_vert.glsl +2 -1
  134. package/lib/line/shaders/flow/flow_line_vert.glsl +2 -7
  135. package/lib/line/shaders/line_arc2d_vert.glsl +1 -1
  136. package/lib/line/shaders/line_arc_3d_vert.glsl +3 -8
  137. package/lib/line/shaders/line_arc_great_circle_vert.glsl +4 -6
  138. package/lib/line/shaders/line_arc_vert.glsl +3 -9
  139. package/lib/line/shaders/line_bezier_vert.glsl +1 -1
  140. package/lib/line/shaders/line_vert.glsl +1 -1
  141. package/lib/line/shaders/linear/arc3d_linear_vert.glsl +2 -8
  142. package/lib/line/shaders/linear/arc_linear_vert.glsl +3 -6
  143. package/lib/line/shaders/linearLine/line_linear_vert.glsl +1 -1
  144. package/lib/line/shaders/simple/simpleline_vert.glsl +1 -1
  145. package/lib/line/shaders/wall/wall_vert.glsl +1 -1
  146. package/lib/mask/models/fill.js +1 -1
  147. package/lib/mask/shaders/mask_vert.glsl +1 -1
  148. package/lib/plugins/FeatureScalePlugin.js +2 -1
  149. package/lib/point/index.js +5 -3
  150. package/lib/point/models/{simplePoint.js → billboard_point.js} +3 -3
  151. package/lib/point/models/earthExtrude.js +1 -1
  152. package/lib/point/models/earthFill.js +1 -1
  153. package/lib/point/models/extrude.js +1 -1
  154. package/lib/point/models/fill.js +1 -1
  155. package/lib/point/models/fillmage.js +8 -37
  156. package/lib/point/models/image.js +7 -7
  157. package/lib/point/models/index.js +2 -2
  158. package/lib/point/models/normal.js +4 -4
  159. package/lib/point/models/radar.js +2 -2
  160. package/lib/point/models/text.js +1 -19
  161. package/lib/point/shaders/{simplePoint_vert.glsl → billboard_point_vert.glsl} +2 -2
  162. package/lib/point/shaders/earth/extrude_vert.glsl +1 -1
  163. package/lib/point/shaders/earth/fill_vert.glsl +1 -1
  164. package/lib/point/shaders/extrude/extrude_vert.glsl +2 -6
  165. package/lib/point/shaders/fill_vert.glsl +6 -14
  166. package/lib/point/shaders/image/fillImage_frag.glsl +2 -1
  167. package/lib/point/shaders/image/fillImage_vert.glsl +11 -19
  168. package/lib/point/shaders/image_frag.glsl +2 -4
  169. package/lib/point/shaders/image_vert.glsl +6 -10
  170. package/lib/point/shaders/normal_vert.glsl +2 -3
  171. package/lib/point/shaders/radar/radar_frag.glsl +0 -6
  172. package/lib/point/shaders/radar/radar_vert.glsl +2 -9
  173. package/lib/point/shaders/text_vert.glsl +6 -13
  174. package/lib/polygon/index.js +3 -1
  175. package/lib/polygon/models/extrude.js +3 -3
  176. package/lib/polygon/models/extrusion.js +144 -0
  177. package/lib/polygon/models/fill.js +2 -2
  178. package/lib/polygon/models/index.js +3 -1
  179. package/lib/polygon/models/ocean.js +1 -1
  180. package/lib/polygon/models/water.js +1 -1
  181. package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +2 -10
  182. package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +2 -8
  183. package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +2 -8
  184. package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +13 -0
  185. package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +34 -0
  186. package/lib/polygon/shaders/polygon_linear_vert.glsl +2 -7
  187. package/lib/polygon/shaders/polygon_vert.glsl +3 -6
  188. package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +2 -7
  189. package/lib/polygon/shaders/water/polygon_water_vert.glsl +2 -6
  190. package/lib/raster/models/raster.js +1 -1
  191. package/lib/raster/models/rasterRgb.js +1 -1
  192. package/lib/raster/models/rasterTerrainRgb.js +1 -1
  193. package/lib/raster/shaders/raster_2d_vert.glsl +2 -6
  194. package/lib/raster/shaders/raster_vert.glsl +2 -12
  195. package/lib/raster/shaders/rater_terrain_rgb_vert.glsl +2 -7
  196. package/lib/wind/models/wind.js +1 -1
  197. package/lib/wind/shaders/wind_vert.glsl +3 -7
  198. package/package.json +7 -7
  199. package/es/Geometry/shaders/plane_vert.glsl +0 -53
  200. package/lib/Geometry/shaders/plane_vert.glsl +0 -53
  201. /package/es/{Geometry → geometry}/index.d.ts +0 -0
  202. /package/es/{Geometry → geometry}/index.js +0 -0
  203. /package/es/{Geometry → geometry}/models/billboard.d.ts +0 -0
  204. /package/es/{Geometry → geometry}/models/index.d.ts +0 -0
  205. /package/es/{Geometry → geometry}/models/index.js +0 -0
  206. /package/es/{Geometry → geometry}/models/plane.d.ts +0 -0
  207. /package/es/{Geometry → geometry}/models/sprite.d.ts +0 -0
  208. /package/es/{Geometry → geometry}/shaders/billboard_frag.glsl +0 -0
  209. /package/es/{Geometry → geometry}/shaders/plane_frag.glsl +0 -0
  210. /package/es/{Geometry → geometry}/shaders/sprite_frag.glsl +0 -0
  211. /package/es/point/models/{simplePoint.d.ts → billboard_point.d.ts} +0 -0
  212. /package/es/point/shaders/{simplePoint_frag.glsl → billboard_point_frag.glsl} +0 -0
  213. /package/lib/{Geometry → geometry}/index.js +0 -0
  214. /package/lib/{Geometry → geometry}/models/index.js +0 -0
  215. /package/lib/{Geometry → geometry}/shaders/billboard_frag.glsl +0 -0
  216. /package/lib/{Geometry → geometry}/shaders/plane_frag.glsl +0 -0
  217. /package/lib/{Geometry → geometry}/shaders/sprite_frag.glsl +0 -0
  218. /package/lib/point/shaders/{simplePoint_frag.glsl → billboard_point_frag.glsl} +0 -0
@@ -2,7 +2,7 @@ attribute vec4 a_Color;
2
2
  attribute vec3 a_Position;
3
3
 
4
4
  uniform mat4 u_ModelMatrix;
5
- uniform mat4 u_Mvp;
5
+
6
6
 
7
7
  uniform float u_raisingHeight: 0.0;
8
8
 
@@ -29,11 +29,8 @@ void main() {
29
29
  project_pos.z += u_raisingHeight * mapboxZoomScale;
30
30
  }
31
31
 
32
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
33
- gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
34
- } else {
35
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
36
- }
32
+
33
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
37
34
 
38
35
  setPickingColor(a_PickingColor);
39
36
  }
@@ -1,7 +1,7 @@
1
1
  attribute vec2 a_uv;
2
2
  attribute vec3 a_Position;
3
3
  uniform mat4 u_ModelMatrix;
4
- uniform mat4 u_Mvp;
4
+
5
5
 
6
6
  varying vec2 v_uv;
7
7
 
@@ -11,11 +11,6 @@ void main() {
11
11
  v_uv = a_uv;
12
12
 
13
13
  vec4 project_pos = project_position(vec4(a_Position, 1.0));
14
-
15
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
16
- gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
17
- } else {
18
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
19
- }
14
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
20
15
  }
21
16
 
@@ -2,7 +2,7 @@ attribute vec4 a_Color;
2
2
  attribute vec2 a_uv;
3
3
  attribute vec3 a_Position;
4
4
  uniform mat4 u_ModelMatrix;
5
- uniform mat4 u_Mvp;
5
+
6
6
 
7
7
  varying vec4 v_Color;
8
8
  varying vec2 v_uv;
@@ -17,10 +17,6 @@ void main() {
17
17
  v_Color = a_Color;
18
18
  vec4 project_pos = project_position(vec4(a_Position, 1.0));
19
19
 
20
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
21
- gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
22
- } else {
23
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
24
- }
20
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
25
21
  }
26
22
 
@@ -14,7 +14,7 @@ import { RasterImageTriangulation } from "../../core/triangulation";
14
14
  /* babel-plugin-inline-import '../shaders/raster_2d_frag.glsl' */
15
15
  var rasterFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\nuniform float u_min;\nuniform float u_max;\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nvarying vec2 v_texCoord;\nbool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }\n\n\nvoid main() {\n\n float value = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).r;\n if (value == u_noDataValue || isnan_emu(value))\n discard;\n else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1]))\n discard;\n else {\n float normalisedValue =(value - u_domain[0]) / (u_domain[1] -u_domain[0]);\n vec4 color = texture2D(u_colorTexture,vec2(normalisedValue, 0));\n \n gl_FragColor = color;\n gl_FragColor.a = gl_FragColor.a * u_opacity ;\n if(gl_FragColor.a < 0.01)\n discard;\n \n }\n}\n";
16
16
  /* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
17
- var rasterVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n";
17
+ var rasterVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));\n}\n";
18
18
  var RasterModel = /*#__PURE__*/function (_BaseModel) {
19
19
  _inherits(RasterModel, _BaseModel);
20
20
  var _super = _createSuper(RasterModel);
@@ -17,7 +17,7 @@ import { AttributeType, gl } from '@antv/l7-core';
17
17
  import BaseModel from "../../core/BaseModel";
18
18
  import { RasterImageTriangulation } from "../../core/triangulation";
19
19
  /* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
20
- var rasterVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n";
20
+ var rasterVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));\n}\n";
21
21
  /* babel-plugin-inline-import '../shaders/raster_rgb_frag.glsl' */
22
22
  var rasterFrag = "precision mediump float;\nuniform vec2 u_rminmax: vec2(0,255); \nuniform vec2 u_gminmax: vec2(0,255);\nuniform vec2 u_bminmax: vec2(0,255);\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nuniform float u_noDataValue : 0.0;\nvarying vec2 v_texCoord;\n\nvoid main() {\n vec3 rgb = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y)).rgb;\n if(rgb == vec3(u_noDataValue)) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else {\n gl_FragColor = vec4(rgb.r / (u_rminmax.y -u_rminmax.x), rgb.g /(u_gminmax.y -u_gminmax.x), rgb.b/ (u_bminmax.y - u_bminmax.x), u_opacity);\n }\n if(gl_FragColor.a < 0.01)\n discard;\n \n}";
23
23
  var RasterModel = /*#__PURE__*/function (_BaseModel) {
@@ -14,7 +14,7 @@ import { RasterImageTriangulation } from "../../core/triangulation";
14
14
  /* babel-plugin-inline-import '../shaders/raster_terrain_rgb_frag.glsl' */
15
15
  var Raster_terrainFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\n\nuniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\n\nvarying vec2 v_texCoord;\n\nuniform vec2 u_domain;\nuniform float u_noDataValue;\nuniform bool u_clampLow: true;\nuniform bool u_clampHigh: true;\nuniform vec4 u_unpack;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_texture, coord,bias) * 255.0;\n data.a = -1.0;\n return dot(data, u_unpack);\n}\n\nvec4 getColor(float value) {\n float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]);\n vec2 coord = vec2(normalisedValue, 0);\n return texture2D(u_colorTexture, coord);\n}\n\nvoid main() {\n float value = getElevation(v_texCoord,0.0);\n if (value == u_noDataValue) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else if ((!u_clampLow && value < u_domain[0]) || (!u_clampHigh && value > u_domain[1])) {\n gl_FragColor = vec4(0.0, 0, 0, 0.0);\n } else {\n \n gl_FragColor = getColor(value);\n gl_FragColor.a = gl_FragColor.a * u_opacity ;\n if(gl_FragColor.a < 0.01)\n discard;\n }\n}\n";
16
16
  /* babel-plugin-inline-import '../shaders/rater_terrain_rgb_vert.glsl' */
17
- var Raster_terrainVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n";
17
+ var Raster_terrainVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));\n}\n";
18
18
  var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
19
19
  _inherits(RasterTerrainRGB, _BaseModel);
20
20
  var _super = _createSuper(RasterTerrainRGB);
@@ -1,6 +1,6 @@
1
1
  precision highp float;
2
2
  uniform mat4 u_ModelMatrix;
3
- uniform mat4 u_Mvp;
3
+
4
4
  attribute vec3 a_Position;
5
5
  attribute vec2 a_Uv;
6
6
  varying vec2 v_texCoord;
@@ -9,9 +9,5 @@ void main() {
9
9
  v_texCoord = a_Uv;
10
10
  vec4 project_pos = project_position(vec4(a_Position, 1.0));
11
11
 
12
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
13
- gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));
14
- } else {
15
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
16
- }
12
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
17
13
  }
@@ -1,7 +1,7 @@
1
1
  precision highp float;
2
2
  attribute vec3 a_Position;
3
3
  uniform mat4 u_ModelMatrix;
4
- uniform mat4 u_Mvp;
4
+
5
5
  uniform vec4 u_extent;
6
6
  uniform sampler2D u_texture;
7
7
  uniform sampler2D u_colorTexture;
@@ -27,18 +27,8 @@ void main() {
27
27
  float value1 = (value - u_min) / (u_max -u_min);
28
28
  vec4 color = texture2D(u_colorTexture,vec2(intensity, 0));
29
29
 
30
- // if(uv.x > 1.0 || uv.y > 1.0) {
31
- // v_color = vec4(0.);
32
- // }
33
30
 
34
- // vec2 range = u_extent.zw - u_extent.xy;
35
- // vec4 project_pos = project_position(vec4(pos, 0, 1.0));
36
- // gl_Position = project_common_position_to_clipspace(vec4(pos.xy, project_scale(value) * u_heightRatio, 1.0));
37
31
 
38
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
39
- gl_Position = u_Mvp * (vec4(pos.xy, project_scale(value) * u_heightRatio, 1.0));
40
- } else {
41
- gl_Position = project_common_position_to_clipspace(vec4(pos.xy, project_scale(value) * u_heightRatio, 1.0));
42
- }
32
+ gl_Position = project_common_position_to_clipspace_v2(vec4(pos.xy, project_scale(value) * u_heightRatio, 1.0));
43
33
 
44
34
  }
@@ -1,6 +1,6 @@
1
1
  precision highp float;
2
2
  uniform mat4 u_ModelMatrix;
3
- uniform mat4 u_Mvp;
3
+
4
4
  attribute vec3 a_Position;
5
5
  attribute vec2 a_Uv;
6
6
  varying vec2 v_texCoord;
@@ -8,10 +8,5 @@ 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));
12
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
13
- gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));
14
- } else {
15
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
16
- }
11
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
17
12
  }
@@ -16,7 +16,7 @@ import { RasterImageTriangulation } from "../../core/triangulation";
16
16
  /* babel-plugin-inline-import '../shaders/wind_frag.glsl' */
17
17
  var WindFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nvoid main() {\n vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\n gl_FragColor = color;\n gl_FragColor.a *= u_opacity;\n}\n";
18
18
  /* babel-plugin-inline-import '../shaders/wind_vert.glsl' */
19
- var WindVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n";
19
+ var WindVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));\n}\n";
20
20
  import { Wind } from "./windRender";
21
21
  var defaultRampColors = {
22
22
  0.0: '#3288bd',
@@ -1,6 +1,6 @@
1
1
  precision highp float;
2
2
  uniform mat4 u_ModelMatrix;
3
- uniform mat4 u_Mvp;
3
+
4
4
  attribute vec3 a_Position;
5
5
  attribute vec2 a_Uv;
6
6
  varying vec2 v_texCoord;
@@ -8,10 +8,6 @@ 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
-
12
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
13
- gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));
14
- } else {
15
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
16
- }
11
+
12
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
17
13
  }
@@ -22,7 +22,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
22
22
  /* babel-plugin-inline-import '../shaders/build_frag.glsl' */
23
23
  var buildFrag = "uniform float u_opacity: 1.0;\nuniform vec4 u_baseColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_brightColor : [ 1.0, 0, 0, 1.0 ];\nuniform vec4 u_windowColor : [ 1.0, 0, 0, 1.0 ];\nuniform float u_near : 0;\nuniform float u_far : 1;\nvarying vec4 v_Color;\nvarying vec2 v_texCoord;\nuniform float u_Zoom : 1;\nuniform float u_time;\n\nuniform float u_circleSweep;\nuniform float u_cityMinSize;\nuniform vec3 u_circleSweepColor;\nuniform float u_circleSweepSpeed;\n\nvarying float v_worldDis;\n\n#pragma include \"picking\"\n\nvec3 getWindowColor(float n, float hot, vec3 brightColor, vec3 darkColor) {\n float s = step(hot, n);\n vec3 color = mix(brightColor,vec3(0.9,0.9,1.0),n);\n\n return mix(darkColor, color, s);\n}\nfloat random (vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))* 43758.5453123);\n}\n\nfloat LinearizeDepth()\n{\n float z = gl_FragCoord.z * 2.0 - 1.0;\n return (2.0 * u_near * u_far) / (u_far + u_near - z * (u_far - u_near));\n}\n\nvec3 fog(vec3 color, vec3 fogColor, float depth){\n float fogFactor=clamp(depth,0.0,1.0);\n vec3 output_color=mix(fogColor,color,fogFactor);\n return output_color;\n}\n\nfloat sdRect(vec2 p, vec2 sz) {\n vec2 d = abs(p) - sz;\n float outside = length(max(d, 0.));\n float inside = min(max(d.x, d.y), 0.);\n return outside + inside;\n}\n\nvoid main() {\n gl_FragColor = v_Color;\n vec3 baseColor = u_baseColor.xyz;\n vec3 brightColor = u_brightColor.xyz;\n vec3 windowColor = u_windowColor.xyz;\n float targetColId = 5.;\n float depth = 1.0 - LinearizeDepth() / u_far * u_Zoom;\n vec3 fogColor = vec3(23.0/255.0,31.0/255.0,51.0/255.0);\n if(v_texCoord.x < 0.) { //\u9876\u90E8\u989C\u8272\n vec3 foggedColor = fog(baseColor.xyz + vec3(0.12*0.9,0.2*0.9,0.3*0.9),fogColor,depth);\n gl_FragColor = vec4( foggedColor, v_Color.w);\n }else { // \u4FA7\u9762\u989C\u8272\n vec2 st = v_texCoord;\n vec2 UvScale = v_texCoord;\n float tStep = min(0.08,max(0.05* (18.0-u_Zoom),0.02));\n float tStart = 0.25 * tStep;\n float tEnd = 0.75 * tStep;\n float u = mod(UvScale.x, tStep);\n float v = mod(UvScale.y, tStep);\n float ux = floor(UvScale.x/tStep);\n float uy = floor(UvScale.y/tStep);\n float n = random(vec2(ux,uy));\n float lightP = u_time;\n float head = 1.0- step(0.005,st.y);\n /*step3*/\n // \u5C06\u7A97\u6237\u989C\u8272\u548C\u5899\u9762\u989C\u8272\u533A\u522B\u5F00\u6765\n float sU = step(tStart, u) - step(tEnd, u);\n float sV = step(tStart, v) - step(tEnd, v);\n vec2 windowSize = vec2(abs(tEnd-tStart),abs(tEnd-tStart));\n float dist = sdRect(vec2(u,v), windowSize);\n float s = sU * sV;\n\n float curColId = floor(UvScale.x / tStep);\n float sCol = step(targetColId - 0.2, curColId) - step(targetColId + 0.2, curColId);\n\n float mLightP = mod(lightP, 2.);\n float sRow = step(mLightP - 0.2, st.y) - step(mLightP, st.y);\n if(ux == targetColId){\n n =0.;\n }\n float timeP = min(0.75, abs ( sin(u_time/3.0) ) );\n float hot = smoothstep(1.0,0.0,timeP);\n vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), s);\n //vec3 color = mix(baseColor, getWindowColor(n,hot,brightColor,windowColor), 1.0);\n float sFinal = s * sCol * sRow;\n color += mix(baseColor, brightColor, sFinal*n);\n if (st.y<0.01){\n color = baseColor;\n }\n if(head ==1.0) { // \u9876\u90E8\u4EAE\u7EBF\n color = brightColor;\n }\n color = color * v_Color.rgb;\n\n vec3 foggedColor = fog(color,fogColor,depth);\n\n gl_FragColor = vec4(foggedColor,1.0);\n }\n\n\n if(u_circleSweep > 0.0 && v_worldDis < u_cityMinSize) {\n float r = fract(((v_worldDis/u_cityMinSize) - u_time * u_circleSweepSpeed) * 2.0);\n gl_FragColor.rgb += r * r * u_circleSweepColor;\n }\n \n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
24
24
  /* babel-plugin-inline-import '../shaders/build_vert.glsl' */
25
- var buildVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\n\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvarying vec4 v_Color;\nuniform mat4 u_Mvp;\n\nuniform float u_circleSweep;\nuniform vec2 u_cityCenter;\n\nvarying float v_worldDis;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n v_texCoord = a_Uv;\n\n if(u_circleSweep > 0.0) {\n vec2 lnglatscale = vec2(0.0);\n if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {\n lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);\n }\n v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n";
25
+ var buildVert = "precision highp float;\n\n#define ambientRatio 0.5\n#define diffuseRatio 0.3\n#define specularRatio 0.2\n\nattribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Normal;\nattribute float a_Size;\nuniform mat4 u_ModelMatrix;\n\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n\nvarying vec4 v_Color;\n\nuniform float u_circleSweep;\nuniform vec2 u_cityCenter;\n\nvarying float v_worldDis;\n\n#pragma include \"projection\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size, 1.0);\n vec4 project_pos = project_position(pos);\n\n v_texCoord = a_Uv;\n\n if(u_circleSweep > 0.0) {\n vec2 lnglatscale = vec2(0.0);\n if(u_CoordinateSystem != COORDINATE_SYSTEM_P20_2) {\n lnglatscale = (a_Position.xy - u_cityCenter) * vec2(0.0, 0.135);\n }\n v_worldDis = length(a_Position.xy + lnglatscale - u_cityCenter);\n }\n \n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));\n }\n\n float lightWeight = calc_lighting(pos);\n // v_Color = a_Color;\n v_Color = vec4(a_Color.rgb * lightWeight, a_Color.w);\n\n setPickingColor(a_PickingColor);\n}\n";
26
26
  var CityBuildModel = /*#__PURE__*/function (_BaseModel) {
27
27
  (0, _inherits2.default)(CityBuildModel, _BaseModel);
28
28
  var _super = _createSuper(CityBuildModel);
@@ -14,7 +14,6 @@ attribute vec2 a_Uv;
14
14
  varying vec2 v_texCoord;
15
15
 
16
16
  varying vec4 v_Color;
17
- uniform mat4 u_Mvp;
18
17
 
19
18
  uniform float u_circleSweep;
20
19
  uniform vec2 u_cityCenter;
@@ -218,7 +218,9 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
218
218
  opacity: 'float',
219
219
  stroke: 'vec4',
220
220
  offsets: 'vec2',
221
- textOffset: 'vec2'
221
+ textOffset: 'vec2',
222
+ rotation: 'float',
223
+ extrusionBase: 'float'
222
224
  };
223
225
  this.layer.enableShaderEncodeStyles.forEach(function (key) {
224
226
  if (encodeStyleAttribute[key]) {
@@ -247,7 +249,9 @@ var BaseModel = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.IGlobalConfigServi
247
249
  var defualtValue = {
248
250
  opacity: 1,
249
251
  stroke: [1, 0, 0, 1],
250
- offsets: [0, 0]
252
+ offsets: [0, 0],
253
+ rotation: 0,
254
+ extrusionBase: 0
251
255
  };
252
256
  this.layer.enableShaderEncodeStyles.forEach(function (key) {
253
257
  if (!_this.layer.encodeStyleAttribute[key]) {
@@ -7,6 +7,26 @@ exports.getCommonStyleAttributeOptions = getCommonStyleAttributeOptions;
7
7
  var _l7Core = require("@antv/l7-core");
8
8
  function getCommonStyleAttributeOptions(name) {
9
9
  switch (name) {
10
+ // // roate
11
+ case 'rotation':
12
+ return {
13
+ name: 'Rotation',
14
+ type: _l7Core.AttributeType.Attribute,
15
+ descriptor: {
16
+ name: 'a_Rotation',
17
+ buffer: {
18
+ usage: _l7Core.gl.DYNAMIC_DRAW,
19
+ data: [],
20
+ type: _l7Core.gl.FLOAT
21
+ },
22
+ size: 1,
23
+ update: function update(feature) {
24
+ var _feature$rotation = feature.rotation,
25
+ rotation = _feature$rotation === void 0 ? 0 : _feature$rotation;
26
+ return Array.isArray(rotation) ? [rotation[0]] : [rotation];
27
+ }
28
+ }
29
+ };
10
30
  case 'stroke':
11
31
  return {
12
32
  name: 'stroke',
@@ -47,6 +67,26 @@ function getCommonStyleAttributeOptions(name) {
47
67
  }
48
68
  }
49
69
  };
70
+ case 'extrusionBase':
71
+ return {
72
+ name: 'extrusionBase',
73
+ type: _l7Core.AttributeType.Attribute,
74
+ descriptor: {
75
+ name: 'a_ExtrusionBase',
76
+ buffer: {
77
+ // give the WebGL driver a hint that this buffer may change
78
+ usage: _l7Core.gl.STATIC_DRAW,
79
+ data: [],
80
+ type: _l7Core.gl.FLOAT
81
+ },
82
+ size: 1,
83
+ update: function update(feature) {
84
+ var _feature$extrusionBas = feature.extrusionBase,
85
+ op = _feature$extrusionBas === void 0 ? 0 : _feature$extrusionBas;
86
+ return [op];
87
+ }
88
+ }
89
+ };
50
90
  case 'offsets':
51
91
  return {
52
92
  name: 'offsets',
@@ -22,7 +22,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
22
22
  /* babel-plugin-inline-import '../shaders/billboard_frag.glsl' */
23
23
  var planeFrag = "\nuniform sampler2D u_texture;\nuniform float u_opacity;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\n\n#pragma include \"picking\"\nvoid main() {\n gl_FragColor = texture2D(u_texture, vec2(v_uv.x, 1.0 - v_uv.y));\n gl_FragColor.a *= u_opacity;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
24
24
  /* babel-plugin-inline-import '../shaders/billboard_vert.glsl' */
25
- var planeVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform float u_raisingHeight: 0.0;\nuniform mat4 u_Mvp;\nuniform float u_opacity;\nuniform vec2 u_size: [1.0, 1.0];\nuniform mat2 u_RotateMatrix;\n\nattribute vec3 a_Extrude;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nattribute vec3 a_Color;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\nvoid main() {\n vec3 extrude = a_Extrude;\n v_Color = a_Color;\n v_uv = a_Uv;\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n // \u8BA1\u7B97\u7ECF\u7EAC\u5EA6\u70B9\u4F4D\u5750\u6807\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\n // \u8BA1\u7B97\u7ED5 z \u8F74\u65CB\u8F6C\u540E\u7684\u504F\u79FB\n vec2 offsetXY = project_pixel(u_RotateMatrix * vec2(extrude.x * u_size.x, 0.0));\n // \u7ED5 z \u8F74\u65CB\u8F6C\n float x = project_pos.x + offsetXY.x;\n float y = project_pos.y + offsetXY.y;\n // z \u8F74\u4E0D\u53C2\u4E0E\u65CB\u8F6C\n float z = project_pixel(extrude.y * u_size.y + raiseHeight);\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));\n gl_Position = u_Mvp * (vec4(x, y, z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(x , y, z , 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
25
+ var planeVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform float u_raisingHeight: 0.0;\nuniform float u_opacity;\nuniform vec2 u_size: [1.0, 1.0];\nuniform mat2 u_RotateMatrix;\n\nattribute vec3 a_Extrude;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nattribute vec3 a_Color;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\nvoid main() {\n vec3 extrude = a_Extrude;\n v_Color = a_Color;\n v_uv = a_Uv;\n\n float raiseHeight = u_raisingHeight;\n if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {\n float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);\n raiseHeight = u_raisingHeight * mapboxZoomScale;\n }\n\n // \u8BA1\u7B97\u7ECF\u7EAC\u5EA6\u70B9\u4F4D\u5750\u6807\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\n // \u8BA1\u7B97\u7ED5 z \u8F74\u65CB\u8F6C\u540E\u7684\u504F\u79FB\n vec2 offsetXY = project_pixel(u_RotateMatrix * vec2(extrude.x * u_size.x, 0.0));\n // \u7ED5 z \u8F74\u65CB\u8F6C\n float x = project_pos.x + offsetXY.x;\n float y = project_pos.y + offsetXY.y;\n // z \u8F74\u4E0D\u53C2\u4E0E\u65CB\u8F6C\n float z = project_pixel(extrude.y * u_size.y + raiseHeight);\n\n gl_Position = project_common_position_to_clipspace_v2(vec4(x , y, z , 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
26
26
  var BillBoardModel = /*#__PURE__*/function (_BaseModel) {
27
27
  (0, _inherits2.default)(BillBoardModel, _BaseModel);
28
28
  var _super = _createSuper(BillBoardModel);
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
24
24
  /* babel-plugin-inline-import '../shaders/plane_frag.glsl' */
25
25
  var planeFrag = "\nuniform sampler2D u_texture;\nuniform float u_mapFlag;\nuniform float u_opacity;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\nvarying float v_clip;\n\n#pragma include \"picking\"\nvoid main() {\n // gl_FragColor = vec4(v_Color, u_opacity);\n if(u_mapFlag > 0.0) {\n gl_FragColor = texture2D(u_texture, vec2(v_uv.x, 1.0 - v_uv.y));\n gl_FragColor.a *= u_opacity;\n } else {\n // gl_FragColor = vec4(v_uv, 0.0, u_opacity);\n gl_FragColor = vec4(v_Color, u_opacity);\n }\n gl_FragColor.a *= v_clip;\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
26
26
  /* babel-plugin-inline-import '../shaders/plane_vert.glsl' */
27
- var planeVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nuniform mat4 u_Mvp;\nuniform float u_opacity;\nuniform float u_terrainClipHeight;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nattribute vec3 a_Color;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\nvarying float v_clip;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\nvoid main() {\n v_Color = a_Color;\n v_uv = a_Uv;\n \n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n v_clip = 1.0;\n if(a_Position.z < u_terrainClipHeight) {\n v_clip = 0.0;\n }\n \n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n\n // float x = 1.0;\n // float y = 0.0;\n // float z = 0.0;\n // mat3 translateMatrix = mat3(\n // 1.0, 0.0, 0.0 \n // 0.0, 1.0, 0.0\n // -project_pos.x, -project_pos.y, 1.0\n // );\n // mat4 translateMatrix = mat4(\n // 1.0, 0.0, 0.0, 0.0 ,\n // 0.0, 1.0, 0.0, 0.0,\n // 0.0, 0.0, 1.0, 0.0,\n // 1.0, 0.0, 0.0, 1.0\n // );\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, a_Position.z, 1.0));\n }\n\n setPickingColor(a_PickingColor);\n}\n";
27
+ var planeVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nuniform float u_opacity;\nuniform float u_terrainClipHeight;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nattribute vec3 a_Color;\n\nvarying vec3 v_Color;\nvarying vec2 v_uv;\nvarying float v_clip;\n\n#pragma include \"projection\"\n#pragma include \"picking\"\nvoid main() {\n v_Color = a_Color;\n v_uv = a_Uv;\n \n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n v_clip = 1.0;\n if(a_Position.z < u_terrainClipHeight) {\n v_clip = 0.0;\n }\n \n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0));\n\n setPickingColor(a_PickingColor);\n}\n";
28
28
  var PlaneModel = /*#__PURE__*/function (_BaseModel) {
29
29
  (0, _inherits2.default)(PlaneModel, _BaseModel);
30
30
  var _super = _createSuper(PlaneModel);
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
24
24
  /* babel-plugin-inline-import '../shaders/sprite_frag.glsl' */
25
25
  var spriteFrag = "\nuniform sampler2D u_texture;\nuniform float u_mapFlag;\nuniform float u_opacity;\n\nvarying vec3 v_Color;\nvarying float v_d;\n\nvoid main() {\n\n if(v_d < 0.0) {\n discard;\n }\n\n if(u_mapFlag > 0.0) {\n gl_FragColor = texture2D(u_texture, gl_PointCoord);\n gl_FragColor.a *= u_opacity;\n } else {\n gl_FragColor = vec4(v_Color, u_opacity);\n }\n}\n";
26
26
  /* babel-plugin-inline-import '../shaders/sprite_vert.glsl' */
27
- var spriteVert = "precision highp float;\n\nattribute vec3 a_Position;\nattribute vec3 a_Color;\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nuniform float u_opacity;\nuniform float u_Scale;\nvarying vec3 v_Color;\nvarying float v_d;\n\n#pragma include \"projection\"\nvoid main() {\n v_Color = a_Color;\n \n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n v_d = a_Position.z;\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, a_Position.z, 1.0));\n }\n\n gl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale;\n}\n";
27
+ var spriteVert = "precision highp float;\n\nattribute vec3 a_Position;\nattribute vec3 a_Color;\n\nuniform mat4 u_ModelMatrix;\nuniform float u_opacity;\nuniform float u_Scale;\nvarying vec3 v_Color;\nvarying float v_d;\n\n#pragma include \"projection\"\nvoid main() {\n v_Color = a_Color;\n \n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n\n v_d = a_Position.z;\n\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0));\ngl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale;\n}\n";
28
28
  var SPRITE_ANIMATE_DIR = /*#__PURE__*/function (SPRITE_ANIMATE_DIR) {
29
29
  SPRITE_ANIMATE_DIR["UP"] = "up";
30
30
  SPRITE_ANIMATE_DIR["DOWN"] = "down";
@@ -1,7 +1,6 @@
1
1
  precision highp float;
2
2
  uniform mat4 u_ModelMatrix;
3
3
  uniform float u_raisingHeight: 0.0;
4
- uniform mat4 u_Mvp;
5
4
  uniform float u_opacity;
6
5
  uniform vec2 u_size: [1.0, 1.0];
7
6
  uniform mat2 u_RotateMatrix;
@@ -38,13 +37,7 @@ void main() {
38
37
  // z 轴不参与旋转
39
38
  float z = project_pixel(extrude.y * u_size.y + raiseHeight);
40
39
 
41
-
42
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
43
- // gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));
44
- gl_Position = u_Mvp * (vec4(x, y, z, 1.0));
45
- } else {
46
- gl_Position = project_common_position_to_clipspace(vec4(x , y, z , 1.0));
47
- }
40
+ gl_Position = project_common_position_to_clipspace_v2(vec4(x , y, z , 1.0));
48
41
 
49
42
  setPickingColor(a_PickingColor);
50
43
  }
@@ -0,0 +1,31 @@
1
+ precision highp float;
2
+ uniform mat4 u_ModelMatrix;
3
+
4
+ uniform float u_opacity;
5
+ uniform float u_terrainClipHeight;
6
+
7
+ attribute vec3 a_Position;
8
+ attribute vec2 a_Uv;
9
+ attribute vec3 a_Color;
10
+
11
+ varying vec3 v_Color;
12
+ varying vec2 v_uv;
13
+ varying float v_clip;
14
+
15
+ #pragma include "projection"
16
+ #pragma include "picking"
17
+ void main() {
18
+ v_Color = a_Color;
19
+ v_uv = a_Uv;
20
+
21
+ vec4 project_pos = project_position(vec4(a_Position, 1.0));
22
+
23
+ v_clip = 1.0;
24
+ if(a_Position.z < u_terrainClipHeight) {
25
+ v_clip = 0.0;
26
+ }
27
+
28
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0));
29
+
30
+ setPickingColor(a_PickingColor);
31
+ }
@@ -4,7 +4,6 @@ attribute vec3 a_Position;
4
4
  attribute vec3 a_Color;
5
5
 
6
6
  uniform mat4 u_ModelMatrix;
7
- uniform mat4 u_Mvp;
8
7
  uniform float u_opacity;
9
8
  uniform float u_Scale;
10
9
  varying vec3 v_Color;
@@ -18,11 +17,6 @@ void main() {
18
17
 
19
18
  v_d = a_Position.z;
20
19
 
21
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
22
- gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));
23
- } else {
24
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, a_Position.z, 1.0));
25
- }
26
-
27
- gl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale;
20
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy, a_Position.z, 1.0));
21
+ gl_PointSize = pow((u_Zoom - 1.0), 2.0) * u_Scale;
28
22
  }
@@ -18,7 +18,7 @@ var _triangulation = require("../../core/triangulation");
18
18
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
19
19
  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; } }
20
20
  /* babel-plugin-inline-import '../shaders/grid_vert.glsl' */
21
- var heatmapGridVert = "precision highp float;\r\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\r\nattribute vec3 a_Position;\r\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\r\nattribute vec3 a_Pos;\r\nattribute float a_Size;\r\nattribute vec4 a_Color;\r\nuniform vec2 u_radius;\r\nuniform float u_coverage: 0.9;\r\nuniform float u_angle: 0;\r\nuniform mat4 u_ModelMatrix;\r\nuniform mat4 u_Mvp;\r\nvarying vec4 v_color;\r\n\r\nuniform vec2 u_sceneCenterMercator;\r\n\r\n#pragma include \"projection\"\r\n#pragma include \"project\"\r\n#pragma include \"picking\"\r\n\r\nvoid main() {\r\n v_color = a_Color;\r\n\r\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r\n vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r\n // vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n // gl_Position = project_common_position_to_clipspace(project_pos);\r\n\r\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\r\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r\n gl_Position = u_Mvp * (project_pos);\r\n } else {\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n gl_Position = project_common_position_to_clipspace(project_pos);\r\n }\r\n\r\n setPickingColor(a_PickingColor);\r\n}\r\n";
21
+ var heatmapGridVert = "precision highp float;\r\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\r\nattribute vec3 a_Position;\r\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\r\nattribute vec3 a_Pos;\r\nattribute float a_Size;\r\nattribute vec4 a_Color;\r\nuniform vec2 u_radius;\r\nuniform float u_coverage: 0.9;\r\nuniform float u_angle: 0;\r\nuniform mat4 u_ModelMatrix;\r\n\r\nvarying vec4 v_color;\r\n\r\nuniform vec2 u_sceneCenterMercator;\r\n\r\n#pragma include \"projection\"\r\n#pragma include \"project\"\r\n#pragma include \"picking\"\r\n\r\nvoid main() {\r\n v_color = a_Color;\r\n\r\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\r\n vec2 offset = a_Position.xy * u_radius * rotationMatrix * u_coverage ;\r\n // vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n // gl_Position = project_common_position_to_clipspace(project_pos);\r\n\r\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\r\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\r\n gl_Position = u_Mvp * (project_pos);\r\n } else {\r\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\r\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\r\n gl_Position = project_common_position_to_clipspace(project_pos);\r\n }\r\n\r\n setPickingColor(a_PickingColor);\r\n}\r\n";
22
22
  /* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
23
23
  var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
24
24
  var GridModel = /*#__PURE__*/function (_BaseModel) {
@@ -18,7 +18,7 @@ var _triangulation = require("../../core/triangulation");
18
18
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
19
19
  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; } }
20
20
  /* babel-plugin-inline-import '../shaders/hexagon_3d_vert.glsl' */
21
- var heatmapGrid3dVert = "precision highp float;\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\nattribute vec3 a_Position;\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\nattribute vec3 a_Pos;\n\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform vec2 u_sceneCenterMercator;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n \n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u7ECF\u7EAC\u5EA6\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\n vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0));\n\n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0);\n } else {\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6\n vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n \n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = project_common_position_to_clipspace(project_pos);\n }\n\n\n\n setPickingColor(a_PickingColor);\n}\n";
21
+ var heatmapGrid3dVert = "precision highp float;\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\nattribute vec3 a_Position;\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\nattribute vec3 a_Pos;\n\nattribute vec3 a_Normal;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\n\nvarying vec4 v_color;\n\nuniform vec2 u_sceneCenterMercator;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"light\"\n#pragma include \"picking\"\n\n\nvoid main() {\n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n\n\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n \n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u7ECF\u7EAC\u5EA6\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator; // \u5C06\u7ECF\u7EAC\u5EA6\u8F6C\u6362\u4E3A\u9AD8\u5FB72.0\u9700\u8981\u7684\u5E73\u9762\u5750\u6807\n vec4 project_pos = project_position(vec4(customLnglat, a_Position.z * a_Size, 1.0));\n\n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = u_Mvp * vec4(customLnglat , a_Position.z * a_Size, 1.0);\n } else {\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset); // \u5B9E\u9645\u7684\u7ECF\u7EAC\u5EA6\n vec4 project_pos = project_position(vec4(lnglat, a_Position.z * a_Size, 1.0));\n \n float lightWeight = calc_lighting(project_pos);\n v_color =vec4(a_Color.rgb*lightWeight, a_Color.w);\n \n gl_Position = project_common_position_to_clipspace(project_pos);\n }\n\n\n\n setPickingColor(a_PickingColor);\n}\n";
22
22
  /* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
23
23
  var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
24
24
  var Grid3DModel = /*#__PURE__*/function (_BaseModel) {
@@ -36,7 +36,7 @@ var heatmapColorVert = "precision highp float;\nattribute vec3 a_Position;\nattr
36
36
  /* babel-plugin-inline-import '../shaders/heatmap_framebuffer_frag.glsl' */
37
37
  var heatmapFramebufferFrag = "precision highp float;\nuniform float u_intensity;\nvarying float v_weight;\nvarying vec2 v_extrude;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(){\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = v_weight * u_intensity * GAUSS_COEF * exp(d);\n gl_FragColor = vec4(val, 1., 1., 1.);\n}\n";
38
38
  /* babel-plugin-inline-import '../shaders/heatmap_framebuffer_vert.glsl' */
39
- var heatmapFramebufferVert = "precision highp float;\nattribute vec3 a_Position;\nattribute float a_Size;\nattribute vec2 a_Dir;\nuniform float u_intensity;\nuniform float u_radius;\nvarying vec2 v_extrude;\nvarying float v_weight;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\n#define GAUSS_COEF 0.3989422804014327\n\n#pragma include \"projection\"\n\nvoid main(){\n v_weight = a_Size;\n float ZERO = 1.0 / 255.0 / 16.0;\n float extrude_x = a_Dir.x * 2.0 -1.0;\n float extrude_y = a_Dir.y * 2.0 -1.0;\n vec2 extrude_dir = normalize(vec2(extrude_x,extrude_y));\n float S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 2.5;\n v_extrude = extrude_dir * S;\n\n vec2 offset = project_pixel(v_extrude * u_radius);\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 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, 0.0, 1.0));\n }\n}\n";
39
+ var heatmapFramebufferVert = "precision highp float;\nattribute vec3 a_Position;\nattribute float a_Size;\nattribute vec2 a_Dir;\nuniform float u_intensity;\nuniform float u_radius;\nvarying vec2 v_extrude;\nvarying float v_weight;\nuniform mat4 u_ModelMatrix;\n\n\n#define GAUSS_COEF 0.3989422804014327\n\n#pragma include \"projection\"\n\nvoid main(){\n v_weight = a_Size;\n float ZERO = 1.0 / 255.0 / 16.0;\n float extrude_x = a_Dir.x * 2.0 -1.0;\n float extrude_y = a_Dir.y * 2.0 -1.0;\n vec2 extrude_dir = normalize(vec2(extrude_x,extrude_y));\n float S = sqrt(-2.0 * log(ZERO / a_Size / u_intensity / GAUSS_COEF)) / 2.5;\n v_extrude = extrude_dir * S;\n\n vec2 offset = project_pixel(v_extrude * u_radius);\n vec4 project_pos = project_position(vec4(a_Position.xy, 0.0, 1.0));\n\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy + offset, 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, 0.0, 1.0));\n }\n}\n";
40
40
  var isEqual = _l7Utils.lodashUtil.isEqual;
41
41
  var HeatMapModel = (_dec = (0, _inversify.injectable)(), _dec(_class = /*#__PURE__*/function (_BaseModel) {
42
42
  (0, _inherits2.default)(HeatMapModel, _BaseModel);
@@ -20,7 +20,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
20
20
  /* babel-plugin-inline-import '../shaders/hexagon_frag.glsl' */
21
21
  var heatmapGridFrag = "precision highp float;\nvarying vec4 v_color;\nuniform float u_opacity: 1;\n\n#pragma include \"picking\"\n\nvoid main() {\n gl_FragColor = v_color;\n gl_FragColor.a *= u_opacity;\n\n gl_FragColor = filterColor(gl_FragColor);\n}\n";
22
22
  /* babel-plugin-inline-import '../shaders/hexagon_vert.glsl' */
23
- var heatmapGridVert = "precision highp float;\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\nattribute vec3 a_Position;\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\nattribute vec3 a_Pos;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nvarying vec4 v_color;\n\nuniform vec2 u_sceneCenterMercator;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nvoid main() {\n v_color = a_Color;\n \n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\n \n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xy, 0., 1.0));\n // gl_Position = u_Mvp * (vec4(a_Pos.xy + offset, 0., 1.0));\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator;\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\n gl_Position = u_Mvp * vec4(project_pos.xy, 0.0, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n";
23
+ var heatmapGridVert = "precision highp float;\n// \u591A\u8FB9\u5F62\u9876\u70B9\u5750\u6807\nattribute vec3 a_Position;\n// \u591A\u8FB9\u5F62\u7ECF\u7EAC\u5EA6\u5750\u6807\nattribute vec3 a_Pos;\nattribute float a_Size;\nattribute vec4 a_Color;\nuniform vec2 u_radius;\nuniform float u_coverage: 0.9;\nuniform float u_angle: 0;\nuniform mat4 u_ModelMatrix;\n\nvarying vec4 v_color;\n\nuniform vec2 u_sceneCenterMercator;\n\n#pragma include \"projection\"\n#pragma include \"project\"\n#pragma include \"picking\"\n\nvoid main() {\n v_color = a_Color;\n \n mat2 rotationMatrix = mat2(cos(u_angle), sin(u_angle), -sin(u_angle), cos(u_angle));\n vec2 offset =(vec2(a_Position.xy * u_radius * rotationMatrix * u_coverage));\n vec2 lnglat = unProjectFlat(a_Pos.xy + offset);\n \n // vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n // gl_Position = u_Mvp * (vec4(project_pos.xy, 0., 1.0));\n // gl_Position = u_Mvp * (vec4(a_Pos.xy + offset, 0., 1.0));\n vec2 customLnglat = customProject(lnglat) - u_sceneCenterMercator;\n vec4 project_pos = project_position(vec4(customLnglat, 0, 1.0));\n gl_Position = u_Mvp * vec4(project_pos.xy, 0.0, 1.0);\n } else {\n vec4 project_pos = project_position(vec4(lnglat, 0, 1.0));\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, 0., 1.0));\n }\n setPickingColor(a_PickingColor);\n}\n";
24
24
  var HexagonModel = /*#__PURE__*/function (_BaseModel) {
25
25
  (0, _inherits2.default)(HexagonModel, _BaseModel);
26
26
  var _super = _createSuper(HexagonModel);
@@ -9,7 +9,7 @@ uniform vec2 u_radius;
9
9
  uniform float u_coverage: 0.9;
10
10
  uniform float u_angle: 0;
11
11
  uniform mat4 u_ModelMatrix;
12
- uniform mat4 u_Mvp;
12
+
13
13
  varying vec4 v_color;
14
14
 
15
15
  uniform vec2 u_sceneCenterMercator;
@@ -7,7 +7,7 @@ uniform float u_radius;
7
7
  varying vec2 v_extrude;
8
8
  varying float v_weight;
9
9
  uniform mat4 u_ModelMatrix;
10
- uniform mat4 u_Mvp;
10
+
11
11
 
12
12
  #define GAUSS_COEF 0.3989422804014327
13
13
 
@@ -11,7 +11,7 @@ uniform vec2 u_radius;
11
11
  uniform float u_coverage: 0.9;
12
12
  uniform float u_angle: 0;
13
13
  uniform mat4 u_ModelMatrix;
14
- uniform mat4 u_Mvp;
14
+
15
15
  varying vec4 v_color;
16
16
 
17
17
  uniform vec2 u_sceneCenterMercator;
@@ -9,7 +9,7 @@ uniform vec2 u_radius;
9
9
  uniform float u_coverage: 0.9;
10
10
  uniform float u_angle: 0;
11
11
  uniform mat4 u_ModelMatrix;
12
- uniform mat4 u_Mvp;
12
+
13
13
  varying vec4 v_color;
14
14
 
15
15
  uniform vec2 u_sceneCenterMercator;
@@ -20,7 +20,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
20
20
  /* babel-plugin-inline-import '../shaders/image_frag.glsl' */
21
21
  var ImageFrag = "precision mediump float;\nuniform float u_opacity: 1.0;\nuniform sampler2D u_texture;\nvarying vec2 v_texCoord;\nvoid main() {\n vec4 color = texture2D(u_texture,vec2(v_texCoord.x,v_texCoord.y));\n gl_FragColor = color;\n gl_FragColor.a *= u_opacity;\n if(gl_FragColor.a < 0.01)\n discard;\n}\n";
22
22
  /* babel-plugin-inline-import '../shaders/image_vert.glsl' */
23
- var ImageVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n // gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x\n gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));\n } else {\n gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));\n }\n}\n";
23
+ var ImageVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\n\nattribute vec3 a_Position;\nattribute vec2 a_Uv;\nvarying vec2 v_texCoord;\n#pragma include \"projection\"\nvoid main() {\n v_texCoord = a_Uv;\n vec4 project_pos = project_position(vec4(a_Position, 1.0));\n gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));\n \n}\n";
24
24
  var ImageModel = /*#__PURE__*/function (_BaseModel) {
25
25
  (0, _inherits2.default)(ImageModel, _BaseModel);
26
26
  var _super = _createSuper(ImageModel);
@@ -1,6 +1,6 @@
1
1
  precision highp float;
2
2
  uniform mat4 u_ModelMatrix;
3
- uniform mat4 u_Mvp;
3
+
4
4
  attribute vec3 a_Position;
5
5
  attribute vec2 a_Uv;
6
6
  varying vec2 v_texCoord;
@@ -8,10 +8,6 @@ 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));
12
- if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
13
- gl_Position = u_Mvp * (vec4(project_pos.xy,0., 1.0));
14
- } else {
15
- gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
16
- }
11
+ gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xy,0., 1.0));
12
+
17
13
  }
package/lib/index.js CHANGED
@@ -54,7 +54,7 @@ Object.defineProperty(exports, "EarthLayer", {
54
54
  Object.defineProperty(exports, "GeometryLayer", {
55
55
  enumerable: true,
56
56
  get: function get() {
57
- return _Geometry.default;
57
+ return _geometry.default;
58
58
  }
59
59
  });
60
60
  Object.defineProperty(exports, "HeatmapLayer", {
@@ -116,7 +116,7 @@ var _canvas = _interopRequireDefault(require("./canvas"));
116
116
  var _building = _interopRequireDefault(require("./citybuliding/building"));
117
117
  var _BaseLayer = _interopRequireDefault(require("./core/BaseLayer"));
118
118
  var _BaseModel = _interopRequireDefault(require("./core/BaseModel"));
119
- var _Geometry = _interopRequireDefault(require("./Geometry"));
119
+ var _geometry = _interopRequireDefault(require("./geometry"));
120
120
  var _heatmap = _interopRequireDefault(require("./heatmap"));
121
121
  var _image = _interopRequireDefault(require("./image"));
122
122
  var _index = _interopRequireDefault(require("./line/index"));