@antv/l7-layers 2.20.13 → 2.20.15
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 +0 -1
- package/es/core/BaseLayer.js +8 -5
- package/es/core/LayerPickService.d.ts +1 -1
- package/es/core/LayerPickService.js +28 -10
- package/es/core/TextureService.js +2 -1
- package/es/geometry/models/sprite.js +2 -2
- package/es/heatmap/models/grid.js +2 -2
- package/es/heatmap/models/grid3d.js +4 -4
- package/es/heatmap/models/heatmap.js +10 -6
- package/es/heatmap/shaders/grid/grid_frag.glsl +1 -0
- package/es/heatmap/shaders/grid3d/grid_3d_frag.glsl +9 -0
- package/es/heatmap/shaders/grid3d/grid_3d_vert.glsl +4 -8
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +2 -1
- package/es/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +3 -1
- package/es/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -0
- package/es/image/models/image.js +6 -8
- package/es/line/models/arc.js +1 -1
- package/es/line/models/line.js +10 -45
- package/es/line/shaders/arc/line_arc_frag.glsl +2 -1
- package/es/line/shaders/line/line_frag.glsl +2 -2
- package/es/line/shaders/line/line_vert.glsl +10 -7
- package/es/plugins/ShaderUniformPlugin.js +16 -11
- package/es/point/models/extrude.js +2 -2
- package/es/point/models/fill.js +1 -1
- package/es/point/models/fillImage.js +3 -5
- package/es/point/models/text.js +2 -2
- package/es/point/shaders/extrude/extrude_frag.glsl +1 -0
- package/es/point/shaders/extrude/extrude_vert.glsl +0 -1
- package/es/point/shaders/fill/fill_frag.glsl +1 -1
- package/es/point/shaders/fillImage/fillImage_frag.glsl +1 -2
- package/es/point/shaders/text/text_frag.glsl +3 -2
- package/es/point/shaders/text/text_vert.glsl +0 -2
- package/es/polygon/models/extrude.js +30 -39
- package/es/polygon/models/extrusion.js +1 -1
- package/es/polygon/models/fill.js +3 -3
- package/es/polygon/models/water.js +6 -4
- package/es/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -0
- package/es/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +2 -3
- package/es/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +7 -9
- package/es/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +1 -2
- package/es/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +1 -0
- package/es/polygon/shaders/fill/fill_frag.glsl +1 -0
- package/es/polygon/shaders/fill/fill_linear_frag.glsl +4 -3
- package/es/polygon/shaders/fill/fill_linear_vert.glsl +5 -8
- package/es/raster/models/raster.js +6 -5
- package/es/raster/models/rasterRgb.js +3 -2
- package/es/raster/models/rasterTerrainRgb.d.ts +8 -2
- package/es/raster/models/rasterTerrainRgb.js +20 -14
- package/es/raster/shaders/raster/raster_2d_frag.glsl +3 -3
- package/es/raster/shaders/raster/raster_2d_vert.glsl +2 -2
- package/es/raster/shaders/rgb/raster_rgb_frag.glsl +1 -0
- package/es/raster/shaders/terrain/terrain_rgb_frag.glsl +19 -17
- package/es/raster/shaders/terrain/terrain_rgb_vert.glsl +12 -5
- package/es/tile/core/BaseLayer.js +7 -7
- package/es/tile/service/TilePickService.d.ts +1 -1
- package/es/tile/service/TilePickService.js +36 -13
- package/es/tile/tile/Tile.js +4 -3
- package/es/utils/load-image.d.ts +1 -0
- package/es/utils/load-image.js +46 -0
- package/lib/core/BaseLayer.js +8 -5
- package/lib/core/LayerPickService.js +28 -10
- package/lib/core/TextureService.js +2 -1
- package/lib/geometry/models/sprite.js +2 -2
- package/lib/heatmap/models/grid.js +2 -2
- package/lib/heatmap/models/grid3d.js +4 -4
- package/lib/heatmap/models/heatmap.js +10 -6
- package/lib/heatmap/shaders/grid/grid_frag.glsl +1 -0
- package/lib/heatmap/shaders/grid3d/grid_3d_frag.glsl +9 -0
- package/lib/heatmap/shaders/grid3d/grid_3d_vert.glsl +4 -8
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_frag.glsl +2 -1
- package/lib/heatmap/shaders/heatmap/heatmap_framebuffer_vert.glsl +3 -1
- package/lib/heatmap/shaders/heatmap/heatmap_vert.glsl +3 -0
- package/lib/image/models/image.js +6 -8
- package/lib/line/models/arc.js +1 -1
- package/lib/line/models/line.js +10 -45
- package/lib/line/shaders/arc/line_arc_frag.glsl +2 -1
- package/lib/line/shaders/line/line_frag.glsl +2 -2
- package/lib/line/shaders/line/line_vert.glsl +10 -7
- package/lib/plugins/ShaderUniformPlugin.js +16 -11
- package/lib/point/models/extrude.js +2 -2
- package/lib/point/models/fill.js +1 -1
- package/lib/point/models/fillImage.js +3 -5
- package/lib/point/models/text.js +2 -2
- package/lib/point/shaders/extrude/extrude_frag.glsl +1 -0
- package/lib/point/shaders/extrude/extrude_vert.glsl +0 -1
- package/lib/point/shaders/fill/fill_frag.glsl +1 -1
- package/lib/point/shaders/fillImage/fillImage_frag.glsl +1 -2
- package/lib/point/shaders/text/text_frag.glsl +3 -2
- package/lib/point/shaders/text/text_vert.glsl +0 -2
- package/lib/polygon/models/extrude.js +29 -38
- package/lib/polygon/models/extrusion.js +1 -1
- package/lib/polygon/models/fill.js +3 -3
- package/lib/polygon/models/water.js +6 -4
- package/lib/polygon/shaders/extrude/polygon_extrude_frag.glsl +1 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_frag.glsl +1 -0
- package/lib/polygon/shaders/extrude/polygon_extrude_picklight_vert.glsl +2 -3
- package/lib/polygon/shaders/extrude/polygon_extrudetex_frag.glsl +7 -9
- package/lib/polygon/shaders/extrude/polygon_extrudetex_vert.glsl +1 -2
- package/lib/polygon/shaders/extrusion/polygon_extrusion_frag.glsl +1 -0
- package/lib/polygon/shaders/fill/fill_frag.glsl +1 -0
- package/lib/polygon/shaders/fill/fill_linear_frag.glsl +4 -3
- package/lib/polygon/shaders/fill/fill_linear_vert.glsl +5 -8
- package/lib/raster/models/raster.js +6 -5
- package/lib/raster/models/rasterRgb.js +3 -2
- package/lib/raster/models/rasterTerrainRgb.js +20 -14
- package/lib/raster/shaders/raster/raster_2d_frag.glsl +3 -3
- package/lib/raster/shaders/raster/raster_2d_vert.glsl +2 -2
- package/lib/raster/shaders/rgb/raster_rgb_frag.glsl +1 -0
- package/lib/raster/shaders/terrain/terrain_rgb_frag.glsl +19 -17
- package/lib/raster/shaders/terrain/terrain_rgb_vert.glsl +12 -5
- package/lib/tile/core/BaseLayer.js +7 -7
- package/lib/tile/service/TilePickService.js +36 -13
- package/lib/tile/tile/Tile.js +4 -3
- package/lib/utils/load-image.js +53 -0
- package/package.json +7 -7
|
@@ -2,24 +2,21 @@ layout(location = 0) in vec3 a_Position;
|
|
|
2
2
|
layout(location = 1) in vec4 a_Color;
|
|
3
3
|
layout(location = 15) in vec3 a_linear;
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
layout(std140) uniform commonUniforms {
|
|
7
6
|
float u_raisingHeight;
|
|
8
7
|
float u_opacitylinear;
|
|
9
8
|
float u_dir;
|
|
10
9
|
};
|
|
11
10
|
|
|
12
|
-
|
|
13
11
|
out vec4 v_color;
|
|
12
|
+
out vec3 v_linear;
|
|
13
|
+
out vec2 v_pos;
|
|
14
14
|
|
|
15
15
|
#pragma include "projection"
|
|
16
16
|
#pragma include "picking"
|
|
17
17
|
|
|
18
|
-
out vec3 v_linear;
|
|
19
|
-
out vec2 v_pos;
|
|
20
|
-
|
|
21
18
|
void main() {
|
|
22
|
-
if(u_opacitylinear > 0.0) {
|
|
19
|
+
if (u_opacitylinear > 0.0) {
|
|
23
20
|
v_linear = a_linear;
|
|
24
21
|
v_pos = a_Position.xy;
|
|
25
22
|
}
|
|
@@ -27,12 +24,12 @@ void main() {
|
|
|
27
24
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
28
25
|
project_pos.z += u_raisingHeight;
|
|
29
26
|
|
|
30
|
-
if(u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
27
|
+
if (u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT || u_CoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSET) {
|
|
31
28
|
float mapboxZoomScale = 4.0/pow(2.0, 21.0 - u_Zoom);
|
|
32
29
|
project_pos.z *= mapboxZoomScale;
|
|
33
30
|
project_pos.z += u_raisingHeight * mapboxZoomScale;
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
gl_Position = project_common_position_to_clipspace_v2(vec4(project_pos.xyz, 1.0));
|
|
37
34
|
setPickingColor(a_PickingColor);
|
|
38
35
|
}
|
|
@@ -14,9 +14,9 @@ import BaseModel from "../../core/BaseModel";
|
|
|
14
14
|
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
15
15
|
import { RasterImageTriangulation } from "../../core/triangulation";
|
|
16
16
|
/* babel-plugin-inline-import '../shaders/raster/raster_2d_frag.glsl' */
|
|
17
|
-
var rasterFrag = "layout(std140) uniform commonUniforms {\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n
|
|
17
|
+
var rasterFrag = "layout(std140) uniform commonUniforms {\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\n\nuniform sampler2D u_rasterTexture;\nuniform sampler2D u_colorTexture;\n\nin vec2 v_texCoord;\n\nbool isnan_emu(float x) { return (x > 0.0 || x < 0.0) ? x != x : x != 0.0; }\n\nout vec4 outputColor;\n\nvoid main() {\n // Can use any component here since u_rasterTexture is under luminance format.\n float value = texture(SAMPLER_2D(u_rasterTexture), vec2(v_texCoord.x, v_texCoord.y)).r;\n if (value == u_noDataValue || isnan_emu(value)) {\n discard;\n } else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {\n discard;\n } else {\n float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]);\n vec4 color = texture(SAMPLER_2D(u_colorTexture), vec2(normalisedValue, 0));\n \n outputColor = color;\n outputColor.a = outputColor.a * u_opacity ;\n if (outputColor.a < 0.01)\n discard;\n }\n}\n";
|
|
18
18
|
/* babel-plugin-inline-import '../shaders/raster/raster_2d_vert.glsl' */
|
|
19
|
-
var rasterVert = "\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 14) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n
|
|
19
|
+
var rasterVert = "\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 14) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\n\nout vec2 v_texCoord;\n\n#pragma include \"projection\"\n\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";
|
|
20
20
|
var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
21
21
|
_inherits(RasterModel, _BaseModel);
|
|
22
22
|
var _super = _createSuper(RasterModel);
|
|
@@ -52,8 +52,8 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
52
52
|
u_domain: newdomain,
|
|
53
53
|
u_opacity: opacity || 1,
|
|
54
54
|
u_noDataValue: noDataValue,
|
|
55
|
-
u_clampLow: clampLow,
|
|
56
|
-
u_clampHigh: typeof clampHigh !== 'undefined' ? clampHigh : clampLow,
|
|
55
|
+
u_clampLow: clampLow ? 1 : 0,
|
|
56
|
+
u_clampHigh: (typeof clampHigh !== 'undefined' ? clampHigh : clampLow) ? 1 : 0,
|
|
57
57
|
u_rasterTexture: this.texture,
|
|
58
58
|
u_colorTexture: this.colorTexture
|
|
59
59
|
};
|
|
@@ -161,7 +161,8 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
161
161
|
primitive: gl.TRIANGLES,
|
|
162
162
|
depth: {
|
|
163
163
|
enable: false
|
|
164
|
-
}
|
|
164
|
+
},
|
|
165
|
+
pickingEnabled: false
|
|
165
166
|
});
|
|
166
167
|
case 13:
|
|
167
168
|
model = _context3.sent;
|
|
@@ -18,7 +18,7 @@ import BaseModel from "../../core/BaseModel";
|
|
|
18
18
|
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
19
19
|
import { RasterImageTriangulation } from "../../core/triangulation";
|
|
20
20
|
/* babel-plugin-inline-import '../shaders/rgb/raster_rgb_frag.glsl' */
|
|
21
|
-
var rasterFrag = "uniform sampler2D u_texture;\nlayout(std140) uniform commonUniforms {\n vec2 u_rminmax;\n vec2 u_gminmax;\n vec2 u_bminmax;\n float u_opacity;\n float u_noDataValue;\n};\n\nin vec2 v_texCoord;\n\nout vec4 outputColor;\n\nvoid main() {\n\n vec3 rgb = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)).rgb;\n\n if(rgb == vec3(u_noDataValue)) {\n outputColor = vec4(0.0, 0, 0, 0.0);\n } else {\n outputColor = 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(outputColor.a < 0.01)\n discard;\n \n}";
|
|
21
|
+
var rasterFrag = "uniform sampler2D u_texture;\nlayout(std140) uniform commonUniforms {\n vec2 u_rminmax;\n vec2 u_gminmax;\n vec2 u_bminmax;\n float u_opacity;\n float u_noDataValue;\n};\n\nin vec2 v_texCoord;\n\nout vec4 outputColor;\n\nvoid main() {\n\n vec3 rgb = texture(SAMPLER_2D(u_texture),vec2(v_texCoord.x,v_texCoord.y)).rgb;\n\n if(rgb == vec3(u_noDataValue)) {\n outputColor = vec4(0.0, 0, 0, 0.0);\n } else {\n outputColor = 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\n if(outputColor.a < 0.01)\n discard;\n \n}";
|
|
22
22
|
/* babel-plugin-inline-import '../shaders/rgb/raster_rgb_vert.glsl' */
|
|
23
23
|
var rasterVert = "\nlayout(location = 0) in vec3 a_Position;\nlayout(location = 14) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec2 u_rminmax;\n vec2 u_gminmax;\n vec2 u_bminmax;\n float u_opacity;\n float u_noDataValue;\n};\n\nout vec2 v_texCoord;\n\n#pragma include \"projection\"\n\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";
|
|
24
24
|
var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
@@ -152,7 +152,8 @@ var RasterModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
152
152
|
primitive: gl.TRIANGLES,
|
|
153
153
|
depth: {
|
|
154
154
|
enable: false
|
|
155
|
-
}
|
|
155
|
+
},
|
|
156
|
+
pickingEnabled: false
|
|
156
157
|
});
|
|
157
158
|
case 13:
|
|
158
159
|
model = _context2.sent;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type { IModel,
|
|
1
|
+
import type { IModel, ITexture2D } from '@antv/l7-core';
|
|
2
2
|
import BaseModel from '../../core/BaseModel';
|
|
3
3
|
export default class RasterTerrainRGB extends BaseModel {
|
|
4
4
|
protected texture: ITexture2D;
|
|
5
|
-
|
|
5
|
+
protected getCommonUniformsInfo(): {
|
|
6
|
+
uniformsArray: number[];
|
|
7
|
+
uniformsLength: number;
|
|
8
|
+
uniformsOption: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
6
12
|
initModels(): Promise<IModel[]>;
|
|
7
13
|
clearModels(): void;
|
|
8
14
|
buildModels(): Promise<IModel[]>;
|
|
@@ -11,10 +11,11 @@ import { AttributeType, gl } from '@antv/l7-core';
|
|
|
11
11
|
import { getDefaultDomain } from '@antv/l7-utils';
|
|
12
12
|
import BaseModel from "../../core/BaseModel";
|
|
13
13
|
import { RasterImageTriangulation } from "../../core/triangulation";
|
|
14
|
+
import { ShaderLocation } from "../../core/CommonStyleAttribute";
|
|
14
15
|
/* babel-plugin-inline-import '../shaders/terrain/terrain_rgb_frag.glsl' */
|
|
15
|
-
var Raster_terrainFrag = "
|
|
16
|
+
var Raster_terrainFrag = "uniform sampler2D u_texture;\nuniform sampler2D u_colorTexture;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_unpack;\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\n\nin vec2 v_texCoord;\nout vec4 outputColor;\n\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture(SAMPLER_2D(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 texture(SAMPLER_2D(u_colorTexture), coord);\n}\n\nvoid main() {\n float value = getElevation(v_texCoord,0.0);\n if (value == u_noDataValue) {\n outputColor = vec4(0.0, 0, 0, 0.0);\n } else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {\n outputColor = vec4(0.0, 0, 0, 0.0);\n } else {\n \n outputColor = getColor(value);\n outputColor.a = outputColor.a * u_opacity ;\n if(outputColor.a < 0.01)\n discard;\n }\n}\n";
|
|
16
17
|
/* babel-plugin-inline-import '../shaders/terrain/terrain_rgb_vert.glsl' */
|
|
17
|
-
var Raster_terrainVert = "
|
|
18
|
+
var Raster_terrainVert = "layout(location = 0) in vec3 a_Position;\nlayout(location = 14) in vec2 a_Uv;\n\nlayout(std140) uniform commonUniforms {\n vec4 u_unpack;\n vec2 u_domain;\n float u_opacity;\n float u_noDataValue;\n float u_clampLow;\n float u_clampHigh;\n};\nout vec2 v_texCoord;\n#pragma include \"projection\"\n\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
19
|
var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
19
20
|
_inherits(RasterTerrainRGB, _BaseModel);
|
|
20
21
|
var _super = _createSuper(RasterTerrainRGB);
|
|
@@ -23,8 +24,8 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
|
23
24
|
return _super.apply(this, arguments);
|
|
24
25
|
}
|
|
25
26
|
_createClass(RasterTerrainRGB, [{
|
|
26
|
-
key: "
|
|
27
|
-
value: function
|
|
27
|
+
key: "getCommonUniformsInfo",
|
|
28
|
+
value: function getCommonUniformsInfo() {
|
|
28
29
|
var _ref = this.layer.getLayerConfig(),
|
|
29
30
|
opacity = _ref.opacity,
|
|
30
31
|
_ref$clampLow = _ref.clampLow,
|
|
@@ -51,16 +52,19 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
|
51
52
|
} else {
|
|
52
53
|
this.layer.textureService.setColorTexture(colorTexture, rampColors, newdomain);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
u_texture: this.texture,
|
|
55
|
+
var commonOptions = {
|
|
56
|
+
u_unpack: [rScaler, gScaler, bScaler, offset],
|
|
57
57
|
u_domain: newdomain,
|
|
58
|
+
u_opacity: opacity || 1,
|
|
59
|
+
u_noDataValue: noDataValue,
|
|
58
60
|
u_clampLow: clampLow,
|
|
59
61
|
u_clampHigh: typeof clampHigh !== 'undefined' ? clampHigh : clampLow,
|
|
60
|
-
|
|
61
|
-
u_unpack: [rScaler, gScaler, bScaler, offset],
|
|
62
|
+
u_texture: this.texture,
|
|
62
63
|
u_colorTexture: texture
|
|
63
64
|
};
|
|
65
|
+
this.textures = [this.texture, texture];
|
|
66
|
+
var commonBufferInfo = this.getUniformsBufferInfo(commonOptions);
|
|
67
|
+
return commonBufferInfo;
|
|
64
68
|
}
|
|
65
69
|
}, {
|
|
66
70
|
key: "initModels",
|
|
@@ -70,11 +74,12 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
|
70
74
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
71
75
|
while (1) switch (_context.prev = _context.next) {
|
|
72
76
|
case 0:
|
|
77
|
+
this.initUniformsBuffer();
|
|
73
78
|
source = this.layer.getSource();
|
|
74
79
|
createTexture2D = this.rendererService.createTexture2D;
|
|
75
|
-
_context.next =
|
|
80
|
+
_context.next = 5;
|
|
76
81
|
return source.data.images;
|
|
77
|
-
case
|
|
82
|
+
case 5:
|
|
78
83
|
imageData = _context.sent;
|
|
79
84
|
this.texture = createTexture2D({
|
|
80
85
|
data: imageData[0],
|
|
@@ -83,7 +88,7 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
|
83
88
|
min: gl.LINEAR,
|
|
84
89
|
mag: gl.LINEAR
|
|
85
90
|
});
|
|
86
|
-
_context.next =
|
|
91
|
+
_context.next = 9;
|
|
87
92
|
return this.layer.buildLayerModel({
|
|
88
93
|
moduleName: 'RasterTileDataImage',
|
|
89
94
|
vertexShader: Raster_terrainVert,
|
|
@@ -94,10 +99,10 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
|
94
99
|
enable: false
|
|
95
100
|
}
|
|
96
101
|
});
|
|
97
|
-
case
|
|
102
|
+
case 9:
|
|
98
103
|
model = _context.sent;
|
|
99
104
|
return _context.abrupt("return", [model]);
|
|
100
|
-
case
|
|
105
|
+
case 11:
|
|
101
106
|
case "end":
|
|
102
107
|
return _context.stop();
|
|
103
108
|
}
|
|
@@ -141,6 +146,7 @@ var RasterTerrainRGB = /*#__PURE__*/function (_BaseModel) {
|
|
|
141
146
|
type: AttributeType.Attribute,
|
|
142
147
|
descriptor: {
|
|
143
148
|
name: 'a_Uv',
|
|
149
|
+
shaderLocation: ShaderLocation.UV,
|
|
144
150
|
buffer: {
|
|
145
151
|
usage: gl.DYNAMIC_DRAW,
|
|
146
152
|
data: [],
|
|
@@ -2,8 +2,8 @@ layout(std140) uniform commonUniforms {
|
|
|
2
2
|
vec2 u_domain;
|
|
3
3
|
float u_opacity;
|
|
4
4
|
float u_noDataValue;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
float u_clampLow;
|
|
6
|
+
float u_clampHigh;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
uniform sampler2D u_rasterTexture;
|
|
@@ -20,7 +20,7 @@ void main() {
|
|
|
20
20
|
float value = texture(SAMPLER_2D(u_rasterTexture), vec2(v_texCoord.x, v_texCoord.y)).r;
|
|
21
21
|
if (value == u_noDataValue || isnan_emu(value)) {
|
|
22
22
|
discard;
|
|
23
|
-
} else if ((
|
|
23
|
+
} else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {
|
|
24
24
|
discard;
|
|
25
25
|
} else {
|
|
26
26
|
float normalisedValue =(value - u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
precision mediump float;
|
|
2
|
-
uniform float u_opacity: 1.0;
|
|
3
|
-
|
|
4
1
|
uniform sampler2D u_texture;
|
|
5
2
|
uniform sampler2D u_colorTexture;
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
layout(std140) uniform commonUniforms {
|
|
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
|
+
};
|
|
12
|
+
|
|
13
|
+
in vec2 v_texCoord;
|
|
14
|
+
out vec4 outputColor;
|
|
8
15
|
|
|
9
|
-
uniform vec2 u_domain;
|
|
10
|
-
uniform float u_noDataValue;
|
|
11
|
-
uniform bool u_clampLow: true;
|
|
12
|
-
uniform bool u_clampHigh: true;
|
|
13
|
-
uniform vec4 u_unpack;
|
|
14
16
|
|
|
15
17
|
float getElevation(vec2 coord, float bias) {
|
|
16
18
|
// Convert encoded elevation value to meters
|
|
17
|
-
vec4 data =
|
|
19
|
+
vec4 data = texture(SAMPLER_2D(u_texture), coord,bias) * 255.0;
|
|
18
20
|
data.a = -1.0;
|
|
19
21
|
return dot(data, u_unpack);
|
|
20
22
|
}
|
|
@@ -22,20 +24,20 @@ float getElevation(vec2 coord, float bias) {
|
|
|
22
24
|
vec4 getColor(float value) {
|
|
23
25
|
float normalisedValue =(value- u_domain[0]) / (u_domain[1] - u_domain[0]);
|
|
24
26
|
vec2 coord = vec2(normalisedValue, 0);
|
|
25
|
-
return
|
|
27
|
+
return texture(SAMPLER_2D(u_colorTexture), coord);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
void main() {
|
|
29
31
|
float value = getElevation(v_texCoord,0.0);
|
|
30
32
|
if (value == u_noDataValue) {
|
|
31
|
-
|
|
32
|
-
} else if ((
|
|
33
|
-
|
|
33
|
+
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
34
|
+
} else if ((u_clampLow < 0.5 && value < u_domain[0]) || (u_clampHigh < 0.5 && value > u_domain[1])) {
|
|
35
|
+
outputColor = vec4(0.0, 0, 0, 0.0);
|
|
34
36
|
} else {
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if(
|
|
38
|
+
outputColor = getColor(value);
|
|
39
|
+
outputColor.a = outputColor.a * u_opacity ;
|
|
40
|
+
if(outputColor.a < 0.01)
|
|
39
41
|
discard;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
layout(location = 0) in vec3 a_Position;
|
|
2
|
+
layout(location = 14) in vec2 a_Uv;
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
layout(std140) uniform commonUniforms {
|
|
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
|
+
};
|
|
12
|
+
out vec2 v_texCoord;
|
|
7
13
|
#pragma include "projection"
|
|
14
|
+
|
|
8
15
|
void main() {
|
|
9
16
|
v_texCoord = a_Uv;
|
|
10
17
|
vec4 project_pos = project_position(vec4(a_Position, 1.0));
|
|
@@ -204,7 +204,7 @@ var BaseTileLayer = /*#__PURE__*/function () {
|
|
|
204
204
|
value: function () {
|
|
205
205
|
var _tileUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
206
206
|
var _this3 = this;
|
|
207
|
-
var minZoom, maxZoom;
|
|
207
|
+
var minZoom, maxZoom, tiles;
|
|
208
208
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
209
209
|
while (1) switch (_context2.prev = _context2.next) {
|
|
210
210
|
case 0:
|
|
@@ -216,8 +216,7 @@ var BaseTileLayer = /*#__PURE__*/function () {
|
|
|
216
216
|
case 2:
|
|
217
217
|
minZoom = this.parent.getMinZoom();
|
|
218
218
|
maxZoom = this.parent.getMaxZoom();
|
|
219
|
-
|
|
220
|
-
return Promise.all(this.tilesetManager.tiles.filter(function (tile) {
|
|
219
|
+
tiles = this.tilesetManager.tiles.filter(function (tile) {
|
|
221
220
|
return tile.isLoaded;
|
|
222
221
|
}) // 过滤未加载完成的
|
|
223
222
|
.filter(function (tile) {
|
|
@@ -228,8 +227,9 @@ var BaseTileLayer = /*#__PURE__*/function () {
|
|
|
228
227
|
}) //
|
|
229
228
|
.filter(function (tile) {
|
|
230
229
|
return tile.z >= minZoom && tile.z < maxZoom;
|
|
231
|
-
}) // 过滤不可见见
|
|
232
|
-
.
|
|
230
|
+
}); // 过滤不可见见
|
|
231
|
+
_context2.next = 7;
|
|
232
|
+
return Promise.all(tiles.map( /*#__PURE__*/function () {
|
|
233
233
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(tile) {
|
|
234
234
|
var tileInstance, tileLayer;
|
|
235
235
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -267,12 +267,12 @@ var BaseTileLayer = /*#__PURE__*/function () {
|
|
|
267
267
|
return _ref.apply(this, arguments);
|
|
268
268
|
};
|
|
269
269
|
}()));
|
|
270
|
-
case
|
|
270
|
+
case 7:
|
|
271
271
|
if (this.tilesetManager.isLoaded) {
|
|
272
272
|
// 将事件抛出,图层上可以使用瓦片
|
|
273
273
|
this.parent.emit('tiles-loaded', this.tilesetManager.currentTiles);
|
|
274
274
|
}
|
|
275
|
-
case
|
|
275
|
+
case 8:
|
|
276
276
|
case "end":
|
|
277
277
|
return _context2.stop();
|
|
278
278
|
}
|
|
@@ -13,7 +13,7 @@ export declare class TilePickService implements ITilePickService {
|
|
|
13
13
|
private tilePickID;
|
|
14
14
|
constructor({ layerService, tileLayerService, parent, }: ITilePickServiceOptions);
|
|
15
15
|
pickRender(target: IInteractionTarget): void;
|
|
16
|
-
pick(layer: ILayer, target: IInteractionTarget): boolean
|
|
16
|
+
pick(layer: ILayer, target: IInteractionTarget): Promise<boolean>;
|
|
17
17
|
selectFeature(pickedColors: Uint8Array | undefined): void;
|
|
18
18
|
highlightPickedFeature(pickedColors: Uint8Array | undefined): void;
|
|
19
19
|
updateHighLight(r: number, g: number, b: number, type: string): void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
5
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
8
|
import { TYPES } from '@antv/l7-core';
|
|
7
9
|
import { decodePickingColor, encodePickingColor } from '@antv/l7-utils';
|
|
8
10
|
import { TileSourceService } from "./TileSourceService";
|
|
@@ -33,20 +35,41 @@ export var TilePickService = /*#__PURE__*/function () {
|
|
|
33
35
|
}
|
|
34
36
|
}, {
|
|
35
37
|
key: "pick",
|
|
36
|
-
value: function
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
value: function () {
|
|
39
|
+
var _pick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(layer, target) {
|
|
40
|
+
var container, pickingService, tile, pickLayer;
|
|
41
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
42
|
+
while (1) switch (_context.prev = _context.next) {
|
|
43
|
+
case 0:
|
|
44
|
+
container = this.parent.getContainer();
|
|
45
|
+
pickingService = container.get(TYPES.IPickingService);
|
|
46
|
+
if (!(layer.type === 'RasterLayer')) {
|
|
47
|
+
_context.next = 8;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
tile = this.tileLayerService.getVisibleTileBylngLat(target.lngLat);
|
|
51
|
+
if (!(tile && tile.getMainLayer() !== undefined)) {
|
|
52
|
+
_context.next = 7;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
pickLayer = tile.getMainLayer();
|
|
56
|
+
return _context.abrupt("return", pickLayer.layerPickService.pickRasterLayer(pickLayer, target, this.parent));
|
|
57
|
+
case 7:
|
|
58
|
+
return _context.abrupt("return", false);
|
|
59
|
+
case 8:
|
|
60
|
+
this.pickRender(target);
|
|
61
|
+
return _context.abrupt("return", pickingService.pickFromPickingFBO(layer, target));
|
|
62
|
+
case 10:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
65
|
+
}
|
|
66
|
+
}, _callee, this);
|
|
67
|
+
}));
|
|
68
|
+
function pick(_x, _x2) {
|
|
69
|
+
return _pick.apply(this, arguments);
|
|
46
70
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
71
|
+
return pick;
|
|
72
|
+
}()
|
|
50
73
|
}, {
|
|
51
74
|
key: "selectFeature",
|
|
52
75
|
value: function selectFeature(pickedColors) {
|
package/es/tile/tile/Tile.js
CHANGED
|
@@ -104,7 +104,8 @@ var Tile = /*#__PURE__*/function (_EventEmitter) {
|
|
|
104
104
|
while (1) switch (_context.prev = _context.next) {
|
|
105
105
|
case 0:
|
|
106
106
|
mask = new PolygonLayer({
|
|
107
|
-
|
|
107
|
+
name: 'mask',
|
|
108
|
+
visible: true,
|
|
108
109
|
enablePicking: false
|
|
109
110
|
}).source({
|
|
110
111
|
type: 'FeatureCollection',
|
|
@@ -114,7 +115,7 @@ var Tile = /*#__PURE__*/function (_EventEmitter) {
|
|
|
114
115
|
type: 'geojson',
|
|
115
116
|
featureId: 'id'
|
|
116
117
|
}
|
|
117
|
-
}).shape('fill').style({
|
|
118
|
+
}).shape('fill').color('#0f0').style({
|
|
118
119
|
opacity: 0.5
|
|
119
120
|
});
|
|
120
121
|
container = createLayerContainer(this.parent.sceneContainer);
|
|
@@ -138,7 +139,7 @@ var Tile = /*#__PURE__*/function (_EventEmitter) {
|
|
|
138
139
|
return _addTileMask.apply(this, arguments);
|
|
139
140
|
}
|
|
140
141
|
return addTileMask;
|
|
141
|
-
}()
|
|
142
|
+
}() // 全局 Mask
|
|
142
143
|
}, {
|
|
143
144
|
key: "addMask",
|
|
144
145
|
value: function () {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadImage(url: string): Promise<HTMLImageElement | ImageBitmap>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
export function loadImage(_x) {
|
|
4
|
+
return _loadImage.apply(this, arguments);
|
|
5
|
+
}
|
|
6
|
+
function _loadImage() {
|
|
7
|
+
_loadImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url) {
|
|
8
|
+
var response, imageBitmap, image;
|
|
9
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
10
|
+
while (1) switch (_context.prev = _context.next) {
|
|
11
|
+
case 0:
|
|
12
|
+
if (!window.createImageBitmap) {
|
|
13
|
+
_context.next = 14;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
_context.next = 3;
|
|
17
|
+
return fetch(url);
|
|
18
|
+
case 3:
|
|
19
|
+
response = _context.sent;
|
|
20
|
+
_context.t0 = createImageBitmap;
|
|
21
|
+
_context.next = 7;
|
|
22
|
+
return response.blob();
|
|
23
|
+
case 7:
|
|
24
|
+
_context.t1 = _context.sent;
|
|
25
|
+
_context.next = 10;
|
|
26
|
+
return (0, _context.t0)(_context.t1);
|
|
27
|
+
case 10:
|
|
28
|
+
imageBitmap = _context.sent;
|
|
29
|
+
return _context.abrupt("return", imageBitmap);
|
|
30
|
+
case 14:
|
|
31
|
+
image = new window.Image();
|
|
32
|
+
return _context.abrupt("return", new Promise(function (res) {
|
|
33
|
+
image.onload = function () {
|
|
34
|
+
return res(image);
|
|
35
|
+
};
|
|
36
|
+
image.src = url;
|
|
37
|
+
image.crossOrigin = 'Anonymous';
|
|
38
|
+
}));
|
|
39
|
+
case 16:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}, _callee);
|
|
44
|
+
}));
|
|
45
|
+
return _loadImage.apply(this, arguments);
|
|
46
|
+
}
|
package/lib/core/BaseLayer.js
CHANGED
|
@@ -30,7 +30,7 @@ var _multiPassRender = require("../utils/multiPassRender");
|
|
|
30
30
|
var _LayerPickService = _interopRequireDefault(require("./LayerPickService"));
|
|
31
31
|
var _TextureService = _interopRequireDefault(require("./TextureService"));
|
|
32
32
|
var _excluded = ["passes"],
|
|
33
|
-
_excluded2 = ["moduleName", "vertexShader", "fragmentShader", "inject", "triangulation", "styleOption"];
|
|
33
|
+
_excluded2 = ["moduleName", "vertexShader", "fragmentShader", "inject", "triangulation", "styleOption", "pickingEnabled"];
|
|
34
34
|
var _dec, _class, _descriptor; // @ts-ignore
|
|
35
35
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
36
36
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -113,7 +113,6 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
|
|
|
113
113
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "enableShaderEncodeStyles", []);
|
|
114
114
|
// 数据层数据映射
|
|
115
115
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "enableDataEncodeStyles", []);
|
|
116
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "enablg", []);
|
|
117
116
|
/**
|
|
118
117
|
* 待更新样式属性,在初始化阶段完成注册
|
|
119
118
|
*/
|
|
@@ -1188,11 +1187,11 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
|
|
|
1188
1187
|
value: function () {
|
|
1189
1188
|
var _buildLayerModel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(options) {
|
|
1190
1189
|
var _this10 = this;
|
|
1191
|
-
var moduleName, vertexShader, fragmentShader, inject, triangulation, styleOption, rest, _this$shaderModuleSer, vs, fs, uniforms, createModel;
|
|
1190
|
+
var moduleName, vertexShader, fragmentShader, inject, triangulation, styleOption, _options$pickingEnabl, pickingEnabled, rest, _this$shaderModuleSer, vs, fs, uniforms, createModel;
|
|
1192
1191
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
1193
1192
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1194
1193
|
case 0:
|
|
1195
|
-
moduleName = options.moduleName, vertexShader = options.vertexShader, fragmentShader = options.fragmentShader, inject = options.inject, triangulation = options.triangulation, styleOption = options.styleOption, rest = (0, _objectWithoutProperties2.default)(options, _excluded2);
|
|
1194
|
+
moduleName = options.moduleName, vertexShader = options.vertexShader, fragmentShader = options.fragmentShader, inject = options.inject, triangulation = options.triangulation, styleOption = options.styleOption, _options$pickingEnabl = options.pickingEnabled, pickingEnabled = _options$pickingEnabl === void 0 ? true : _options$pickingEnabl, rest = (0, _objectWithoutProperties2.default)(options, _excluded2);
|
|
1196
1195
|
this.shaderModuleService.registerModule(moduleName, {
|
|
1197
1196
|
vs: vertexShader,
|
|
1198
1197
|
fs: fragmentShader,
|
|
@@ -1205,6 +1204,10 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
|
|
|
1205
1204
|
attributes = _this10$styleAttribut.attributes,
|
|
1206
1205
|
elements = _this10$styleAttribut.elements,
|
|
1207
1206
|
count = _this10$styleAttribut.count;
|
|
1207
|
+
var uniformBuffers = [].concat((0, _toConsumableArray2.default)(_this10.layerModel.uniformBuffers), (0, _toConsumableArray2.default)(_this10.rendererService.uniformBuffers), [_this10.getLayerUniformBuffer()]);
|
|
1208
|
+
if (pickingEnabled) {
|
|
1209
|
+
uniformBuffers.push(_this10.getPickingUniformBuffer());
|
|
1210
|
+
}
|
|
1208
1211
|
var modelOptions = (0, _objectSpread2.default)({
|
|
1209
1212
|
attributes: attributes,
|
|
1210
1213
|
uniforms: uniforms,
|
|
@@ -1212,7 +1215,7 @@ var BaseLayer = exports.default = (_dec = (0, _l7Core.lazyInject)(_l7Core.TYPES.
|
|
|
1212
1215
|
vs: vs,
|
|
1213
1216
|
elements: elements,
|
|
1214
1217
|
blend: _blend.BlendTypes[_l7Core.BlendType.normal],
|
|
1215
|
-
uniformBuffers:
|
|
1218
|
+
uniformBuffers: uniformBuffers,
|
|
1216
1219
|
textures: _this10.layerModel.textures
|
|
1217
1220
|
}, rest);
|
|
1218
1221
|
if (count) {
|