@antv/l7-layers 2.20.2 → 2.20.5
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/core/BaseLayer.js +8 -6
- package/es/core/BaseModel.d.ts +20 -0
- package/es/core/BaseModel.js +71 -0
- package/es/core/CommonStyleAttribute.d.ts +2 -1
- package/es/core/CommonStyleAttribute.js +1 -0
- package/es/core/utils.d.ts +4 -0
- package/es/core/utils.js +15 -0
- package/es/line/models/great_circle.js +11 -7
- package/es/line/models/wall.js +3 -4
- package/es/line/shaders/wall/wall_frag.glsl +2 -4
- package/es/line/shaders/wall/wall_vert.glsl +4 -3
- package/es/point/models/extrude.d.ts +8 -10
- package/es/point/models/extrude.js +25 -11
- package/es/point/models/image.js +0 -4
- package/es/point/shaders/extrude/extrude_frag.glsl +19 -7
- package/es/point/shaders/extrude/extrude_vert.glsl +23 -29
- package/lib/core/BaseLayer.js +8 -6
- package/lib/core/BaseModel.js +71 -0
- package/lib/core/CommonStyleAttribute.js +1 -0
- package/lib/core/utils.js +22 -0
- package/lib/line/models/great_circle.js +11 -7
- package/lib/line/models/wall.js +2 -3
- package/lib/line/shaders/wall/wall_frag.glsl +2 -4
- package/lib/line/shaders/wall/wall_vert.glsl +4 -3
- package/lib/point/models/extrude.js +25 -11
- package/lib/point/models/image.js +0 -4
- package/lib/point/shaders/extrude/extrude_frag.glsl +19 -7
- package/lib/point/shaders/extrude/extrude_vert.glsl +23 -29
- package/package.json +7 -7
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
precision highp float;
|
|
2
|
-
|
|
3
1
|
#define pi 3.1415926535
|
|
4
2
|
#define ambientRatio 0.5
|
|
5
3
|
#define diffuseRatio 0.3
|
|
6
4
|
#define specularRatio 0.2
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
uniform
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
uniform float u_linearColor: 0.0;
|
|
29
|
-
|
|
6
|
+
layout(location = 0) in vec3 a_Position;
|
|
7
|
+
layout(location = 1) in vec4 a_Color;
|
|
8
|
+
layout(location = 9) in vec3 a_Size;
|
|
9
|
+
layout(location = 11) in vec3 a_Extrude;
|
|
10
|
+
layout(location = 13) in vec3 a_Normal;
|
|
11
|
+
|
|
12
|
+
layout(std140) uniform commonUniforms {
|
|
13
|
+
float u_pickLight;
|
|
14
|
+
float u_heightfixed;
|
|
15
|
+
float u_r;
|
|
16
|
+
float u_linearColor;
|
|
17
|
+
vec4 u_sourceColor;
|
|
18
|
+
vec4 u_targetColor;
|
|
19
|
+
float u_opacitylinear;
|
|
20
|
+
float u_opacitylinear_dir;
|
|
21
|
+
float u_lightEnable;
|
|
22
|
+
};
|
|
23
|
+
out vec4 v_color;
|
|
24
|
+
out float v_lightWeight;
|
|
25
|
+
out float v_barLinearZ;
|
|
30
26
|
|
|
31
27
|
#pragma include "projection"
|
|
32
28
|
#pragma include "light"
|
|
@@ -72,7 +68,7 @@ void main() {
|
|
|
72
68
|
}
|
|
73
69
|
|
|
74
70
|
|
|
75
|
-
vec4 project_pos = project_position(vec4(
|
|
71
|
+
vec4 project_pos = project_position(vec4(a_Extrude.xy, 0., 1.0));
|
|
76
72
|
|
|
77
73
|
// u_r 控制圆柱的生长
|
|
78
74
|
vec4 pos = vec4(project_pos.xy + offset.xy, offset.z * u_r, 1.0);
|
|
@@ -91,9 +87,9 @@ void main() {
|
|
|
91
87
|
// 设置圆柱的底色
|
|
92
88
|
if(u_linearColor == 1.0) { // 使用渐变颜色
|
|
93
89
|
v_color = mix(u_sourceColor, u_targetColor, a_Position.z);
|
|
94
|
-
v_color.a = v_color.a *
|
|
90
|
+
v_color.a = v_color.a * opacity;
|
|
95
91
|
} else {
|
|
96
|
-
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w *
|
|
92
|
+
v_color = vec4(a_Color.rgb * lightWeight, a_Color.w * opacity);
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
if(u_opacitylinear > 0.0) {
|
|
@@ -101,8 +97,6 @@ void main() {
|
|
|
101
97
|
}
|
|
102
98
|
|
|
103
99
|
|
|
104
|
-
// gl_Position = project_common_position_to_clipspace(pos);
|
|
105
|
-
|
|
106
100
|
gl_Position = project_common_position_to_clipspace_v2(pos);
|
|
107
101
|
|
|
108
102
|
setPickingColor(a_PickingColor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.5",
|
|
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.20.
|
|
31
|
-
"@antv/l7-maps": "2.20.
|
|
32
|
-
"@antv/l7-source": "2.20.
|
|
33
|
-
"@antv/l7-utils": "2.20.
|
|
30
|
+
"@antv/l7-core": "2.20.5",
|
|
31
|
+
"@antv/l7-maps": "2.20.5",
|
|
32
|
+
"@antv/l7-source": "2.20.5",
|
|
33
|
+
"@antv/l7-utils": "2.20.5",
|
|
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.20.
|
|
55
|
+
"@antv/l7-test-utils": "2.20.5",
|
|
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": "9c6df5f2ef050d18102f4aa4ccbb598bc1b5ee4d",
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
}
|