@antv/l7-layers 2.22.5 → 2.22.7
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.d.ts +19 -0
- package/es/core/BaseLayer.js +56 -0
- package/es/core/interface.d.ts +4 -3
- package/es/earth/models/atmosphere.js +1 -1
- package/es/earth/models/base.js +1 -1
- package/es/earth/models/bloomsphere.js +1 -1
- package/es/earth/shaders/atmosphere/atmosphere_frag.glsl +6 -9
- package/es/earth/shaders/base/base_frag.glsl +3 -3
- package/es/earth/shaders/bloomshpere/bloomsphere_frag.glsl +5 -6
- package/es/geometry/models/billboard.js +1 -1
- package/es/geometry/models/sprite.js +1 -1
- package/es/geometry/shaders/billboard_frag.glsl +4 -4
- package/es/geometry/shaders/sprite_frag.glsl +2 -4
- package/es/heatmap/models/heatmap.js +3 -3
- package/es/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +6 -7
- package/es/heatmap/shaders/heatmap/heatmap_frag.glsl +24 -36
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +5 -5
- package/es/line/models/flow.js +1 -1
- package/es/line/shaders/flow/flow_line_frag.glsl +0 -1
- package/es/plugins/LayerMaskPlugin.js +1 -1
- package/es/plugins/ShaderUniformPlugin.js +26 -8
- package/es/point/models/billboard_point.js +1 -1
- package/es/point/models/extrude.js +1 -1
- package/es/point/models/fill.js +1 -1
- package/es/point/models/image.js +1 -1
- package/es/point/models/normal.js +1 -1
- package/es/point/shaders/billboard/billboard_point_frag.glsl +6 -8
- package/es/point/shaders/extrude/extrude_frag.glsl +1 -3
- package/es/point/shaders/fill/fill_frag.glsl +14 -17
- package/es/point/shaders/image/image_frag.glsl +15 -12
- package/es/point/shaders/normal/normal_frag.glsl +1 -1
- package/es/polygon/models/extrude.js +3 -3
- package/es/polygon/models/extrusion.js +1 -1
- package/es/polygon/models/fill.js +1 -1
- package/es/polygon/models/ocean.js +1 -1
- package/es/polygon/models/water.js +1 -1
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +5 -6
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -8
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +4 -3
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +0 -2
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +4 -2
- package/es/polygon/shaders/ocean/ocean_frag.glsl +212 -182
- package/es/polygon/shaders/water/polygon_water_frag.glsl +25 -20
- package/es/raster/index.js +2 -1
- 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/raster_2d_frag.glsl +10 -7
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +16 -13
- package/es/raster/shaders/terrain/terrain_rgb_frag.glsl +18 -21
- package/lib/core/BaseLayer.d.ts +19 -0
- package/lib/core/BaseLayer.js +56 -0
- package/lib/core/interface.d.ts +4 -3
- package/lib/earth/models/atmosphere.js +1 -1
- package/lib/earth/models/base.js +1 -1
- package/lib/earth/models/bloomsphere.js +1 -1
- package/lib/earth/shaders/atmosphere/atmosphere_frag.glsl +6 -9
- package/lib/earth/shaders/base/base_frag.glsl +3 -3
- package/lib/earth/shaders/bloomshpere/bloomsphere_frag.glsl +5 -6
- package/lib/geometry/models/billboard.js +1 -1
- package/lib/geometry/models/sprite.js +1 -1
- package/lib/geometry/shaders/billboard_frag.glsl +4 -4
- package/lib/geometry/shaders/sprite_frag.glsl +2 -4
- package/lib/heatmap/models/heatmap.js +3 -3
- package/lib/heatmap/shaders/heatmap/heatmap_3d_frag.glsl +6 -7
- package/lib/heatmap/shaders/heatmap/heatmap_frag.glsl +24 -36
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +5 -5
- package/lib/line/models/flow.js +1 -1
- package/lib/line/shaders/flow/flow_line_frag.glsl +0 -1
- package/lib/plugins/LayerMaskPlugin.js +1 -1
- package/lib/plugins/ShaderUniformPlugin.js +26 -8
- package/lib/point/models/billboard_point.js +1 -1
- package/lib/point/models/extrude.js +1 -1
- package/lib/point/models/fill.js +1 -1
- package/lib/point/models/image.js +1 -1
- package/lib/point/models/normal.js +1 -1
- package/lib/point/shaders/billboard/billboard_point_frag.glsl +6 -8
- package/lib/point/shaders/extrude/extrude_frag.glsl +1 -3
- package/lib/point/shaders/fill/fill_frag.glsl +14 -17
- package/lib/point/shaders/image/image_frag.glsl +15 -12
- package/lib/point/shaders/normal/normal_frag.glsl +1 -1
- package/lib/polygon/models/extrude.js +3 -3
- package/lib/polygon/models/extrusion.js +1 -1
- package/lib/polygon/models/fill.js +1 -1
- package/lib/polygon/models/ocean.js +1 -1
- package/lib/polygon/models/water.js +1 -1
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +5 -6
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +7 -8
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +4 -3
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +0 -2
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +4 -2
- package/lib/polygon/shaders/ocean/ocean_frag.glsl +212 -182
- package/lib/polygon/shaders/water/polygon_water_frag.glsl +25 -20
- package/lib/raster/index.js +2 -1
- 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/raster_2d_frag.glsl +10 -7
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +16 -13
- package/lib/raster/shaders/terrain/terrain_rgb_frag.glsl +18 -21
- package/package.json +6 -6
|
@@ -11,7 +11,11 @@ uniform sampler2D u_colorTexture;
|
|
|
11
11
|
|
|
12
12
|
in vec2 v_texCoord;
|
|
13
13
|
|
|
14
|
-
bool isnan_emu(float x) {
|
|
14
|
+
bool isnan_emu(float x) {
|
|
15
|
+
return x > 0.0 || x < 0.0
|
|
16
|
+
? x != x
|
|
17
|
+
: x != 0.0;
|
|
18
|
+
}
|
|
15
19
|
|
|
16
20
|
out vec4 outputColor;
|
|
17
21
|
|
|
@@ -20,15 +24,14 @@ void main() {
|
|
|
20
24
|
float value = texture(SAMPLER_2D(u_rasterTexture), vec2(v_texCoord.x, v_texCoord.y)).r;
|
|
21
25
|
if (value == u_noDataValue || isnan_emu(value)) {
|
|
22
26
|
discard;
|
|
23
|
-
} else if (
|
|
27
|
+
} else if (u_clampLow < 0.5 && value < u_domain[0] || u_clampHigh < 0.5 && value > u_domain[1]) {
|
|
24
28
|
discard;
|
|
25
29
|
} else {
|
|
26
|
-
float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
30
|
+
float normalisedValue = (value - u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
27
31
|
vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(normalisedValue, 0));
|
|
28
|
-
|
|
32
|
+
|
|
29
33
|
outputColor = color;
|
|
30
|
-
outputColor.a = outputColor.a * u_opacity
|
|
31
|
-
if (outputColor.a < 0.01)
|
|
32
|
-
discard;
|
|
34
|
+
outputColor.a = outputColor.a * u_opacity;
|
|
35
|
+
if (outputColor.a < 0.01) discard;
|
|
33
36
|
}
|
|
34
37
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
uniform sampler2D u_texture;
|
|
2
2
|
layout(std140) uniform commonUniforms {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
vec2 u_rminmax;
|
|
4
|
+
vec2 u_gminmax;
|
|
5
|
+
vec2 u_bminmax;
|
|
6
|
+
float u_opacity;
|
|
7
|
+
float u_noDataValue;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
in vec2 v_texCoord;
|
|
@@ -12,16 +12,19 @@ in vec2 v_texCoord;
|
|
|
12
12
|
out vec4 outputColor;
|
|
13
13
|
|
|
14
14
|
void main() {
|
|
15
|
+
vec3 rgb = texture(SAMPLER_2D(u_texture), vec2(v_texCoord.x, v_texCoord.y)).rgb;
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if(rgb == vec3(u_noDataValue)) {
|
|
17
|
+
if (rgb == vec3(u_noDataValue)) {
|
|
19
18
|
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
20
19
|
} else {
|
|
21
|
-
outputColor = vec4(
|
|
20
|
+
outputColor = vec4(
|
|
21
|
+
rgb.r / (u_rminmax.y - u_rminmax.x),
|
|
22
|
+
rgb.g / (u_gminmax.y - u_gminmax.x),
|
|
23
|
+
rgb.b / (u_bminmax.y - u_bminmax.x),
|
|
24
|
+
u_opacity
|
|
25
|
+
);
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
if(outputColor.a < 0.01)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
+
if (outputColor.a < 0.01) discard;
|
|
29
|
+
|
|
30
|
+
}
|
|
@@ -2,42 +2,39 @@ uniform sampler2D u_texture;
|
|
|
2
2
|
uniform sampler2D u_colorTexture;
|
|
3
3
|
|
|
4
4
|
layout(std140) uniform commonUniforms {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
vec4 u_unpack;
|
|
6
|
+
vec2 u_domain;
|
|
7
|
+
float u_opacity;
|
|
8
|
+
float u_noDataValue;
|
|
9
|
+
float u_clampLow;
|
|
10
|
+
float u_clampHigh;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
in vec2 v_texCoord;
|
|
14
14
|
out vec4 outputColor;
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
float getElevation(vec2 coord, float bias) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
// Convert encoded elevation value to meters
|
|
18
|
+
vec4 data = texture(SAMPLER_2D(u_texture), coord, bias) * 255.0;
|
|
19
|
+
data.a = -1.0;
|
|
20
|
+
return dot(data, u_unpack);
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
vec4 getColor(float value) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
float normalisedValue = (value - u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
25
|
+
vec2 coord = vec2(normalisedValue, 0);
|
|
26
|
+
return texture(SAMPLER_2D(u_colorTexture), coord);
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
void main() {
|
|
31
|
-
float value = getElevation(v_texCoord,0.0);
|
|
30
|
+
float value = getElevation(v_texCoord, 0.0);
|
|
32
31
|
if (value == u_noDataValue) {
|
|
33
32
|
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
34
|
-
} else if (
|
|
35
|
-
|
|
33
|
+
} else if (u_clampLow < 0.5 && value < u_domain[0] || u_clampHigh < 0.5 && value > u_domain[1]) {
|
|
34
|
+
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
36
35
|
} else {
|
|
37
|
-
|
|
38
36
|
outputColor = getColor(value);
|
|
39
|
-
outputColor.a =
|
|
40
|
-
|
|
41
|
-
discard;
|
|
37
|
+
outputColor.a = outputColor.a * u_opacity;
|
|
38
|
+
if (outputColor.a < 0.01) discard;
|
|
42
39
|
}
|
|
43
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.22.
|
|
3
|
+
"version": "2.22.7",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "https://github.com/orgs/antvis/people",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"gl-matrix": "^3.1.0",
|
|
34
34
|
"gl-vec2": "^1.3.0",
|
|
35
35
|
"polyline-miter-util": "^1.0.1",
|
|
36
|
-
"@antv/l7-core": "2.22.
|
|
37
|
-
"@antv/l7-maps": "2.22.
|
|
38
|
-
"@antv/l7-
|
|
39
|
-
"@antv/l7-
|
|
36
|
+
"@antv/l7-core": "2.22.7",
|
|
37
|
+
"@antv/l7-maps": "2.22.7",
|
|
38
|
+
"@antv/l7-utils": "2.22.7",
|
|
39
|
+
"@antv/l7-source": "2.22.7"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/d3-array": "^2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/d3-scale": "^2.1.1",
|
|
46
46
|
"@types/earcut": "^2.1.0",
|
|
47
47
|
"@types/gl-matrix": "^2.4.5",
|
|
48
|
-
"@antv/l7-test-utils": "^2.22.
|
|
48
|
+
"@antv/l7-test-utils": "^2.22.7"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public",
|