@antv/l7-layers 2.9.27-alpha.3 → 2.9.27-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Geometry/models/billboard.js +2 -5
- package/es/Geometry/models/plane.js +3 -3
- package/es/Geometry/models/sprite.js +2 -3
- package/es/core/BaseLayer.d.ts +5 -6
- package/es/core/BaseLayer.js +13 -19
- package/es/core/BaseModel.d.ts +1 -1
- package/es/core/BaseModel.js +15 -16
- package/es/core/interface.d.ts +2 -1
- package/es/earth/models/atmosphere.js +4 -7
- package/es/earth/models/base.js +10 -14
- package/es/earth/models/bloomsphere.js +4 -8
- package/es/heatmap/index.d.ts +2 -2
- package/es/heatmap/index.js +1 -3
- package/es/heatmap/models/grid.js +1 -3
- package/es/heatmap/models/grid3d.js +4 -11
- package/es/heatmap/models/heatmap.js +3 -6
- package/es/heatmap/models/hexagon.js +2 -6
- package/es/heatmap/triangulation.js +0 -1
- package/es/image/index.d.ts +1 -1
- package/es/image/index.js +4 -1
- package/es/image/models/dataImage.d.ts +1 -1
- package/es/image/models/dataImage.js +12 -34
- package/es/image/models/image.js +1 -3
- package/es/image/models/index.d.ts +1 -1
- package/es/image/models/index.js +3 -1
- package/es/image/models/tileDataImage.d.ts +19 -0
- package/es/image/models/tileDataImage.js +174 -0
- package/es/line/models/arc.js +7 -8
- package/es/line/models/arc_3d.js +8 -10
- package/es/line/models/earthArc_3d.js +8 -10
- package/es/line/models/great_circle.js +7 -7
- package/es/line/models/line.js +4 -4
- package/es/line/models/linearline.js +3 -4
- package/es/line/models/simpleLine.js +3 -3
- package/es/line/models/tile.js +1 -1
- package/es/line/models/wall.js +3 -3
- package/es/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/es/line/shaders/line_arc2d_vert.glsl +2 -2
- package/es/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/es/line/shaders/line_arc_3d_vert.glsl +3 -4
- package/es/line/shaders/line_arc_frag.glsl +9 -10
- package/es/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/es/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/es/line/shaders/line_arc_vert.glsl +2 -2
- package/es/line/shaders/line_bezier_vert.glsl +2 -2
- package/es/line/shaders/line_frag.glsl +5 -5
- package/es/line/shaders/line_vert.glsl +1 -1
- package/es/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/es/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
- package/es/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/es/line/shaders/wall/wall_frag.glsl +5 -5
- package/es/line/shaders/wall/wall_vert.glsl +2 -2
- package/es/plugins/LayerAnimateStylePlugin.js +2 -2
- package/es/point/index.js +3 -4
- package/es/point/models/earthExtrude.d.ts +1 -1
- package/es/point/models/earthExtrude.js +9 -14
- package/es/point/models/earthFill.js +2 -2
- package/es/point/models/extrude.d.ts +1 -1
- package/es/point/models/extrude.js +9 -12
- package/es/point/models/fill.d.ts +1 -1
- package/es/point/models/fill.js +7 -8
- package/es/point/models/fillmage.js +4 -5
- package/es/point/models/image.js +2 -2
- package/es/point/models/index.d.ts +1 -1
- package/es/point/models/index.js +3 -3
- package/es/point/models/normal.js +0 -2
- package/es/point/models/radar.js +1 -1
- package/es/point/models/text.js +1 -3
- package/es/point/models/tile.js +2 -3
- package/es/point/models/tileText.js +3 -5
- package/es/point/shaders/animate/wave_frag.glsl +2 -2
- package/es/polygon/models/extrude.js +3 -5
- package/es/raster/models/raster.d.ts +1 -1
- package/es/raster/models/raster.js +3 -3
- package/es/tile/manager/tileLayerManager.js +10 -0
- package/lib/Geometry/models/billboard.js +2 -5
- package/lib/Geometry/models/plane.js +3 -3
- package/lib/Geometry/models/sprite.js +2 -3
- package/lib/core/BaseLayer.js +13 -19
- package/lib/core/BaseModel.js +15 -16
- package/lib/earth/models/atmosphere.js +4 -7
- package/lib/earth/models/base.js +10 -14
- package/lib/earth/models/bloomsphere.js +4 -8
- package/lib/heatmap/index.js +1 -3
- package/lib/heatmap/models/grid.js +1 -3
- package/lib/heatmap/models/grid3d.js +4 -11
- package/lib/heatmap/models/heatmap.js +3 -6
- package/lib/heatmap/models/hexagon.js +2 -6
- package/lib/heatmap/triangulation.js +0 -1
- package/lib/image/index.js +4 -1
- package/lib/image/models/dataImage.js +11 -33
- package/lib/image/models/image.js +1 -3
- package/lib/image/models/index.js +4 -1
- package/lib/image/models/tileDataImage.js +188 -0
- package/lib/line/models/arc.js +7 -8
- package/lib/line/models/arc_3d.js +8 -10
- package/lib/line/models/earthArc_3d.js +8 -10
- package/lib/line/models/great_circle.js +7 -7
- package/lib/line/models/line.js +4 -4
- package/lib/line/models/linearline.js +3 -4
- package/lib/line/models/simpleLine.js +3 -3
- package/lib/line/models/tile.js +1 -1
- package/lib/line/models/wall.js +3 -3
- package/lib/line/shaders/dash/line_dash_frag.glsl +1 -1
- package/lib/line/shaders/line_arc2d_vert.glsl +2 -2
- package/lib/line/shaders/line_arc_3d_frag.glsl +10 -10
- package/lib/line/shaders/line_arc_3d_vert.glsl +3 -4
- package/lib/line/shaders/line_arc_frag.glsl +9 -10
- package/lib/line/shaders/line_arc_great_circle_frag.glsl +6 -6
- package/lib/line/shaders/line_arc_great_circle_vert.glsl +2 -3
- package/lib/line/shaders/line_arc_vert.glsl +2 -2
- package/lib/line/shaders/line_bezier_vert.glsl +2 -2
- package/lib/line/shaders/line_frag.glsl +5 -5
- package/lib/line/shaders/line_vert.glsl +1 -1
- package/lib/line/shaders/linear/arc3d_linear_frag.glsl +6 -7
- package/lib/line/shaders/linear/arc3d_linear_vert.glsl +9 -10
- package/lib/line/shaders/linear/arc_linear_frag.glsl +1 -1
- package/lib/line/shaders/wall/wall_frag.glsl +5 -5
- package/lib/line/shaders/wall/wall_vert.glsl +2 -2
- package/lib/plugins/LayerAnimateStylePlugin.js +2 -2
- package/lib/point/index.js +3 -4
- package/lib/point/models/earthExtrude.js +9 -14
- package/lib/point/models/earthFill.js +2 -2
- package/lib/point/models/extrude.js +9 -12
- package/lib/point/models/fill.js +7 -8
- package/lib/point/models/fillmage.js +4 -5
- package/lib/point/models/image.js +2 -2
- package/lib/point/models/index.js +1 -1
- package/lib/point/models/normal.js +0 -2
- package/lib/point/models/radar.js +1 -1
- package/lib/point/models/text.js +1 -3
- package/lib/point/models/tile.js +2 -3
- package/lib/point/models/tileText.js +3 -5
- package/lib/point/shaders/animate/wave_frag.glsl +2 -2
- package/lib/polygon/models/extrude.js +3 -5
- package/lib/raster/models/raster.js +3 -3
- package/lib/tile/manager/tileLayerManager.js +10 -0
- package/package.json +6 -6
|
@@ -13,9 +13,9 @@ uniform float u_global_height: 10;
|
|
|
13
13
|
uniform mat4 u_ModelMatrix;
|
|
14
14
|
uniform mat4 u_Mvp;
|
|
15
15
|
uniform float segmentNumber;
|
|
16
|
-
uniform vec4
|
|
16
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
17
17
|
varying vec4 v_color;
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
uniform float u_line_type: 0.0;
|
|
20
20
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
21
21
|
varying vec4 v_dash_array;
|
|
@@ -135,7 +135,6 @@ void main() {
|
|
|
135
135
|
float d_distance_ratio;
|
|
136
136
|
if(u_line_type == LineTypeDash) {
|
|
137
137
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
138
|
-
// float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
|
|
139
138
|
vec2 s = source;
|
|
140
139
|
vec2 t = target;
|
|
141
140
|
|
|
@@ -146,7 +145,7 @@ void main() {
|
|
|
146
145
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
147
146
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
148
147
|
}
|
|
149
|
-
if(
|
|
148
|
+
if(u_animate.x == Animate) {
|
|
150
149
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
151
150
|
}
|
|
152
151
|
styleMappingMat[3].g = d_distance_ratio; // 当前点位距离占线总长的比例
|
|
@@ -11,7 +11,7 @@ varying vec4 v_dash_array;
|
|
|
11
11
|
varying vec4 v_color;
|
|
12
12
|
|
|
13
13
|
uniform float u_time;
|
|
14
|
-
uniform vec4
|
|
14
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
15
15
|
|
|
16
16
|
uniform float u_line_texture;
|
|
17
17
|
uniform sampler2D u_texture;
|
|
@@ -34,10 +34,10 @@ void main() {
|
|
|
34
34
|
|
|
35
35
|
gl_FragColor.a *= opacity;
|
|
36
36
|
|
|
37
|
-
if(
|
|
38
|
-
animateSpeed = u_time /
|
|
39
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
40
|
-
alpha = (alpha +
|
|
37
|
+
if(u_animate.x == Animate && u_line_texture != LineTexture) {
|
|
38
|
+
animateSpeed = u_time / u_animate.y;
|
|
39
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
40
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
41
41
|
// alpha = smoothstep(0., 1., alpha);
|
|
42
42
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
43
43
|
gl_FragColor.a *= alpha;
|
|
@@ -51,8 +51,8 @@ void main() {
|
|
|
51
51
|
float count = styleMappingMat[3].g; // 贴图在弧线上重复的数量
|
|
52
52
|
|
|
53
53
|
float time = 0.0;
|
|
54
|
-
if(
|
|
55
|
-
time = u_time /
|
|
54
|
+
if(u_animate.x == Animate) {
|
|
55
|
+
time = u_time / u_animate.y;
|
|
56
56
|
}
|
|
57
57
|
float redioCount = arcRadio * count;
|
|
58
58
|
|
|
@@ -62,9 +62,9 @@ void main() {
|
|
|
62
62
|
|
|
63
63
|
vec4 pattern = texture2D(u_texture, uv);
|
|
64
64
|
|
|
65
|
-
if(
|
|
65
|
+
if(u_animate.x == Animate) {
|
|
66
66
|
float currentPlane = floor(redioCount - time);
|
|
67
|
-
float textureStep = floor(count *
|
|
67
|
+
float textureStep = floor(count * u_animate.z);
|
|
68
68
|
float a = mod(currentPlane, textureStep);
|
|
69
69
|
if(a < textureStep - 1.0) {
|
|
70
70
|
pattern = vec4(0.0);
|
|
@@ -85,5 +85,4 @@ void main() {
|
|
|
85
85
|
} else {
|
|
86
86
|
gl_FragColor = filterColor(gl_FragColor);
|
|
87
87
|
}
|
|
88
|
-
// gl_FragColor = filterColor(gl_FragColor);
|
|
89
88
|
}
|
|
@@ -13,7 +13,7 @@ varying float v_distance_ratio;
|
|
|
13
13
|
varying vec4 v_color;
|
|
14
14
|
|
|
15
15
|
uniform float u_time;
|
|
16
|
-
uniform vec4
|
|
16
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
17
17
|
|
|
18
18
|
uniform float u_line_texture: 0.0;
|
|
19
19
|
uniform sampler2D u_texture;
|
|
@@ -58,10 +58,10 @@ void main() {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// 设置弧线的动画模式
|
|
61
|
-
if(
|
|
62
|
-
animateSpeed = u_time /
|
|
63
|
-
float alpha =1.0 - fract( mod(1.0- v_distance_ratio,
|
|
64
|
-
alpha = (alpha +
|
|
61
|
+
if(u_animate.x == Animate) {
|
|
62
|
+
animateSpeed = u_time / u_animate.y;
|
|
63
|
+
float alpha =1.0 - fract( mod(1.0- v_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
64
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
65
65
|
alpha = smoothstep(0., 1., alpha);
|
|
66
66
|
gl_FragColor.a *= alpha;
|
|
67
67
|
}
|
|
@@ -73,7 +73,7 @@ void main() {
|
|
|
73
73
|
float count = styleMappingMat[3].b; // 贴图在弧线上重复的数量
|
|
74
74
|
float u = fract(arcRadio * count - animateSpeed * count);
|
|
75
75
|
// float u = fract(arcRadio * count - animateSpeed);
|
|
76
|
-
if(
|
|
76
|
+
if(u_animate.x == Animate) {
|
|
77
77
|
u = gl_FragColor.a/opacity;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -10,9 +10,8 @@ attribute float a_Size;
|
|
|
10
10
|
uniform mat4 u_ModelMatrix;
|
|
11
11
|
uniform mat4 u_Mvp;
|
|
12
12
|
uniform float segmentNumber;
|
|
13
|
-
uniform vec4
|
|
13
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
14
14
|
varying vec4 v_color;
|
|
15
|
-
// varying vec2 v_normal;
|
|
16
15
|
|
|
17
16
|
varying float v_distance_ratio;
|
|
18
17
|
uniform float u_line_type: 0.0;
|
|
@@ -172,7 +171,7 @@ void main() {
|
|
|
172
171
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / total_Distance;
|
|
173
172
|
}
|
|
174
173
|
|
|
175
|
-
if(
|
|
174
|
+
if(u_animate.x == Animate) {
|
|
176
175
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
177
176
|
}
|
|
178
177
|
|
|
@@ -8,7 +8,7 @@ attribute float a_Size;
|
|
|
8
8
|
uniform mat4 u_ModelMatrix;
|
|
9
9
|
uniform mat4 u_Mvp;
|
|
10
10
|
uniform float segmentNumber;
|
|
11
|
-
uniform vec4
|
|
11
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
12
12
|
varying vec4 v_color;
|
|
13
13
|
|
|
14
14
|
uniform float u_lineDir: 1.0;
|
|
@@ -123,7 +123,7 @@ void main() {
|
|
|
123
123
|
float nextSegmentRatio = getSegmentRatio(segmentIndex + indexDir);
|
|
124
124
|
float d_distance_ratio;
|
|
125
125
|
|
|
126
|
-
if(
|
|
126
|
+
if(u_animate.x == Animate) {
|
|
127
127
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
128
128
|
if(u_lineDir != 1.0) {
|
|
129
129
|
d_distance_ratio = 1.0 - d_distance_ratio;
|
|
@@ -7,7 +7,7 @@ attribute vec4 a_Instance;
|
|
|
7
7
|
attribute float a_Size;
|
|
8
8
|
uniform mat4 u_ModelMatrix;
|
|
9
9
|
uniform float segmentNumber;
|
|
10
|
-
uniform vec4
|
|
10
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
11
11
|
varying vec4 v_color;
|
|
12
12
|
varying vec2 v_normal;
|
|
13
13
|
|
|
@@ -72,7 +72,7 @@ void main() {
|
|
|
72
72
|
float total_Distance = pixelDistance(a_Instance.rg, a_Instance.ba) / 2.0 * PI;
|
|
73
73
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
74
74
|
}
|
|
75
|
-
if(
|
|
75
|
+
if(u_animate.x == Animate) {
|
|
76
76
|
v_distance_ratio = segmentIndex / segmentNumber;
|
|
77
77
|
}
|
|
78
78
|
vec4 curr = project_position(vec4(interpolate(source, target, segmentRatio), 0.0, 1.0));
|
|
@@ -19,7 +19,7 @@ varying vec2 v_iconMapUV;
|
|
|
19
19
|
#pragma include "picking"
|
|
20
20
|
|
|
21
21
|
uniform float u_time;
|
|
22
|
-
uniform vec4
|
|
22
|
+
uniform vec4 u_animate: [ 1, 2., 1.0, 0.2 ]; // 控制运动
|
|
23
23
|
|
|
24
24
|
varying mat4 styleMappingMat;
|
|
25
25
|
// [animate, duration, interval, trailLength],
|
|
@@ -31,10 +31,10 @@ void main() {
|
|
|
31
31
|
// anti-alias
|
|
32
32
|
// float blur = 1.0 - smoothstep(u_blur, 1., length(v_normal.xy));
|
|
33
33
|
gl_FragColor.a *= opacity; // 全局透明度
|
|
34
|
-
if(
|
|
35
|
-
animateSpeed = u_time /
|
|
36
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
37
|
-
alpha = (alpha +
|
|
34
|
+
if(u_animate.x == Animate) {
|
|
35
|
+
animateSpeed = u_time / u_animate.y;
|
|
36
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
37
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
38
38
|
alpha = smoothstep(0., 1., alpha);
|
|
39
39
|
gl_FragColor.a *= alpha;
|
|
40
40
|
}
|
|
@@ -15,7 +15,7 @@ attribute vec2 a_DistanceAndIndex;
|
|
|
15
15
|
|
|
16
16
|
uniform mat4 u_ModelMatrix;
|
|
17
17
|
uniform mat4 u_Mvp;
|
|
18
|
-
uniform vec4
|
|
18
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
19
19
|
uniform float u_icon_step: 100;
|
|
20
20
|
|
|
21
21
|
uniform float u_heightfixed: 0.0;
|
|
@@ -6,9 +6,8 @@ uniform float u_blur : 0.9;
|
|
|
6
6
|
varying float v_segmentIndex;
|
|
7
7
|
uniform float segmentNumber;
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
uniform float u_time;
|
|
11
|
-
uniform vec4
|
|
10
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
12
11
|
|
|
13
12
|
uniform float u_linearColor: 0;
|
|
14
13
|
uniform vec4 u_sourceColor;
|
|
@@ -27,16 +26,16 @@ void main() {
|
|
|
27
26
|
|
|
28
27
|
gl_FragColor.a *= opacity;
|
|
29
28
|
|
|
30
|
-
if(
|
|
31
|
-
animateSpeed = u_time /
|
|
32
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
29
|
+
if(u_animate.x == Animate) {
|
|
30
|
+
animateSpeed = u_time / u_animate.y;
|
|
31
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + u_time / u_animate.y);
|
|
33
32
|
|
|
34
|
-
alpha = (alpha +
|
|
33
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
35
34
|
// alpha = smoothstep(0., 1., alpha);
|
|
36
35
|
alpha = clamp(alpha, 0.0, 1.0);
|
|
37
36
|
gl_FragColor.a *= alpha;
|
|
38
37
|
|
|
39
|
-
//
|
|
38
|
+
// u_animate
|
|
40
39
|
// x enable
|
|
41
40
|
// y duration
|
|
42
41
|
// z interval
|
|
@@ -6,6 +6,7 @@ attribute vec3 a_Position;
|
|
|
6
6
|
attribute vec4 a_Instance;
|
|
7
7
|
attribute vec4 a_Color;
|
|
8
8
|
attribute float a_Size;
|
|
9
|
+
attribute vec2 a_iconMapUV;
|
|
9
10
|
|
|
10
11
|
uniform float u_globel;
|
|
11
12
|
uniform float u_globel_radius;
|
|
@@ -13,23 +14,21 @@ uniform float u_global_height: 10;
|
|
|
13
14
|
uniform mat4 u_ModelMatrix;
|
|
14
15
|
uniform mat4 u_Mvp;
|
|
15
16
|
uniform float segmentNumber;
|
|
16
|
-
uniform vec4
|
|
17
|
-
|
|
18
|
-
// varying vec2 v_normal;
|
|
17
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
18
|
+
|
|
19
19
|
uniform float u_line_type: 0.0;
|
|
20
20
|
uniform vec4 u_dash_array: [10.0, 5., 0, 0];
|
|
21
|
-
varying vec4 v_dash_array;
|
|
22
|
-
|
|
23
21
|
uniform float u_icon_step: 100;
|
|
24
22
|
uniform float u_line_texture: 0.0;
|
|
25
|
-
|
|
23
|
+
uniform float u_opacity: 1.0;
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
varying vec4 v_dash_array;
|
|
26
|
+
varying vec4 v_color;
|
|
27
|
+
varying float v_segmentIndex;
|
|
28
28
|
varying vec2 v_iconMapUV;
|
|
29
|
-
|
|
30
|
-
uniform float u_opacity: 1.0;
|
|
31
29
|
varying mat4 styleMappingMat; // 用于将在顶点着色器中计算好的样式值传递给片元
|
|
32
30
|
|
|
31
|
+
|
|
33
32
|
#pragma include "styleMapping"
|
|
34
33
|
#pragma include "styleMappingCalOpacity"
|
|
35
34
|
|
|
@@ -146,7 +145,7 @@ void main() {
|
|
|
146
145
|
float total_Distance = pixelDistance(s, t) / 2.0 * PI;
|
|
147
146
|
v_dash_array = pow(2.0, 20.0 - u_Zoom) * u_dash_array / (total_Distance / segmentNumber * segmentIndex);
|
|
148
147
|
}
|
|
149
|
-
if(
|
|
148
|
+
if(u_animate.x == Animate) {
|
|
150
149
|
d_distance_ratio = segmentIndex / segmentNumber;
|
|
151
150
|
}
|
|
152
151
|
styleMappingMat[3].g = d_distance_ratio; // 当前点位距离占线总长的比例
|
|
@@ -12,7 +12,7 @@ uniform float u_opacity : 1.0;
|
|
|
12
12
|
uniform float u_textureBlend;
|
|
13
13
|
uniform float u_iconStepCount;
|
|
14
14
|
uniform float u_time;
|
|
15
|
-
uniform vec4
|
|
15
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ]; // 控制运动
|
|
16
16
|
|
|
17
17
|
varying vec2 v_iconMapUV;
|
|
18
18
|
varying float v_blur;
|
|
@@ -35,10 +35,10 @@ void main() {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
gl_FragColor.a *= opacity; // 全局透明度
|
|
38
|
-
if(
|
|
39
|
-
animateSpeed = u_time /
|
|
40
|
-
float alpha =1.0 - fract( mod(1.0- d_distance_ratio,
|
|
41
|
-
alpha = (alpha +
|
|
38
|
+
if(u_animate.x == Animate) {
|
|
39
|
+
animateSpeed = u_time / u_animate.y;
|
|
40
|
+
float alpha =1.0 - fract( mod(1.0- d_distance_ratio, u_animate.z)* (1.0/ u_animate.z) + animateSpeed);
|
|
41
|
+
alpha = (alpha + u_animate.w -1.0) / u_animate.w;
|
|
42
42
|
alpha = smoothstep(0., 1., alpha);
|
|
43
43
|
gl_FragColor.a *= alpha;
|
|
44
44
|
}
|
|
@@ -11,7 +11,7 @@ attribute float a_Distance;
|
|
|
11
11
|
|
|
12
12
|
uniform mat4 u_ModelMatrix;
|
|
13
13
|
uniform mat4 u_Mvp;
|
|
14
|
-
uniform vec4
|
|
14
|
+
uniform vec4 u_animate: [ 1., 2., 1.0, 0.2 ];
|
|
15
15
|
uniform float u_icon_step: 100;
|
|
16
16
|
uniform float u_heightfixed;
|
|
17
17
|
uniform float u_linearColor: 0;
|
|
@@ -43,7 +43,7 @@ void main() {
|
|
|
43
43
|
d_texPixelLen *= 10.0;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
if(
|
|
46
|
+
if(u_animate.x == Animate || u_linearColor == 1.0) {
|
|
47
47
|
d_distance_ratio = a_Distance / a_Total_Distance;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -29,8 +29,8 @@ var LayerAnimateStylePlugin = (_dec = (0, _inversify.injectable)(), _dec(_class
|
|
|
29
29
|
value: function apply(layer) {
|
|
30
30
|
layer.hooks.beforeRender.tap('LayerAnimateStylePlugin', function () {
|
|
31
31
|
// @ts-ignore
|
|
32
|
-
var
|
|
33
|
-
|
|
32
|
+
var animateStatus = layer.animateStatus;
|
|
33
|
+
animateStatus && layer.models.forEach(function (model) {
|
|
34
34
|
model.addUniforms((0, _objectSpread2.default)({}, layer.layerModel.getAnimateUniforms()));
|
|
35
35
|
});
|
|
36
36
|
});
|
package/lib/point/index.js
CHANGED
|
@@ -170,7 +170,7 @@ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
170
170
|
text: {
|
|
171
171
|
blend: 'normal'
|
|
172
172
|
},
|
|
173
|
-
|
|
173
|
+
vectorPoint: {},
|
|
174
174
|
tile: {},
|
|
175
175
|
tileText: {},
|
|
176
176
|
earthFill: {},
|
|
@@ -184,9 +184,8 @@ var PointLayer = /*#__PURE__*/function (_BaseLayer) {
|
|
|
184
184
|
var parserType = this.layerSource.getParserType();
|
|
185
185
|
|
|
186
186
|
if ((0, _utils.isVectorTile)(parserType)) {
|
|
187
|
-
return '
|
|
188
|
-
} //
|
|
189
|
-
// 2D、 3d、 shape、image、text、normal、
|
|
187
|
+
return 'vectorPoint';
|
|
188
|
+
} // 2D、 3d、 shape、image、text、normal、
|
|
190
189
|
|
|
191
190
|
|
|
192
191
|
var layerData = this.getEncodedData();
|
|
@@ -59,7 +59,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
59
59
|
|
|
60
60
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
61
61
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "raiseCount", 0);
|
|
62
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
62
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "raiseRepeat", 0);
|
|
63
63
|
return _this;
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -133,18 +133,16 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
133
133
|
useLinearColor = 1;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
if (this.raiseCount < 1 && this.
|
|
136
|
+
if (this.raiseCount < 1 && this.raiseRepeat > 0) {
|
|
137
137
|
if (animateOption.enable) {
|
|
138
138
|
var _animateOption$speed = animateOption.speed,
|
|
139
|
-
speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed
|
|
140
|
-
_animateOption$repeat = animateOption.repeat,
|
|
141
|
-
repeat = _animateOption$repeat === void 0 ? false : _animateOption$repeat;
|
|
139
|
+
speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed;
|
|
142
140
|
this.raiseCount += speed;
|
|
143
141
|
|
|
144
142
|
if (this.raiseCount >= 1) {
|
|
145
|
-
if (this.
|
|
143
|
+
if (this.raiseRepeat > 1) {
|
|
146
144
|
this.raiseCount = 0;
|
|
147
|
-
this.
|
|
145
|
+
this.raiseRepeat--;
|
|
148
146
|
} else {
|
|
149
147
|
this.raiseCount = 1;
|
|
150
148
|
}
|
|
@@ -157,7 +155,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
157
155
|
u_pickLight: Number(pickLight),
|
|
158
156
|
// 圆柱体是否固定高度
|
|
159
157
|
u_heightfixed: Number(heightfixed),
|
|
160
|
-
u_r: animateOption.enable && this.
|
|
158
|
+
u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
|
|
161
159
|
u_dataTexture: this.dataTexture,
|
|
162
160
|
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
163
161
|
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
@@ -186,7 +184,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
186
184
|
_ref2$animateOption$r = _ref2.animateOption.repeat,
|
|
187
185
|
repeat = _ref2$animateOption$r === void 0 ? 1 : _ref2$animateOption$r;
|
|
188
186
|
|
|
189
|
-
this.
|
|
187
|
+
this.raiseRepeat = repeat;
|
|
190
188
|
this.layer.buildLayerModel({
|
|
191
189
|
moduleName: 'pointEarthExtrude',
|
|
192
190
|
vertexShader: pointExtrudeVert,
|
|
@@ -217,20 +215,18 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
217
215
|
}, {
|
|
218
216
|
key: "registerBuiltinAttributes",
|
|
219
217
|
value: function registerBuiltinAttributes() {
|
|
220
|
-
// point layer size;
|
|
221
218
|
this.styleAttributeService.registerStyleAttribute({
|
|
222
219
|
name: 'size',
|
|
223
220
|
type: _l7Core.AttributeType.Attribute,
|
|
224
221
|
descriptor: {
|
|
225
222
|
name: 'a_Size',
|
|
226
223
|
buffer: {
|
|
227
|
-
// give the WebGL driver a hint that this buffer may change
|
|
228
224
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
229
225
|
data: [],
|
|
230
226
|
type: _l7Core.gl.FLOAT
|
|
231
227
|
},
|
|
232
228
|
size: 3,
|
|
233
|
-
update: function update(feature
|
|
229
|
+
update: function update(feature) {
|
|
234
230
|
var size = feature.size;
|
|
235
231
|
|
|
236
232
|
if (size) {
|
|
@@ -275,13 +271,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
275
271
|
descriptor: {
|
|
276
272
|
name: 'a_Pos',
|
|
277
273
|
buffer: {
|
|
278
|
-
// give the WebGL driver a hint that this buffer may change
|
|
279
274
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
280
275
|
data: [],
|
|
281
276
|
type: _l7Core.gl.FLOAT
|
|
282
277
|
},
|
|
283
278
|
size: 3,
|
|
284
|
-
update: function update(feature
|
|
279
|
+
update: function update(feature) {
|
|
285
280
|
var coordinates = (0, _l7Utils.calculateCentroid)(feature.coordinates);
|
|
286
281
|
return (0, _utils.lglt2xyz)([coordinates[0], coordinates[1]]);
|
|
287
282
|
}
|
|
@@ -39,7 +39,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
39
39
|
var pointFillFrag = "uniform float u_additive;\n\nvarying mat4 styleMappingMat; // \u4F20\u9012\u4ECE\u7247\u5143\u4E2D\u4F20\u9012\u7684\u6620\u5C04\u6570\u636E\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\n#pragma include \"sdf_2d\"\n#pragma include \"picking\"\n\n\nvoid main() {\n int shape = int(floor(v_data.w + 0.5));\n\n vec4 textrueStroke = vec4(\n styleMappingMat[1][0],\n styleMappingMat[1][1],\n styleMappingMat[1][2],\n styleMappingMat[1][3]\n );\n\n float opacity = styleMappingMat[0][0];\n float stroke_opacity = styleMappingMat[0][1];\n float strokeWidth = styleMappingMat[0][2];\n vec4 strokeColor = textrueStroke == vec4(0) ? v_color : textrueStroke;\n\n lowp float antialiasblur = v_data.z;\n float r = v_radius / (v_radius + strokeWidth);\n\n float outer_df;\n float inner_df;\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\n if (shape == 0) {\n outer_df = sdCircle(v_data.xy, 1.0);\n inner_df = sdCircle(v_data.xy, r);\n } else if (shape == 1) {\n outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\n inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\n } else if (shape == 2) {\n outer_df = sdBox(v_data.xy, vec2(1.));\n inner_df = sdBox(v_data.xy, vec2(r));\n } else if (shape == 3) {\n outer_df = sdPentagon(v_data.xy, 0.8);\n inner_df = sdPentagon(v_data.xy, r * 0.8);\n } else if (shape == 4) {\n outer_df = sdHexagon(v_data.xy, 0.8);\n inner_df = sdHexagon(v_data.xy, r * 0.8);\n } else if (shape == 5) {\n outer_df = sdOctogon(v_data.xy, 1.0);\n inner_df = sdOctogon(v_data.xy, r);\n } else if (shape == 6) {\n outer_df = sdHexagram(v_data.xy, 0.52);\n inner_df = sdHexagram(v_data.xy, r * 0.52);\n } else if (shape == 7) {\n outer_df = sdRhombus(v_data.xy, vec2(1.0));\n inner_df = sdRhombus(v_data.xy, vec2(r));\n } else if (shape == 8) {\n outer_df = sdVesica(v_data.xy, 1.1, 0.8);\n inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\n }\n\n if(outer_df > antialiasblur + 0.018) discard;\n\n float opacity_t = smoothstep(0.0, antialiasblur, outer_df);\n\n float color_t = strokeWidth < 0.01 ? 0.0 : smoothstep(\n antialiasblur,\n 0.0,\n inner_df\n );\n\n if(strokeWidth < 0.01) {\n gl_FragColor = vec4(v_color.rgb, v_color.a * opacity);\n } else {\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * opacity), strokeColor * stroke_opacity, color_t);\n }\n\n if(u_additive > 0.0) {\n gl_FragColor *= opacity_t;\n gl_FragColor = filterColorAlpha(gl_FragColor, gl_FragColor.a);\n } else {\n gl_FragColor.a *= opacity_t;\n gl_FragColor = filterColor(gl_FragColor);\n }\n}\n";
|
|
40
40
|
|
|
41
41
|
/* babel-plugin-inline-import '../shaders/earth/fill_vert.glsl' */
|
|
42
|
-
var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][1] = strokeOpacityAndOffset.r;\n textureOffset = strokeOpacityAndOffset.g;\n\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n\n // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n //
|
|
42
|
+
var pointFillVert = "attribute vec4 a_Color;\nattribute vec3 a_Position;\nattribute vec3 a_Extrude;\nattribute float a_Size;\nattribute float a_Shape;\n\nvarying mat4 styleMappingMat; // \u7528\u4E8E\u5C06\u5728\u9876\u70B9\u7740\u8272\u5668\u4E2D\u8BA1\u7B97\u597D\u7684\u6837\u5F0F\u503C\u4F20\u9012\u7ED9\u7247\u5143\n\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_Mvp;\n\nvarying vec4 v_data;\nvarying vec4 v_color;\nvarying float v_radius;\n\nuniform float u_opacity : 1;\nuniform float u_stroke_opacity : 1;\nuniform float u_stroke_width : 2;\nuniform vec4 u_stroke_color : [0.0, 0.0, 0.0, 0.0];\nuniform vec2 u_offsets;\n\nuniform float u_blur : 0.0;\n\n#pragma include \"styleMapping\"\n#pragma include \"styleMappingCalOpacity\"\n#pragma include \"styleMappingCalStrokeOpacity\"\n#pragma include \"styleMappingCalStrokeWidth\"\n\n#pragma include \"projection\"\n#pragma include \"picking\"\n\n\nvoid main() {\n vec3 extrude = a_Extrude;\n float shape_type = a_Shape;\n /*\n * setPickingSize \u8BBE\u7F6E\u62FE\u53D6\u5927\u5C0F\n */\n float newSize = setPickingSize(a_Size);\n // float newSize = setPickingSize(a_Size) * 0.00001038445708445579;\n\n // cal style mapping - \u6570\u636E\u7EB9\u7406\u6620\u5C04\u90E8\u5206\u7684\u8BA1\u7B97\n styleMappingMat = mat4(\n 0.0, 0.0, 0.0, 0.0, // opacity - strokeOpacity - strokeWidth - empty\n 0.0, 0.0, 0.0, 0.0, // strokeR - strokeG - strokeB - strokeA\n 0.0, 0.0, 0.0, 0.0, // offsets[0] - offsets[1]\n 0.0, 0.0, 0.0, 0.0\n );\n\n float rowCount = u_cellTypeLayout[0][0]; // \u5F53\u524D\u7684\u6570\u636E\u7EB9\u7406\u6709\u51E0\u884C\n float columnCount = u_cellTypeLayout[0][1]; // \u5F53\u770B\u5230\u6570\u636E\u7EB9\u7406\u6709\u51E0\u5217\n float columnWidth = 1.0/columnCount; // \u5217\u5BBD\n float rowHeight = 1.0/rowCount; // \u884C\u9AD8\n float cellCount = calCellCount(); // opacity - strokeOpacity - strokeWidth - stroke - offsets\n float id = a_vertexId; // \u7B2Cn\u4E2A\u9876\u70B9\n float cellCurrentRow = floor(id * cellCount / columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u884C\n float cellCurrentColumn = mod(id * cellCount, columnCount) + 1.0; // \u8D77\u59CB\u70B9\u5728\u7B2C\u51E0\u5217\n \n // cell \u56FA\u5B9A\u987A\u5E8F opacity -> strokeOpacity -> strokeWidth -> stroke ... \n // \u6309\u987A\u5E8F\u4ECE cell \u4E2D\u53D6\u503C\u3001\u82E5\u6CA1\u6709\u5219\u81EA\u52A8\u5F80\u4E0B\u53D6\u503C\n float textureOffset = 0.0; // \u5728 cell \u4E2D\u53D6\u503C\u7684\u504F\u79FB\u91CF\n\n vec2 opacityAndOffset = calOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][0] = opacityAndOffset.r;\n textureOffset = opacityAndOffset.g;\n\n vec2 strokeOpacityAndOffset = calStrokeOpacityAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][1] = strokeOpacityAndOffset.r;\n textureOffset = strokeOpacityAndOffset.g;\n\n vec2 strokeWidthAndOffset = calStrokeWidthAndOffset(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset, columnWidth, rowHeight);\n styleMappingMat[0][2] = strokeWidthAndOffset.r;\n textureOffset = strokeWidthAndOffset.g;\n\n vec4 textrueStroke = vec4(-1.0, -1.0, -1.0, -1.0);\n if(hasStroke()) {\n vec2 valueRPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][0] = pos2value(valueRPos, columnWidth, rowHeight); // R\n textureOffset += 1.0;\n\n vec2 valueGPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][1] = pos2value(valueGPos, columnWidth, rowHeight); // G\n textureOffset += 1.0;\n\n vec2 valueBPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][2] = pos2value(valueBPos, columnWidth, rowHeight); // B\n textureOffset += 1.0;\n\n vec2 valueAPos = nextPos(cellCurrentRow, cellCurrentColumn, columnCount, textureOffset);\n styleMappingMat[1][3] = pos2value(valueAPos, columnWidth, rowHeight); // A\n textureOffset += 1.0;\n } else {\n if(u_stroke_color == vec4(0.0)) {\n styleMappingMat[1][0] = v_color.r;\n styleMappingMat[1][1] = v_color.g;\n styleMappingMat[1][2] = v_color.b;\n styleMappingMat[1][3] = v_color.a;\n } else {\n styleMappingMat[1][0] = u_stroke_color.r;\n styleMappingMat[1][1] = u_stroke_color.g;\n styleMappingMat[1][2] = u_stroke_color.b;\n styleMappingMat[1][3] = u_stroke_color.a;\n }\n }\n\n // cal style mapping\n\n // unpack color(vec2)\n v_color = a_Color;\n\n // radius(16-bit)\n v_radius = newSize;\n\n // anti-alias\n // float antialiased_blur = -max(u_blur, antialiasblur);\n float antialiasblur = -max(2.0 / u_DevicePixelRatio / newSize, u_blur);\n\n // TODP: /abs(extrude.x) \u662F\u4E3A\u4E86\u517C\u5BB9\u5730\u7403\u6A21\u5F0F\n v_data = vec4(extrude.x/abs(extrude.x), extrude.y/abs(extrude.y), antialiasblur,shape_type);\n\n\n gl_Position = u_ViewProjectionMatrix * vec4(a_Position + extrude * newSize * 0.1, 1.0);\n\n setPickingColor(a_PickingColor);\n}\n";
|
|
43
43
|
|
|
44
44
|
var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
45
45
|
(0, _inherits2.default)(FillModel, _BaseModel);
|
|
@@ -133,7 +133,7 @@ var FillModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
133
133
|
} : _ref2$animateOption;
|
|
134
134
|
|
|
135
135
|
return {
|
|
136
|
-
|
|
136
|
+
u_animate: this.animateOption2Array(animateOption),
|
|
137
137
|
u_time: this.layer.getLayerAnimateTime()
|
|
138
138
|
};
|
|
139
139
|
}
|
|
@@ -61,7 +61,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
61
61
|
|
|
62
62
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
63
63
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "raiseCount", 0);
|
|
64
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "
|
|
64
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "raiseRepeat", 0);
|
|
65
65
|
return _this;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -135,18 +135,16 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
135
135
|
useLinearColor = 1;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
if (this.raiseCount < 1 && this.
|
|
138
|
+
if (this.raiseCount < 1 && this.raiseRepeat > 0) {
|
|
139
139
|
if (animateOption.enable) {
|
|
140
140
|
var _animateOption$speed = animateOption.speed,
|
|
141
|
-
speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed
|
|
142
|
-
_animateOption$repeat = animateOption.repeat,
|
|
143
|
-
repeat = _animateOption$repeat === void 0 ? false : _animateOption$repeat;
|
|
141
|
+
speed = _animateOption$speed === void 0 ? 0.01 : _animateOption$speed;
|
|
144
142
|
this.raiseCount += speed;
|
|
145
143
|
|
|
146
144
|
if (this.raiseCount >= 1) {
|
|
147
|
-
if (this.
|
|
145
|
+
if (this.raiseRepeat > 1) {
|
|
148
146
|
this.raiseCount = 0;
|
|
149
|
-
this.
|
|
147
|
+
this.raiseRepeat--;
|
|
150
148
|
} else {
|
|
151
149
|
this.raiseCount = 1;
|
|
152
150
|
}
|
|
@@ -159,7 +157,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
159
157
|
u_pickLight: Number(pickLight),
|
|
160
158
|
// 圆柱体是否固定高度
|
|
161
159
|
u_heightfixed: Number(heightfixed),
|
|
162
|
-
u_r: animateOption.enable && this.
|
|
160
|
+
u_r: animateOption.enable && this.raiseRepeat > 0 ? this.raiseCount : 1.0,
|
|
163
161
|
u_dataTexture: this.dataTexture,
|
|
164
162
|
// 数据纹理 - 有数据映射的时候纹理中带数据,若没有任何数据映射时纹理是 [1]
|
|
165
163
|
u_cellTypeLayout: this.getCellTypeLayout(),
|
|
@@ -192,7 +190,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
192
190
|
case 0:
|
|
193
191
|
// GAODE1.x GAODE2.x MAPBOX
|
|
194
192
|
_ref2 = this.layer.getLayerConfig(), _ref2$depth = _ref2.depth, depth = _ref2$depth === void 0 ? true : _ref2$depth, _ref2$animateOption$r = _ref2.animateOption.repeat, repeat = _ref2$animateOption$r === void 0 ? 1 : _ref2$animateOption$r;
|
|
195
|
-
this.
|
|
193
|
+
this.raiseRepeat = repeat;
|
|
196
194
|
this.layer.buildLayerModel({
|
|
197
195
|
moduleName: 'pointExtrude',
|
|
198
196
|
vertexShader: pointExtrudeVert,
|
|
@@ -244,13 +242,12 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
244
242
|
descriptor: {
|
|
245
243
|
name: 'a_Size',
|
|
246
244
|
buffer: {
|
|
247
|
-
// give the WebGL driver a hint that this buffer may change
|
|
248
245
|
usage: _l7Core.gl.DYNAMIC_DRAW,
|
|
249
246
|
data: [],
|
|
250
247
|
type: _l7Core.gl.FLOAT
|
|
251
248
|
},
|
|
252
249
|
size: 3,
|
|
253
|
-
update: function update(feature
|
|
250
|
+
update: function update(feature) {
|
|
254
251
|
var size = feature.size;
|
|
255
252
|
|
|
256
253
|
if (size) {
|
|
@@ -301,7 +298,7 @@ var ExtrudeModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
301
298
|
type: _l7Core.gl.FLOAT
|
|
302
299
|
},
|
|
303
300
|
size: 3,
|
|
304
|
-
update: function update(feature
|
|
301
|
+
update: function update(feature) {
|
|
305
302
|
var coordinates = (0, _l7Utils.calculateCentroid)(feature.coordinates);
|
|
306
303
|
return [coordinates[0], coordinates[1], 0];
|
|
307
304
|
}
|