@antv/l7-layers 2.18.3 → 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.
- package/es/citybuliding/models/build.js +1 -1
- package/es/citybuliding/shaders/build_vert.glsl +0 -1
- package/es/core/BaseModel.js +4 -2
- package/es/core/CommonStyleAttribute.js +20 -0
- package/es/core/interface.d.ts +4 -0
- package/es/{Geometry → geometry}/models/billboard.js +1 -1
- package/es/{Geometry → geometry}/models/plane.js +1 -1
- package/es/{Geometry → geometry}/models/sprite.js +1 -1
- package/{lib/Geometry → es/geometry}/shaders/billboard_vert.glsl +1 -8
- package/es/geometry/shaders/plane_vert.glsl +31 -0
- package/es/{Geometry → geometry}/shaders/sprite_vert.glsl +2 -8
- package/es/heatmap/models/grid.js +1 -1
- package/es/heatmap/models/grid3d.js +1 -1
- package/es/heatmap/models/heatmap.js +1 -1
- package/es/heatmap/models/hexagon.js +1 -1
- package/es/heatmap/shaders/grid_vert.glsl +1 -1
- package/es/heatmap/shaders/heatmap_framebuffer_vert.glsl +1 -1
- package/es/heatmap/shaders/hexagon_3d_vert.glsl +1 -1
- package/es/heatmap/shaders/hexagon_vert.glsl +1 -1
- package/es/image/models/image.js +1 -1
- package/es/image/shaders/image_vert.glsl +3 -7
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/line/models/arc.js +3 -3
- package/es/line/models/arc_3d.js +2 -2
- package/es/line/models/earthArc_3d.js +2 -2
- package/es/line/models/flow.js +1 -1
- package/es/line/models/great_circle.js +1 -1
- package/es/line/models/line.js +2 -2
- package/es/line/models/linearline.js +1 -1
- package/es/line/models/simpleLine.js +1 -1
- package/es/line/models/wall.js +1 -1
- package/es/line/shaders/dash/arc_dash_vert.glsl +3 -6
- package/es/line/shaders/dash/line_dash_vert.glsl +2 -1
- package/es/line/shaders/flow/flow_line_vert.glsl +2 -7
- package/es/line/shaders/line_arc2d_vert.glsl +1 -1
- package/es/line/shaders/line_arc_3d_vert.glsl +3 -8
- package/es/line/shaders/line_arc_great_circle_vert.glsl +4 -6
- package/es/line/shaders/line_arc_vert.glsl +3 -9
- package/es/line/shaders/line_bezier_vert.glsl +1 -1
- package/es/line/shaders/line_vert.glsl +1 -1
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +2 -8
- package/es/line/shaders/linear/arc_linear_vert.glsl +3 -6
- package/es/line/shaders/linearLine/line_linear_vert.glsl +1 -1
- package/es/line/shaders/simple/simpleline_vert.glsl +1 -1
- package/es/line/shaders/wall/wall_vert.glsl +1 -1
- package/es/mask/models/fill.js +1 -1
- package/es/mask/shaders/mask_vert.glsl +1 -1
- package/es/point/models/billboard_point.js +1 -1
- package/es/point/models/earthExtrude.js +1 -1
- package/es/point/models/earthFill.js +1 -1
- package/es/point/models/extrude.js +1 -1
- package/es/point/models/fill.js +1 -1
- package/es/point/models/fillmage.js +1 -1
- package/es/point/models/image.js +1 -1
- package/es/point/models/normal.js +1 -1
- package/es/point/models/radar.js +2 -2
- package/es/point/models/text.js +1 -1
- package/es/point/shaders/billboard_point_vert.glsl +2 -2
- package/es/point/shaders/earth/extrude_vert.glsl +1 -1
- package/es/point/shaders/earth/fill_vert.glsl +1 -1
- package/es/point/shaders/extrude/extrude_vert.glsl +2 -6
- package/es/point/shaders/fill_vert.glsl +3 -10
- package/es/point/shaders/image/fillImage_vert.glsl +2 -8
- package/es/point/shaders/image_vert.glsl +3 -6
- package/es/point/shaders/normal_vert.glsl +1 -1
- package/es/point/shaders/radar/radar_frag.glsl +0 -6
- package/es/point/shaders/radar/radar_vert.glsl +2 -9
- package/es/point/shaders/text_vert.glsl +2 -7
- package/es/polygon/index.js +3 -1
- package/es/polygon/models/extrude.js +3 -3
- package/es/polygon/models/extrusion.d.ts +17 -0
- package/es/polygon/models/extrusion.js +137 -0
- package/es/polygon/models/fill.js +2 -2
- package/es/polygon/models/index.d.ts +1 -1
- package/es/polygon/models/index.js +3 -1
- package/es/polygon/models/ocean.js +1 -1
- package/es/polygon/models/water.js +1 -1
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +2 -10
- package/es/polygon/shaders/extrude/polygon_extrude_vert.glsl +2 -8
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +2 -8
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +13 -0
- package/es/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +34 -0
- package/es/polygon/shaders/polygon_linear_vert.glsl +2 -7
- package/es/polygon/shaders/polygon_vert.glsl +3 -6
- package/es/polygon/shaders/water/polygon_ocean_vert.glsl +2 -7
- package/es/polygon/shaders/water/polygon_water_vert.glsl +2 -6
- package/es/raster/models/raster.js +1 -1
- package/es/raster/models/rasterRgb.js +1 -1
- package/es/raster/models/rasterTerrainRgb.js +1 -1
- package/es/raster/shaders/raster_2d_vert.glsl +2 -6
- package/es/raster/shaders/raster_vert.glsl +2 -12
- package/es/raster/shaders/rater_terrain_rgb_vert.glsl +2 -7
- package/es/wind/models/wind.js +1 -1
- package/es/wind/shaders/wind_vert.glsl +3 -7
- package/lib/citybuliding/models/build.js +1 -1
- package/lib/citybuliding/shaders/build_vert.glsl +0 -1
- package/lib/core/BaseModel.js +4 -2
- package/lib/core/CommonStyleAttribute.js +20 -0
- package/lib/{Geometry → geometry}/models/billboard.js +1 -1
- package/lib/{Geometry → geometry}/models/plane.js +1 -1
- package/lib/{Geometry → geometry}/models/sprite.js +1 -1
- package/{es/Geometry → lib/geometry}/shaders/billboard_vert.glsl +1 -8
- package/lib/geometry/shaders/plane_vert.glsl +31 -0
- package/lib/{Geometry → geometry}/shaders/sprite_vert.glsl +2 -8
- package/lib/heatmap/models/grid.js +1 -1
- package/lib/heatmap/models/grid3d.js +1 -1
- package/lib/heatmap/models/heatmap.js +1 -1
- package/lib/heatmap/models/hexagon.js +1 -1
- package/lib/heatmap/shaders/grid_vert.glsl +1 -1
- package/lib/heatmap/shaders/heatmap_framebuffer_vert.glsl +1 -1
- package/lib/heatmap/shaders/hexagon_3d_vert.glsl +1 -1
- package/lib/heatmap/shaders/hexagon_vert.glsl +1 -1
- package/lib/image/models/image.js +1 -1
- package/lib/image/shaders/image_vert.glsl +3 -7
- package/lib/index.js +2 -2
- package/lib/line/models/arc.js +3 -3
- package/lib/line/models/arc_3d.js +2 -2
- package/lib/line/models/earthArc_3d.js +2 -2
- package/lib/line/models/flow.js +1 -1
- package/lib/line/models/great_circle.js +1 -1
- package/lib/line/models/line.js +2 -2
- package/lib/line/models/linearline.js +1 -1
- package/lib/line/models/simpleLine.js +1 -1
- package/lib/line/models/wall.js +1 -1
- package/lib/line/shaders/dash/arc_dash_vert.glsl +3 -6
- package/lib/line/shaders/dash/line_dash_vert.glsl +2 -1
- package/lib/line/shaders/flow/flow_line_vert.glsl +2 -7
- package/lib/line/shaders/line_arc2d_vert.glsl +1 -1
- package/lib/line/shaders/line_arc_3d_vert.glsl +3 -8
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +4 -6
- package/lib/line/shaders/line_arc_vert.glsl +3 -9
- package/lib/line/shaders/line_bezier_vert.glsl +1 -1
- package/lib/line/shaders/line_vert.glsl +1 -1
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +2 -8
- package/lib/line/shaders/linear/arc_linear_vert.glsl +3 -6
- package/lib/line/shaders/linearLine/line_linear_vert.glsl +1 -1
- package/lib/line/shaders/simple/simpleline_vert.glsl +1 -1
- package/lib/line/shaders/wall/wall_vert.glsl +1 -1
- package/lib/mask/models/fill.js +1 -1
- package/lib/mask/shaders/mask_vert.glsl +1 -1
- package/lib/point/models/billboard_point.js +1 -1
- package/lib/point/models/earthExtrude.js +1 -1
- package/lib/point/models/earthFill.js +1 -1
- package/lib/point/models/extrude.js +1 -1
- package/lib/point/models/fill.js +1 -1
- package/lib/point/models/fillmage.js +1 -1
- package/lib/point/models/image.js +1 -1
- package/lib/point/models/normal.js +1 -1
- package/lib/point/models/radar.js +2 -2
- package/lib/point/models/text.js +1 -1
- package/lib/point/shaders/billboard_point_vert.glsl +2 -2
- package/lib/point/shaders/earth/extrude_vert.glsl +1 -1
- package/lib/point/shaders/earth/fill_vert.glsl +1 -1
- package/lib/point/shaders/extrude/extrude_vert.glsl +2 -6
- package/lib/point/shaders/fill_vert.glsl +3 -10
- package/lib/point/shaders/image/fillImage_vert.glsl +2 -8
- package/lib/point/shaders/image_vert.glsl +3 -6
- package/lib/point/shaders/normal_vert.glsl +1 -1
- package/lib/point/shaders/radar/radar_frag.glsl +0 -6
- package/lib/point/shaders/radar/radar_vert.glsl +2 -9
- package/lib/point/shaders/text_vert.glsl +2 -7
- package/lib/polygon/index.js +3 -1
- package/lib/polygon/models/extrude.js +3 -3
- package/lib/polygon/models/extrusion.js +144 -0
- package/lib/polygon/models/fill.js +2 -2
- package/lib/polygon/models/index.js +3 -1
- package/lib/polygon/models/ocean.js +1 -1
- package/lib/polygon/models/water.js +1 -1
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +2 -10
- package/lib/polygon/shaders/extrude/polygon_extrude_vert.glsl +2 -8
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +2 -8
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +13 -0
- package/lib/polygon/shaders/extrusion/polygon_extrusion_vert.glsl +34 -0
- package/lib/polygon/shaders/polygon_linear_vert.glsl +2 -7
- package/lib/polygon/shaders/polygon_vert.glsl +3 -6
- package/lib/polygon/shaders/water/polygon_ocean_vert.glsl +2 -7
- package/lib/polygon/shaders/water/polygon_water_vert.glsl +2 -6
- package/lib/raster/models/raster.js +1 -1
- package/lib/raster/models/rasterRgb.js +1 -1
- package/lib/raster/models/rasterTerrainRgb.js +1 -1
- package/lib/raster/shaders/raster_2d_vert.glsl +2 -6
- package/lib/raster/shaders/raster_vert.glsl +2 -12
- package/lib/raster/shaders/rater_terrain_rgb_vert.glsl +2 -7
- package/lib/wind/models/wind.js +1 -1
- package/lib/wind/shaders/wind_vert.glsl +3 -7
- package/package.json +7 -7
- package/es/Geometry/shaders/plane_vert.glsl +0 -53
- package/lib/Geometry/shaders/plane_vert.glsl +0 -53
- /package/es/{Geometry → geometry}/index.d.ts +0 -0
- /package/es/{Geometry → geometry}/index.js +0 -0
- /package/es/{Geometry → geometry}/models/billboard.d.ts +0 -0
- /package/es/{Geometry → geometry}/models/index.d.ts +0 -0
- /package/es/{Geometry → geometry}/models/index.js +0 -0
- /package/es/{Geometry → geometry}/models/plane.d.ts +0 -0
- /package/es/{Geometry → geometry}/models/sprite.d.ts +0 -0
- /package/es/{Geometry → geometry}/shaders/billboard_frag.glsl +0 -0
- /package/es/{Geometry → geometry}/shaders/plane_frag.glsl +0 -0
- /package/es/{Geometry → geometry}/shaders/sprite_frag.glsl +0 -0
- /package/lib/{Geometry → geometry}/index.js +0 -0
- /package/lib/{Geometry → geometry}/models/index.js +0 -0
- /package/lib/{Geometry → geometry}/shaders/billboard_frag.glsl +0 -0
- /package/lib/{Geometry → geometry}/shaders/plane_frag.glsl +0 -0
- /package/lib/{Geometry → geometry}/shaders/sprite_frag.glsl +0 -0
|
@@ -10,7 +10,7 @@ attribute vec3 a_Normal;
|
|
|
10
10
|
attribute float a_Size;
|
|
11
11
|
attribute vec3 a_uvs;
|
|
12
12
|
uniform mat4 u_ModelMatrix;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
|
|
15
15
|
uniform float u_heightfixed: 0.0; // 默认不固定
|
|
16
16
|
uniform float u_raisingHeight: 0.0;
|
|
@@ -42,15 +42,7 @@ void main() {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
48
|
-
// gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));
|
|
49
|
-
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
|
|
50
|
-
} else {
|
|
51
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
52
|
-
}
|
|
53
|
-
|
|
45
|
+
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
54
46
|
float lightWeight = calc_lighting(pos);
|
|
55
47
|
v_texture_data = vec2(a_Position.z,lightWeight);
|
|
56
48
|
|
|
@@ -10,7 +10,7 @@ attribute vec3 a_Normal;
|
|
|
10
10
|
attribute float a_Size;
|
|
11
11
|
attribute vec3 a_uvs;
|
|
12
12
|
uniform mat4 u_ModelMatrix;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
uniform vec4 u_sourceColor;
|
|
15
15
|
uniform vec4 u_targetColor;
|
|
16
16
|
uniform float u_linearColor: 0;
|
|
@@ -50,13 +50,7 @@ void main() {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
55
|
-
// gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));
|
|
56
|
-
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
|
|
57
|
-
} else {
|
|
58
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
59
|
-
}
|
|
53
|
+
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
60
54
|
|
|
61
55
|
// Tip: 部分机型 GPU 计算精度兼容
|
|
62
56
|
if(isSide < 0.999) {
|
|
@@ -10,7 +10,7 @@ attribute vec3 a_Normal;
|
|
|
10
10
|
attribute float a_Size;
|
|
11
11
|
attribute vec3 a_uvs;
|
|
12
12
|
uniform mat4 u_ModelMatrix;
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
uniform sampler2D u_texture;
|
|
15
15
|
|
|
16
16
|
|
|
@@ -51,13 +51,7 @@ void main() {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
// gl_Position = u_Mvp * (vec4(project_pos.xyz * vec3(1.0, 1.0, -1.0), 1.0));
|
|
56
|
-
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
|
|
57
|
-
} else {
|
|
58
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
59
|
-
}
|
|
60
|
-
|
|
54
|
+
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
61
55
|
|
|
62
56
|
|
|
63
57
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
precision highp float;
|
|
2
|
+
|
|
3
|
+
#define ambientRatio 0.5
|
|
4
|
+
#define diffuseRatio 0.3
|
|
5
|
+
#define specularRatio 0.2
|
|
6
|
+
|
|
7
|
+
attribute vec4 a_Color;
|
|
8
|
+
attribute vec3 a_Position;
|
|
9
|
+
attribute vec3 a_Normal;
|
|
10
|
+
attribute float a_Size;
|
|
11
|
+
uniform mat4 u_ModelMatrix;
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
varying vec4 v_Color;
|
|
17
|
+
|
|
18
|
+
#pragma include "projection"
|
|
19
|
+
#pragma include "light"
|
|
20
|
+
#pragma include "picking"
|
|
21
|
+
|
|
22
|
+
void main() {
|
|
23
|
+
|
|
24
|
+
vec4 pos = vec4(a_Position.xy, a_Position.z * a_Size + (1.0 - a_Position.z) * extrusionBase * 1.5, 1.0);
|
|
25
|
+
float lightWeight = calc_lighting(pos);
|
|
26
|
+
vec4 project_pos = project_position(pos);
|
|
27
|
+
// project_pos.z += extrusionBase * 2.0;
|
|
28
|
+
v_Color = a_Color;
|
|
29
|
+
v_Color = vec4(v_Color.rgb * lightWeight, v_Color.w * opacity);
|
|
30
|
+
|
|
31
|
+
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
32
|
+
|
|
33
|
+
setPickingColor(a_PickingColor);
|
|
34
|
+
}
|
|
@@ -2,7 +2,7 @@ attribute vec4 a_Color;
|
|
|
2
2
|
attribute vec3 a_Position;
|
|
3
3
|
|
|
4
4
|
uniform mat4 u_ModelMatrix;
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
uniform float u_raisingHeight: 0.0;
|
|
7
7
|
|
|
8
8
|
varying vec4 v_Color;
|
|
@@ -32,11 +32,6 @@ void main() {
|
|
|
32
32
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
gl_Position = u_Mvp * (vec4(project_pos.xyz, 1.0));
|
|
37
|
-
} else {
|
|
38
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xyz, 1.0));
|
|
39
|
-
}
|
|
40
|
-
|
|
35
|
+
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
41
36
|
setPickingColor(a_PickingColor);
|
|
42
37
|
}
|
|
@@ -2,7 +2,7 @@ attribute vec4 a_Color;
|
|
|
2
2
|
attribute vec3 a_Position;
|
|
3
3
|
|
|
4
4
|
uniform mat4 u_ModelMatrix;
|
|
5
|
-
|
|
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
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -21,7 +21,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
21
21
|
/* babel-plugin-inline-import '../shaders/raster_2d_frag.glsl' */
|
|
22
22
|
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";
|
|
23
23
|
/* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
|
|
24
|
-
var rasterVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\
|
|
24
|
+
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";
|
|
25
25
|
var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
26
26
|
(0, _inherits2.default)(RasterModel, _BaseModel);
|
|
27
27
|
var _super = _createSuper(RasterModel);
|
|
@@ -24,7 +24,7 @@ var _excluded = ["data"],
|
|
|
24
24
|
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); }; }
|
|
25
25
|
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; } }
|
|
26
26
|
/* babel-plugin-inline-import '../shaders/raster_2d_vert.glsl' */
|
|
27
|
-
var rasterVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\
|
|
27
|
+
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";
|
|
28
28
|
/* babel-plugin-inline-import '../shaders/raster_rgb_frag.glsl' */
|
|
29
29
|
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}";
|
|
30
30
|
var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
@@ -21,7 +21,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
21
21
|
/* babel-plugin-inline-import '../shaders/raster_terrain_rgb_frag.glsl' */
|
|
22
22
|
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";
|
|
23
23
|
/* babel-plugin-inline-import '../shaders/rater_terrain_rgb_vert.glsl' */
|
|
24
|
-
var Raster_terrainVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\
|
|
24
|
+
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";
|
|
25
25
|
var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
26
26
|
(0, _inherits2.default)(RasterTerrainRGB, _BaseModel);
|
|
27
27
|
var _super = _createSuper(RasterTerrainRGB);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
precision highp float;
|
|
2
2
|
uniform mat4 u_ModelMatrix;
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|
package/lib/wind/models/wind.js
CHANGED
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
24
24
|
/* babel-plugin-inline-import '../shaders/wind_frag.glsl' */
|
|
25
25
|
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";
|
|
26
26
|
/* babel-plugin-inline-import '../shaders/wind_vert.glsl' */
|
|
27
|
-
var WindVert = "precision highp float;\nuniform mat4 u_ModelMatrix;\
|
|
27
|
+
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";
|
|
28
28
|
var defaultRampColors = {
|
|
29
29
|
0.0: '#3288bd',
|
|
30
30
|
0.1: '#66c2a5',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
precision highp float;
|
|
2
2
|
uniform mat4 u_ModelMatrix;
|
|
3
|
-
|
|
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
|
-
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@antv/async-hook": "^2.2.9",
|
|
30
|
-
"@antv/l7-core": "2.
|
|
31
|
-
"@antv/l7-maps": "2.
|
|
32
|
-
"@antv/l7-source": "2.
|
|
33
|
-
"@antv/l7-utils": "2.
|
|
30
|
+
"@antv/l7-core": "2.19.0",
|
|
31
|
+
"@antv/l7-maps": "2.19.0",
|
|
32
|
+
"@antv/l7-source": "2.19.0",
|
|
33
|
+
"@antv/l7-utils": "2.19.0",
|
|
34
34
|
"@babel/runtime": "^7.7.7",
|
|
35
35
|
"@mapbox/martini": "^0.2.0",
|
|
36
36
|
"@turf/clone": "^6.5.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"reflect-metadata": "^0.1.13"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@antv/l7-test-utils": "2.
|
|
55
|
+
"@antv/l7-test-utils": "2.19.0",
|
|
56
56
|
"@types/d3-array": "^2.0.0",
|
|
57
57
|
"@types/d3-color": "^1.2.2",
|
|
58
58
|
"@types/d3-interpolate": "1.1.6",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/gl-matrix": "^2.4.5",
|
|
62
62
|
"@types/lodash": "^4.14.138"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "7f08eaafe2a25e986ba52c625acf5511f1184b82",
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
precision highp float;
|
|
2
|
-
uniform mat4 u_ModelMatrix;
|
|
3
|
-
|
|
4
|
-
uniform mat4 u_Mvp;
|
|
5
|
-
uniform float u_opacity;
|
|
6
|
-
uniform float u_terrainClipHeight;
|
|
7
|
-
|
|
8
|
-
attribute vec3 a_Position;
|
|
9
|
-
attribute vec2 a_Uv;
|
|
10
|
-
attribute vec3 a_Color;
|
|
11
|
-
|
|
12
|
-
varying vec3 v_Color;
|
|
13
|
-
varying vec2 v_uv;
|
|
14
|
-
varying float v_clip;
|
|
15
|
-
|
|
16
|
-
#pragma include "projection"
|
|
17
|
-
#pragma include "picking"
|
|
18
|
-
void main() {
|
|
19
|
-
v_Color = a_Color;
|
|
20
|
-
v_uv = a_Uv;
|
|
21
|
-
|
|
22
|
-
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
23
|
-
|
|
24
|
-
v_clip = 1.0;
|
|
25
|
-
if(a_Position.z < u_terrainClipHeight) {
|
|
26
|
-
v_clip = 0.0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
|
|
30
|
-
|
|
31
|
-
// float x = 1.0;
|
|
32
|
-
// float y = 0.0;
|
|
33
|
-
// float z = 0.0;
|
|
34
|
-
// mat3 translateMatrix = mat3(
|
|
35
|
-
// 1.0, 0.0, 0.0
|
|
36
|
-
// 0.0, 1.0, 0.0
|
|
37
|
-
// -project_pos.x, -project_pos.y, 1.0
|
|
38
|
-
// );
|
|
39
|
-
// mat4 translateMatrix = mat4(
|
|
40
|
-
// 1.0, 0.0, 0.0, 0.0 ,
|
|
41
|
-
// 0.0, 1.0, 0.0, 0.0,
|
|
42
|
-
// 0.0, 0.0, 1.0, 0.0,
|
|
43
|
-
// 1.0, 0.0, 0.0, 1.0
|
|
44
|
-
// );
|
|
45
|
-
|
|
46
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
47
|
-
gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));
|
|
48
|
-
} else {
|
|
49
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, a_Position.z, 1.0));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
setPickingColor(a_PickingColor);
|
|
53
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
precision highp float;
|
|
2
|
-
uniform mat4 u_ModelMatrix;
|
|
3
|
-
|
|
4
|
-
uniform mat4 u_Mvp;
|
|
5
|
-
uniform float u_opacity;
|
|
6
|
-
uniform float u_terrainClipHeight;
|
|
7
|
-
|
|
8
|
-
attribute vec3 a_Position;
|
|
9
|
-
attribute vec2 a_Uv;
|
|
10
|
-
attribute vec3 a_Color;
|
|
11
|
-
|
|
12
|
-
varying vec3 v_Color;
|
|
13
|
-
varying vec2 v_uv;
|
|
14
|
-
varying float v_clip;
|
|
15
|
-
|
|
16
|
-
#pragma include "projection"
|
|
17
|
-
#pragma include "picking"
|
|
18
|
-
void main() {
|
|
19
|
-
v_Color = a_Color;
|
|
20
|
-
v_uv = a_Uv;
|
|
21
|
-
|
|
22
|
-
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
23
|
-
|
|
24
|
-
v_clip = 1.0;
|
|
25
|
-
if(a_Position.z < u_terrainClipHeight) {
|
|
26
|
-
v_clip = 0.0;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy,0., 1.0));
|
|
30
|
-
|
|
31
|
-
// float x = 1.0;
|
|
32
|
-
// float y = 0.0;
|
|
33
|
-
// float z = 0.0;
|
|
34
|
-
// mat3 translateMatrix = mat3(
|
|
35
|
-
// 1.0, 0.0, 0.0
|
|
36
|
-
// 0.0, 1.0, 0.0
|
|
37
|
-
// -project_pos.x, -project_pos.y, 1.0
|
|
38
|
-
// );
|
|
39
|
-
// mat4 translateMatrix = mat4(
|
|
40
|
-
// 1.0, 0.0, 0.0, 0.0 ,
|
|
41
|
-
// 0.0, 1.0, 0.0, 0.0,
|
|
42
|
-
// 0.0, 0.0, 1.0, 0.0,
|
|
43
|
-
// 1.0, 0.0, 0.0, 1.0
|
|
44
|
-
// );
|
|
45
|
-
|
|
46
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_P20_2) { // gaode2.x
|
|
47
|
-
gl_Position = u_Mvp * (vec4(project_pos.xy, a_Position.z, 1.0));
|
|
48
|
-
} else {
|
|
49
|
-
gl_Position = project_common_position_to_clipspace(vec4(project_pos.xy, a_Position.z, 1.0));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
setPickingColor(a_PickingColor);
|
|
53
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|