@deck.gl/extensions 9.0.0-beta.1 → 9.0.0-beta.3
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/dist/brushing/brushing-extension.js +80 -0
- package/dist/{esm/brushing → brushing}/shader-module.js +24 -30
- package/dist/clip/clip-extension.js +117 -0
- package/{typed → dist}/collision-filter/collision-filter-effect.d.ts.map +1 -1
- package/dist/collision-filter/collision-filter-effect.js +193 -0
- package/dist/collision-filter/collision-filter-extension.js +49 -0
- package/{typed → dist}/collision-filter/collision-filter-pass.d.ts.map +1 -1
- package/dist/collision-filter/collision-filter-pass.js +25 -0
- package/dist/{esm/collision-filter → collision-filter}/shader-module.js +17 -24
- package/dist/data-filter/aggregator.js +104 -0
- package/{typed → dist}/data-filter/data-filter-extension.d.ts.map +1 -1
- package/dist/data-filter/data-filter-extension.js +162 -0
- package/dist/data-filter/shader-module.js +159 -0
- package/dist/dist.dev.js +1519 -9832
- package/dist/fill-style/fill-style-extension.js +118 -0
- package/dist/{esm/fill-style → fill-style}/shaders.glsl.js +37 -43
- package/dist/fp64/fp64-extension.js +35 -0
- package/dist/{esm/fp64 → fp64}/project64.glsl.js +19 -1
- package/dist/fp64/project64.js +50 -0
- package/dist/index.cjs +2724 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +11 -0
- package/{typed → dist}/mask/mask-effect.d.ts.map +1 -1
- package/dist/mask/mask-effect.js +194 -0
- package/dist/mask/mask-extension.js +57 -0
- package/{typed → dist}/mask/mask-pass.d.ts.map +1 -1
- package/dist/mask/mask-pass.js +44 -0
- package/dist/{esm/mask → mask}/shader-module.js +18 -21
- package/dist/path-style/path-style-extension.js +111 -0
- package/dist/{esm/path-style → path-style}/shaders.glsl.js +20 -13
- package/dist/terrain/height-map-builder.js +104 -0
- package/dist/terrain/shader-module.js +139 -0
- package/dist/terrain/terrain-cover.js +187 -0
- package/{typed → dist}/terrain/terrain-effect.d.ts.map +1 -1
- package/dist/terrain/terrain-effect.js +184 -0
- package/dist/terrain/terrain-extension.js +44 -0
- package/{typed → dist}/terrain/terrain-pass.d.ts.map +1 -1
- package/dist/terrain/terrain-pass.js +61 -0
- package/{typed → dist}/terrain/terrain-picking-pass.d.ts.map +1 -1
- package/dist/terrain/terrain-picking-pass.js +66 -0
- package/dist/terrain/utils.js +21 -0
- package/{typed → dist}/utils/debug.d.ts.map +1 -1
- package/dist/utils/debug.js +50 -0
- package/dist/utils/projection-utils.js +153 -0
- package/dist.min.js +72 -201
- package/package.json +19 -12
- package/src/collision-filter/collision-filter-effect.ts +12 -8
- package/src/collision-filter/collision-filter-pass.ts +1 -3
- package/src/data-filter/data-filter-extension.ts +3 -5
- package/src/mask/mask-effect.ts +0 -1
- package/src/mask/mask-pass.ts +1 -3
- package/src/terrain/terrain-effect.ts +8 -2
- package/src/terrain/terrain-pass.ts +2 -5
- package/src/terrain/terrain-picking-pass.ts +1 -3
- package/src/utils/debug.ts +1 -2
- package/dist/es5/brushing/brushing-extension.js +0 -108
- package/dist/es5/brushing/brushing-extension.js.map +0 -1
- package/dist/es5/brushing/shader-module.js +0 -50
- package/dist/es5/brushing/shader-module.js.map +0 -1
- package/dist/es5/clip/clip-extension.js +0 -98
- package/dist/es5/clip/clip-extension.js.map +0 -1
- package/dist/es5/collision-filter/collision-filter-effect.js +0 -294
- package/dist/es5/collision-filter/collision-filter-effect.js.map +0 -1
- package/dist/es5/collision-filter/collision-filter-extension.js +0 -109
- package/dist/es5/collision-filter/collision-filter-extension.js.map +0 -1
- package/dist/es5/collision-filter/collision-filter-pass.js +0 -79
- package/dist/es5/collision-filter/collision-filter-pass.js.map +0 -1
- package/dist/es5/collision-filter/shader-module.js +0 -39
- package/dist/es5/collision-filter/shader-module.js.map +0 -1
- package/dist/es5/data-filter/aggregator.js +0 -79
- package/dist/es5/data-filter/aggregator.js.map +0 -1
- package/dist/es5/data-filter/data-filter-extension.js +0 -236
- package/dist/es5/data-filter/data-filter-extension.js.map +0 -1
- package/dist/es5/data-filter/shader-module.js +0 -122
- package/dist/es5/data-filter/shader-module.js.map +0 -1
- package/dist/es5/fill-style/fill-style-extension.js +0 -190
- package/dist/es5/fill-style/fill-style-extension.js.map +0 -1
- package/dist/es5/fill-style/shaders.glsl.js +0 -59
- package/dist/es5/fill-style/shaders.glsl.js.map +0 -1
- package/dist/es5/fp64/fp64-extension.js +0 -55
- package/dist/es5/fp64/fp64-extension.js.map +0 -1
- package/dist/es5/fp64/project64.glsl.js +0 -9
- package/dist/es5/fp64/project64.glsl.js.map +0 -1
- package/dist/es5/fp64/project64.js +0 -52
- package/dist/es5/fp64/project64.js.map +0 -1
- package/dist/es5/index.js +0 -88
- package/dist/es5/index.js.map +0 -1
- package/dist/es5/mask/mask-effect.js +0 -279
- package/dist/es5/mask/mask-effect.js.map +0 -1
- package/dist/es5/mask/mask-extension.js +0 -113
- package/dist/es5/mask/mask-extension.js.map +0 -1
- package/dist/es5/mask/mask-pass.js +0 -106
- package/dist/es5/mask/mask-pass.js.map +0 -1
- package/dist/es5/mask/shader-module.js +0 -38
- package/dist/es5/mask/shader-module.js.map +0 -1
- package/dist/es5/path-style/path-style-extension.js +0 -169
- package/dist/es5/path-style/path-style-extension.js.map +0 -1
- package/dist/es5/path-style/shaders.glsl.js +0 -25
- package/dist/es5/path-style/shaders.glsl.js.map +0 -1
- package/dist/es5/terrain/height-map-builder.js +0 -111
- package/dist/es5/terrain/height-map-builder.js.map +0 -1
- package/dist/es5/terrain/shader-module.js +0 -86
- package/dist/es5/terrain/shader-module.js.map +0 -1
- package/dist/es5/terrain/terrain-cover.js +0 -256
- package/dist/es5/terrain/terrain-cover.js.map +0 -1
- package/dist/es5/terrain/terrain-effect.js +0 -326
- package/dist/es5/terrain/terrain-effect.js.map +0 -1
- package/dist/es5/terrain/terrain-extension.js +0 -94
- package/dist/es5/terrain/terrain-extension.js.map +0 -1
- package/dist/es5/terrain/terrain-pass.js +0 -121
- package/dist/es5/terrain/terrain-pass.js.map +0 -1
- package/dist/es5/terrain/terrain-picking-pass.js +0 -124
- package/dist/es5/terrain/terrain-picking-pass.js.map +0 -1
- package/dist/es5/terrain/utils.js +0 -35
- package/dist/es5/terrain/utils.js.map +0 -1
- package/dist/es5/utils/debug.js +0 -71
- package/dist/es5/utils/debug.js.map +0 -1
- package/dist/es5/utils/projection-utils.js +0 -168
- package/dist/es5/utils/projection-utils.js.map +0 -1
- package/dist/esm/brushing/brushing-extension.js +0 -68
- package/dist/esm/brushing/brushing-extension.js.map +0 -1
- package/dist/esm/brushing/shader-module.js.map +0 -1
- package/dist/esm/clip/clip-extension.js +0 -86
- package/dist/esm/clip/clip-extension.js.map +0 -1
- package/dist/esm/collision-filter/collision-filter-effect.js +0 -246
- package/dist/esm/collision-filter/collision-filter-effect.js.map +0 -1
- package/dist/esm/collision-filter/collision-filter-extension.js +0 -75
- package/dist/esm/collision-filter/collision-filter-extension.js.map +0 -1
- package/dist/esm/collision-filter/collision-filter-pass.js +0 -32
- package/dist/esm/collision-filter/collision-filter-pass.js.map +0 -1
- package/dist/esm/collision-filter/shader-module.js.map +0 -1
- package/dist/esm/data-filter/aggregator.js +0 -102
- package/dist/esm/data-filter/aggregator.js.map +0 -1
- package/dist/esm/data-filter/data-filter-extension.js +0 -189
- package/dist/esm/data-filter/data-filter-extension.js.map +0 -1
- package/dist/esm/data-filter/shader-module.js +0 -164
- package/dist/esm/data-filter/shader-module.js.map +0 -1
- package/dist/esm/fill-style/fill-style-extension.js +0 -156
- package/dist/esm/fill-style/fill-style-extension.js.map +0 -1
- package/dist/esm/fill-style/shaders.glsl.js.map +0 -1
- package/dist/esm/fp64/fp64-extension.js +0 -20
- package/dist/esm/fp64/fp64-extension.js.map +0 -1
- package/dist/esm/fp64/project64.glsl.js.map +0 -1
- package/dist/esm/fp64/project64.js +0 -43
- package/dist/esm/fp64/project64.js.map +0 -1
- package/dist/esm/index.js +0 -11
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/mask/mask-effect.js +0 -228
- package/dist/esm/mask/mask-effect.js.map +0 -1
- package/dist/esm/mask/mask-extension.js +0 -83
- package/dist/esm/mask/mask-extension.js.map +0 -1
- package/dist/esm/mask/mask-pass.js +0 -58
- package/dist/esm/mask/mask-pass.js.map +0 -1
- package/dist/esm/mask/shader-module.js.map +0 -1
- package/dist/esm/path-style/path-style-extension.js +0 -130
- package/dist/esm/path-style/path-style-extension.js.map +0 -1
- package/dist/esm/path-style/shaders.glsl.js.map +0 -1
- package/dist/esm/terrain/height-map-builder.js +0 -86
- package/dist/esm/terrain/height-map-builder.js.map +0 -1
- package/dist/esm/terrain/shader-module.js +0 -127
- package/dist/esm/terrain/shader-module.js.map +0 -1
- package/dist/esm/terrain/terrain-cover.js +0 -212
- package/dist/esm/terrain/terrain-cover.js.map +0 -1
- package/dist/esm/terrain/terrain-effect.js +0 -219
- package/dist/esm/terrain/terrain-effect.js.map +0 -1
- package/dist/esm/terrain/terrain-extension.js +0 -59
- package/dist/esm/terrain/terrain-extension.js.map +0 -1
- package/dist/esm/terrain/terrain-pass.js +0 -71
- package/dist/esm/terrain/terrain-pass.js.map +0 -1
- package/dist/esm/terrain/terrain-picking-pass.js +0 -73
- package/dist/esm/terrain/terrain-picking-pass.js.map +0 -1
- package/dist/esm/terrain/utils.js +0 -19
- package/dist/esm/terrain/utils.js.map +0 -1
- package/dist/esm/utils/debug.js +0 -61
- package/dist/esm/utils/debug.js.map +0 -1
- package/dist/esm/utils/projection-utils.js +0 -134
- package/dist/esm/utils/projection-utils.js.map +0 -1
- /package/{typed → dist}/brushing/brushing-extension.d.ts +0 -0
- /package/{typed → dist}/brushing/brushing-extension.d.ts.map +0 -0
- /package/{typed → dist}/brushing/shader-module.d.ts +0 -0
- /package/{typed → dist}/brushing/shader-module.d.ts.map +0 -0
- /package/{typed → dist}/clip/clip-extension.d.ts +0 -0
- /package/{typed → dist}/clip/clip-extension.d.ts.map +0 -0
- /package/{typed → dist}/collision-filter/collision-filter-effect.d.ts +0 -0
- /package/{typed → dist}/collision-filter/collision-filter-extension.d.ts +0 -0
- /package/{typed → dist}/collision-filter/collision-filter-extension.d.ts.map +0 -0
- /package/{typed → dist}/collision-filter/collision-filter-pass.d.ts +0 -0
- /package/{typed → dist}/collision-filter/shader-module.d.ts +0 -0
- /package/{typed → dist}/collision-filter/shader-module.d.ts.map +0 -0
- /package/{typed → dist}/data-filter/aggregator.d.ts +0 -0
- /package/{typed → dist}/data-filter/aggregator.d.ts.map +0 -0
- /package/{typed → dist}/data-filter/data-filter-extension.d.ts +0 -0
- /package/{typed → dist}/data-filter/shader-module.d.ts +0 -0
- /package/{typed → dist}/data-filter/shader-module.d.ts.map +0 -0
- /package/{typed → dist}/fill-style/fill-style-extension.d.ts +0 -0
- /package/{typed → dist}/fill-style/fill-style-extension.d.ts.map +0 -0
- /package/{typed → dist}/fill-style/shaders.glsl.d.ts +0 -0
- /package/{typed → dist}/fill-style/shaders.glsl.d.ts.map +0 -0
- /package/{typed → dist}/fp64/fp64-extension.d.ts +0 -0
- /package/{typed → dist}/fp64/fp64-extension.d.ts.map +0 -0
- /package/{typed → dist}/fp64/project64.d.ts +0 -0
- /package/{typed → dist}/fp64/project64.d.ts.map +0 -0
- /package/{typed → dist}/fp64/project64.glsl.d.ts +0 -0
- /package/{typed → dist}/fp64/project64.glsl.d.ts.map +0 -0
- /package/{typed → dist}/index.d.ts +0 -0
- /package/{typed → dist}/index.d.ts.map +0 -0
- /package/{typed → dist}/mask/mask-effect.d.ts +0 -0
- /package/{typed → dist}/mask/mask-extension.d.ts +0 -0
- /package/{typed → dist}/mask/mask-extension.d.ts.map +0 -0
- /package/{typed → dist}/mask/mask-pass.d.ts +0 -0
- /package/{typed → dist}/mask/shader-module.d.ts +0 -0
- /package/{typed → dist}/mask/shader-module.d.ts.map +0 -0
- /package/{typed → dist}/path-style/path-style-extension.d.ts +0 -0
- /package/{typed → dist}/path-style/path-style-extension.d.ts.map +0 -0
- /package/{typed → dist}/path-style/shaders.glsl.d.ts +0 -0
- /package/{typed → dist}/path-style/shaders.glsl.d.ts.map +0 -0
- /package/{typed → dist}/terrain/height-map-builder.d.ts +0 -0
- /package/{typed → dist}/terrain/height-map-builder.d.ts.map +0 -0
- /package/{typed → dist}/terrain/shader-module.d.ts +0 -0
- /package/{typed → dist}/terrain/shader-module.d.ts.map +0 -0
- /package/{typed → dist}/terrain/terrain-cover.d.ts +0 -0
- /package/{typed → dist}/terrain/terrain-cover.d.ts.map +0 -0
- /package/{typed → dist}/terrain/terrain-effect.d.ts +0 -0
- /package/{typed → dist}/terrain/terrain-extension.d.ts +0 -0
- /package/{typed → dist}/terrain/terrain-extension.d.ts.map +0 -0
- /package/{typed → dist}/terrain/terrain-pass.d.ts +0 -0
- /package/{typed → dist}/terrain/terrain-picking-pass.d.ts +0 -0
- /package/{typed → dist}/terrain/utils.d.ts +0 -0
- /package/{typed → dist}/terrain/utils.d.ts.map +0 -0
- /package/{typed → dist}/utils/debug.d.ts +0 -0
- /package/{typed → dist}/utils/projection-utils.d.ts +0 -0
- /package/{typed → dist}/utils/projection-utils.d.ts.map +0 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2724 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// dist/index.js
|
|
21
|
+
var dist_exports = {};
|
|
22
|
+
__export(dist_exports, {
|
|
23
|
+
BrushingExtension: () => BrushingExtension,
|
|
24
|
+
ClipExtension: () => ClipExtension,
|
|
25
|
+
CollisionFilterExtension: () => CollisionFilterExtension,
|
|
26
|
+
DataFilterExtension: () => DataFilterExtension,
|
|
27
|
+
FillStyleExtension: () => FillStyleExtension,
|
|
28
|
+
Fp64Extension: () => Fp64Extension,
|
|
29
|
+
MaskExtension: () => MaskExtension,
|
|
30
|
+
PathStyleExtension: () => PathStyleExtension,
|
|
31
|
+
_TerrainExtension: () => TerrainExtension,
|
|
32
|
+
project64: () => project64_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(dist_exports);
|
|
35
|
+
|
|
36
|
+
// dist/brushing/brushing-extension.js
|
|
37
|
+
var import_core2 = require("@deck.gl/core");
|
|
38
|
+
|
|
39
|
+
// dist/brushing/shader-module.js
|
|
40
|
+
var import_core = require("@deck.gl/core");
|
|
41
|
+
var vs = `
|
|
42
|
+
uniform bool brushing_enabled;
|
|
43
|
+
uniform int brushing_target;
|
|
44
|
+
uniform vec2 brushing_mousePos;
|
|
45
|
+
uniform float brushing_radius;
|
|
46
|
+
|
|
47
|
+
#ifdef NON_INSTANCED_MODEL
|
|
48
|
+
in vec2 brushingTargets;
|
|
49
|
+
#else
|
|
50
|
+
in vec2 instanceBrushingTargets;
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
out float brushing_isVisible;
|
|
54
|
+
|
|
55
|
+
bool brushing_isPointInRange(vec2 position) {
|
|
56
|
+
if (!brushing_enabled) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
vec2 source_commonspace = project_position(position);
|
|
60
|
+
vec2 target_commonspace = project_position(brushing_mousePos);
|
|
61
|
+
float distance = length((target_commonspace - source_commonspace) / project_uCommonUnitsPerMeter.xy);
|
|
62
|
+
|
|
63
|
+
return distance <= brushing_radius;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
bool brushing_arePointsInRange(vec2 sourcePos, vec2 targetPos) {
|
|
67
|
+
return brushing_isPointInRange(sourcePos) || brushing_isPointInRange(targetPos);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
void brushing_setVisible(bool visible) {
|
|
71
|
+
brushing_isVisible = float(visible);
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
var fs = `
|
|
75
|
+
uniform bool brushing_enabled;
|
|
76
|
+
in float brushing_isVisible;
|
|
77
|
+
`;
|
|
78
|
+
var TARGET = {
|
|
79
|
+
source: 0,
|
|
80
|
+
target: 1,
|
|
81
|
+
custom: 2,
|
|
82
|
+
source_target: 3
|
|
83
|
+
};
|
|
84
|
+
var inject = {
|
|
85
|
+
"vs:DECKGL_FILTER_GL_POSITION": `
|
|
86
|
+
vec2 brushingTarget;
|
|
87
|
+
vec2 brushingSource;
|
|
88
|
+
if (brushing_target == 3) {
|
|
89
|
+
brushingTarget = geometry.worldPositionAlt.xy;
|
|
90
|
+
brushingSource = geometry.worldPosition.xy;
|
|
91
|
+
} else if (brushing_target == 0) {
|
|
92
|
+
brushingTarget = geometry.worldPosition.xy;
|
|
93
|
+
} else if (brushing_target == 1) {
|
|
94
|
+
brushingTarget = geometry.worldPositionAlt.xy;
|
|
95
|
+
} else {
|
|
96
|
+
#ifdef NON_INSTANCED_MODEL
|
|
97
|
+
brushingTarget = brushingTargets;
|
|
98
|
+
#else
|
|
99
|
+
brushingTarget = instanceBrushingTargets;
|
|
100
|
+
#endif
|
|
101
|
+
}
|
|
102
|
+
bool visible;
|
|
103
|
+
if (brushing_target == 3) {
|
|
104
|
+
visible = brushing_arePointsInRange(brushingSource, brushingTarget);
|
|
105
|
+
} else {
|
|
106
|
+
visible = brushing_isPointInRange(brushingTarget);
|
|
107
|
+
}
|
|
108
|
+
brushing_setVisible(visible);
|
|
109
|
+
`,
|
|
110
|
+
"fs:DECKGL_FILTER_COLOR": `
|
|
111
|
+
if (brushing_enabled && brushing_isVisible < 0.5) {
|
|
112
|
+
discard;
|
|
113
|
+
}
|
|
114
|
+
`
|
|
115
|
+
};
|
|
116
|
+
var shader_module_default = {
|
|
117
|
+
name: "brushing",
|
|
118
|
+
dependencies: [import_core.project],
|
|
119
|
+
vs,
|
|
120
|
+
fs,
|
|
121
|
+
inject,
|
|
122
|
+
getUniforms: (opts) => {
|
|
123
|
+
if (!opts || !("viewport" in opts)) {
|
|
124
|
+
return {};
|
|
125
|
+
}
|
|
126
|
+
const { brushingEnabled = true, brushingRadius = 1e4, brushingTarget = "source", mousePosition, viewport } = opts;
|
|
127
|
+
return {
|
|
128
|
+
brushing_enabled: Boolean(brushingEnabled && mousePosition && viewport.containsPixel(mousePosition)),
|
|
129
|
+
brushing_radius: brushingRadius,
|
|
130
|
+
brushing_target: TARGET[brushingTarget] || 0,
|
|
131
|
+
brushing_mousePos: mousePosition ? viewport.unproject([mousePosition.x - viewport.x, mousePosition.y - viewport.y]) : [0, 0]
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// dist/brushing/brushing-extension.js
|
|
137
|
+
var defaultProps = {
|
|
138
|
+
getBrushingTarget: { type: "accessor", value: [0, 0] },
|
|
139
|
+
brushingTarget: "source",
|
|
140
|
+
brushingEnabled: true,
|
|
141
|
+
brushingRadius: 1e4
|
|
142
|
+
};
|
|
143
|
+
var _BrushingExtension = class extends import_core2.LayerExtension {
|
|
144
|
+
getShaders() {
|
|
145
|
+
return {
|
|
146
|
+
modules: [shader_module_default]
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
initializeState(context, extension) {
|
|
150
|
+
const attributeManager = this.getAttributeManager();
|
|
151
|
+
if (attributeManager) {
|
|
152
|
+
attributeManager.add({
|
|
153
|
+
brushingTargets: {
|
|
154
|
+
size: 2,
|
|
155
|
+
accessor: "getBrushingTarget",
|
|
156
|
+
shaderAttributes: {
|
|
157
|
+
brushingTargets: {
|
|
158
|
+
divisor: 0
|
|
159
|
+
},
|
|
160
|
+
instanceBrushingTargets: {
|
|
161
|
+
divisor: 1
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const onMouseMove = () => {
|
|
168
|
+
var _a;
|
|
169
|
+
(_a = this.getCurrentLayer()) == null ? void 0 : _a.setNeedsRedraw();
|
|
170
|
+
};
|
|
171
|
+
this.state.onMouseMove = onMouseMove;
|
|
172
|
+
if (context.deck) {
|
|
173
|
+
context.deck.eventManager.on({
|
|
174
|
+
pointermove: onMouseMove,
|
|
175
|
+
pointerleave: onMouseMove
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
finalizeState(context, extension) {
|
|
180
|
+
if (context.deck) {
|
|
181
|
+
const onMouseMove = this.state.onMouseMove;
|
|
182
|
+
context.deck.eventManager.off({
|
|
183
|
+
pointermove: onMouseMove,
|
|
184
|
+
pointerleave: onMouseMove
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
var BrushingExtension = _BrushingExtension;
|
|
190
|
+
(() => {
|
|
191
|
+
_BrushingExtension.defaultProps = defaultProps;
|
|
192
|
+
})();
|
|
193
|
+
(() => {
|
|
194
|
+
_BrushingExtension.extensionName = "BrushingExtension";
|
|
195
|
+
})();
|
|
196
|
+
|
|
197
|
+
// dist/data-filter/data-filter-extension.js
|
|
198
|
+
var import_constants2 = require("@luma.gl/constants");
|
|
199
|
+
var import_core3 = require("@deck.gl/core");
|
|
200
|
+
|
|
201
|
+
// dist/data-filter/shader-module.js
|
|
202
|
+
var vs2 = `
|
|
203
|
+
uniform DATAFILTER_TYPE filter_min;
|
|
204
|
+
uniform DATAFILTER_TYPE filter_softMin;
|
|
205
|
+
uniform DATAFILTER_TYPE filter_softMax;
|
|
206
|
+
uniform DATAFILTER_TYPE filter_max;
|
|
207
|
+
uniform bool filter_useSoftMargin;
|
|
208
|
+
uniform bool filter_enabled;
|
|
209
|
+
uniform bool filter_transformSize;
|
|
210
|
+
|
|
211
|
+
#ifdef NON_INSTANCED_MODEL
|
|
212
|
+
#define DATAFILTER_ATTRIB filterValues
|
|
213
|
+
#define DATAFILTER_ATTRIB_64LOW filterValues64Low
|
|
214
|
+
#else
|
|
215
|
+
#define DATAFILTER_ATTRIB instanceFilterValues
|
|
216
|
+
#define DATAFILTER_ATTRIB_64LOW instanceFilterValues64Low
|
|
217
|
+
#endif
|
|
218
|
+
|
|
219
|
+
in DATAFILTER_TYPE DATAFILTER_ATTRIB;
|
|
220
|
+
#ifdef DATAFILTER_DOUBLE
|
|
221
|
+
in DATAFILTER_TYPE DATAFILTER_ATTRIB_64LOW;
|
|
222
|
+
|
|
223
|
+
uniform DATAFILTER_TYPE filter_min64High;
|
|
224
|
+
uniform DATAFILTER_TYPE filter_max64High;
|
|
225
|
+
#endif
|
|
226
|
+
|
|
227
|
+
out float dataFilter_value;
|
|
228
|
+
|
|
229
|
+
float dataFilter_reduceValue(float value) {
|
|
230
|
+
return value;
|
|
231
|
+
}
|
|
232
|
+
float dataFilter_reduceValue(vec2 value) {
|
|
233
|
+
return min(value.x, value.y);
|
|
234
|
+
}
|
|
235
|
+
float dataFilter_reduceValue(vec3 value) {
|
|
236
|
+
return min(min(value.x, value.y), value.z);
|
|
237
|
+
}
|
|
238
|
+
float dataFilter_reduceValue(vec4 value) {
|
|
239
|
+
return min(min(value.x, value.y), min(value.z, value.w));
|
|
240
|
+
}
|
|
241
|
+
void dataFilter_setValue(DATAFILTER_TYPE valueFromMin, DATAFILTER_TYPE valueFromMax) {
|
|
242
|
+
if (filter_enabled) {
|
|
243
|
+
if (filter_useSoftMargin) {
|
|
244
|
+
dataFilter_value = dataFilter_reduceValue(
|
|
245
|
+
smoothstep(filter_min, filter_softMin, valueFromMin) *
|
|
246
|
+
(1.0 - smoothstep(filter_softMax, filter_max, valueFromMax))
|
|
247
|
+
);
|
|
248
|
+
} else {
|
|
249
|
+
dataFilter_value = dataFilter_reduceValue(
|
|
250
|
+
step(filter_min, valueFromMin) * step(valueFromMax, filter_max)
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
} else {
|
|
254
|
+
dataFilter_value = 1.0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
`;
|
|
258
|
+
var fs2 = `
|
|
259
|
+
uniform bool filter_transformColor;
|
|
260
|
+
in float dataFilter_value;
|
|
261
|
+
`;
|
|
262
|
+
function getUniforms(opts) {
|
|
263
|
+
if (!opts || !("extensions" in opts)) {
|
|
264
|
+
return {};
|
|
265
|
+
}
|
|
266
|
+
const { filterRange = [-1, 1], filterEnabled = true, filterTransformSize = true, filterTransformColor = true } = opts;
|
|
267
|
+
const filterSoftRange = opts.filterSoftRange || filterRange;
|
|
268
|
+
return {
|
|
269
|
+
...Number.isFinite(filterRange[0]) ? {
|
|
270
|
+
filter_min: filterRange[0],
|
|
271
|
+
filter_softMin: filterSoftRange[0],
|
|
272
|
+
filter_softMax: filterSoftRange[1],
|
|
273
|
+
filter_max: filterRange[1]
|
|
274
|
+
} : {
|
|
275
|
+
filter_min: filterRange.map((r) => r[0]),
|
|
276
|
+
filter_softMin: filterSoftRange.map((r) => r[0]),
|
|
277
|
+
filter_softMax: filterSoftRange.map((r) => r[1]),
|
|
278
|
+
filter_max: filterRange.map((r) => r[1])
|
|
279
|
+
},
|
|
280
|
+
filter_enabled: filterEnabled,
|
|
281
|
+
filter_useSoftMargin: Boolean(opts.filterSoftRange),
|
|
282
|
+
filter_transformSize: filterEnabled && filterTransformSize,
|
|
283
|
+
filter_transformColor: filterEnabled && filterTransformColor
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function getUniforms64(opts) {
|
|
287
|
+
if (!opts || !("extensions" in opts)) {
|
|
288
|
+
return {};
|
|
289
|
+
}
|
|
290
|
+
const uniforms = getUniforms(opts);
|
|
291
|
+
if (Number.isFinite(uniforms.filter_min)) {
|
|
292
|
+
const min64High = Math.fround(uniforms.filter_min);
|
|
293
|
+
uniforms.filter_min -= min64High;
|
|
294
|
+
uniforms.filter_softMin -= min64High;
|
|
295
|
+
uniforms.filter_min64High = min64High;
|
|
296
|
+
const max64High = Math.fround(uniforms.filter_max);
|
|
297
|
+
uniforms.filter_max -= max64High;
|
|
298
|
+
uniforms.filter_softMax -= max64High;
|
|
299
|
+
uniforms.filter_max64High = max64High;
|
|
300
|
+
} else {
|
|
301
|
+
const min64High = uniforms.filter_min.map(Math.fround);
|
|
302
|
+
uniforms.filter_min = uniforms.filter_min.map((x, i) => x - min64High[i]);
|
|
303
|
+
uniforms.filter_softMin = uniforms.filter_softMin.map((x, i) => x - min64High[i]);
|
|
304
|
+
uniforms.filter_min64High = min64High;
|
|
305
|
+
const max64High = uniforms.filter_max.map(Math.fround);
|
|
306
|
+
uniforms.filter_max = uniforms.filter_max.map((x, i) => x - max64High[i]);
|
|
307
|
+
uniforms.filter_softMax = uniforms.filter_softMax.map((x, i) => x - max64High[i]);
|
|
308
|
+
uniforms.filter_max64High = max64High;
|
|
309
|
+
}
|
|
310
|
+
return uniforms;
|
|
311
|
+
}
|
|
312
|
+
var inject2 = {
|
|
313
|
+
"vs:#main-start": `
|
|
314
|
+
#ifdef DATAFILTER_DOUBLE
|
|
315
|
+
dataFilter_setValue(
|
|
316
|
+
DATAFILTER_ATTRIB - filter_min64High + DATAFILTER_ATTRIB_64LOW,
|
|
317
|
+
DATAFILTER_ATTRIB - filter_max64High + DATAFILTER_ATTRIB_64LOW
|
|
318
|
+
);
|
|
319
|
+
#else
|
|
320
|
+
dataFilter_setValue(DATAFILTER_ATTRIB, DATAFILTER_ATTRIB);
|
|
321
|
+
#endif
|
|
322
|
+
`,
|
|
323
|
+
"vs:#main-end": `
|
|
324
|
+
if (dataFilter_value == 0.0) {
|
|
325
|
+
gl_Position = vec4(0.);
|
|
326
|
+
}
|
|
327
|
+
`,
|
|
328
|
+
"vs:DECKGL_FILTER_SIZE": `
|
|
329
|
+
if (filter_transformSize) {
|
|
330
|
+
size = size * dataFilter_value;
|
|
331
|
+
}
|
|
332
|
+
`,
|
|
333
|
+
"fs:DECKGL_FILTER_COLOR": `
|
|
334
|
+
if (dataFilter_value == 0.0) discard;
|
|
335
|
+
if (filter_transformColor) {
|
|
336
|
+
color.a *= dataFilter_value;
|
|
337
|
+
}
|
|
338
|
+
`
|
|
339
|
+
};
|
|
340
|
+
var shaderModule = {
|
|
341
|
+
name: "data-filter",
|
|
342
|
+
vs: vs2,
|
|
343
|
+
fs: fs2,
|
|
344
|
+
inject: inject2,
|
|
345
|
+
getUniforms
|
|
346
|
+
};
|
|
347
|
+
var shaderModule64 = {
|
|
348
|
+
name: "data-filter-fp64",
|
|
349
|
+
vs: vs2,
|
|
350
|
+
fs: fs2,
|
|
351
|
+
inject: inject2,
|
|
352
|
+
getUniforms: getUniforms64
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
// dist/data-filter/aggregator.js
|
|
356
|
+
var import_engine = require("@luma.gl/engine");
|
|
357
|
+
var import_constants = require("@luma.gl/constants");
|
|
358
|
+
var AGGREGATE_VS = `#version 300 es
|
|
359
|
+
#define SHADER_NAME data-filter-vertex-shader
|
|
360
|
+
|
|
361
|
+
#ifdef FLOAT_TARGET
|
|
362
|
+
in float filterIndices;
|
|
363
|
+
in float filterPrevIndices;
|
|
364
|
+
#else
|
|
365
|
+
in vec2 filterIndices;
|
|
366
|
+
in vec2 filterPrevIndices;
|
|
367
|
+
#endif
|
|
368
|
+
|
|
369
|
+
out vec4 vColor;
|
|
370
|
+
const float component = 1.0 / 255.0;
|
|
371
|
+
|
|
372
|
+
void main() {
|
|
373
|
+
#ifdef FLOAT_TARGET
|
|
374
|
+
dataFilter_value *= float(filterIndices != filterPrevIndices);
|
|
375
|
+
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
|
376
|
+
vColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
377
|
+
#else
|
|
378
|
+
// Float texture is not supported: pack result into 4 channels x 256 px x 64px
|
|
379
|
+
dataFilter_value *= float(filterIndices.x != filterPrevIndices.x);
|
|
380
|
+
float col = filterIndices.x;
|
|
381
|
+
float row = filterIndices.y * 4.0;
|
|
382
|
+
float channel = floor(row);
|
|
383
|
+
row = fract(row);
|
|
384
|
+
vColor = component * vec4(bvec4(channel == 0.0, channel == 1.0, channel == 2.0, channel == 3.0));
|
|
385
|
+
gl_Position = vec4(col * 2.0 - 1.0, row * 2.0 - 1.0, 0.0, 1.0);
|
|
386
|
+
#endif
|
|
387
|
+
gl_PointSize = 1.0;
|
|
388
|
+
}
|
|
389
|
+
`;
|
|
390
|
+
var AGGREGATE_FS = `#version 300 es
|
|
391
|
+
#define SHADER_NAME data-filter-fragment-shader
|
|
392
|
+
precision highp float;
|
|
393
|
+
|
|
394
|
+
in vec4 vColor;
|
|
395
|
+
|
|
396
|
+
out vec4 fragColor;
|
|
397
|
+
|
|
398
|
+
void main() {
|
|
399
|
+
if (dataFilter_value < 0.5) {
|
|
400
|
+
discard;
|
|
401
|
+
}
|
|
402
|
+
fragColor = vColor;
|
|
403
|
+
}
|
|
404
|
+
`;
|
|
405
|
+
function supportsFloatTarget(device) {
|
|
406
|
+
const gl = device.gl;
|
|
407
|
+
return Boolean(gl.getExtension("EXT_float_blend") && (gl.getExtension("EXT_color_buffer_float") || gl.getExtension("WEBGL_color_buffer_float")));
|
|
408
|
+
}
|
|
409
|
+
function getFramebuffer(device, useFloatTarget) {
|
|
410
|
+
if (useFloatTarget) {
|
|
411
|
+
return device.createFramebuffer({
|
|
412
|
+
width: 1,
|
|
413
|
+
height: 1,
|
|
414
|
+
colorAttachments: [
|
|
415
|
+
device.createTexture({
|
|
416
|
+
format: device.info.type === "webgl2" ? "rgba32float" : "rgba8unorm",
|
|
417
|
+
type: import_constants.GL.FLOAT,
|
|
418
|
+
mipmaps: false
|
|
419
|
+
})
|
|
420
|
+
]
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
return device.createFramebuffer({
|
|
424
|
+
width: 256,
|
|
425
|
+
height: 64,
|
|
426
|
+
colorAttachments: [device.createTexture({ format: "rgba8unorm", type: import_constants.GL.FLOAT, mipmaps: false })]
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
function getModel(device, shaderOptions, useFloatTarget) {
|
|
430
|
+
shaderOptions.defines.NON_INSTANCED_MODEL = 1;
|
|
431
|
+
if (useFloatTarget) {
|
|
432
|
+
shaderOptions.defines.FLOAT_TARGET = 1;
|
|
433
|
+
}
|
|
434
|
+
return new import_engine.Model(device, {
|
|
435
|
+
id: "data-filter-aggregation-model",
|
|
436
|
+
vertexCount: 1,
|
|
437
|
+
isInstanced: false,
|
|
438
|
+
drawMode: import_constants.GL.POINTS,
|
|
439
|
+
vs: AGGREGATE_VS,
|
|
440
|
+
fs: AGGREGATE_FS,
|
|
441
|
+
...shaderOptions
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
var parameters = {
|
|
445
|
+
blend: true,
|
|
446
|
+
blendFunc: [import_constants.GL.ONE, import_constants.GL.ONE, import_constants.GL.ONE, import_constants.GL.ONE],
|
|
447
|
+
blendEquation: [import_constants.GL.FUNC_ADD, import_constants.GL.FUNC_ADD],
|
|
448
|
+
depthTest: false
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
// dist/data-filter/data-filter-extension.js
|
|
452
|
+
var defaultProps2 = {
|
|
453
|
+
getFilterValue: { type: "accessor", value: 0 },
|
|
454
|
+
onFilteredItemsChange: { type: "function", value: null, optional: true },
|
|
455
|
+
filterEnabled: true,
|
|
456
|
+
filterRange: [-1, 1],
|
|
457
|
+
filterSoftRange: null,
|
|
458
|
+
filterTransformSize: true,
|
|
459
|
+
filterTransformColor: true
|
|
460
|
+
};
|
|
461
|
+
var DATA_TYPE_FROM_SIZE = {
|
|
462
|
+
1: "float",
|
|
463
|
+
2: "vec2",
|
|
464
|
+
3: "vec3",
|
|
465
|
+
4: "vec4"
|
|
466
|
+
};
|
|
467
|
+
var _DataFilterExtension = class extends import_core3.LayerExtension {
|
|
468
|
+
constructor({ filterSize = 1, fp64: fp642 = false, countItems = false } = {}) {
|
|
469
|
+
if (!DATA_TYPE_FROM_SIZE[filterSize]) {
|
|
470
|
+
throw new Error("filterSize out of range");
|
|
471
|
+
}
|
|
472
|
+
super({ filterSize, fp64: fp642, countItems });
|
|
473
|
+
}
|
|
474
|
+
getShaders(extension) {
|
|
475
|
+
const { filterSize, fp64: fp642 } = extension.opts;
|
|
476
|
+
return {
|
|
477
|
+
modules: [fp642 ? shaderModule64 : shaderModule],
|
|
478
|
+
defines: {
|
|
479
|
+
DATAFILTER_TYPE: DATA_TYPE_FROM_SIZE[filterSize],
|
|
480
|
+
DATAFILTER_DOUBLE: Boolean(fp642)
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
initializeState(context, extension) {
|
|
485
|
+
const attributeManager = this.getAttributeManager();
|
|
486
|
+
if (attributeManager) {
|
|
487
|
+
attributeManager.add({
|
|
488
|
+
filterValues: {
|
|
489
|
+
size: extension.opts.filterSize,
|
|
490
|
+
type: extension.opts.fp64 ? import_constants2.GL.DOUBLE : import_constants2.GL.FLOAT,
|
|
491
|
+
accessor: "getFilterValue",
|
|
492
|
+
shaderAttributes: {
|
|
493
|
+
filterValues: {
|
|
494
|
+
divisor: 0
|
|
495
|
+
},
|
|
496
|
+
instanceFilterValues: {
|
|
497
|
+
divisor: 1
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
const { device } = this.context;
|
|
504
|
+
if (attributeManager && extension.opts.countItems) {
|
|
505
|
+
const useFloatTarget = supportsFloatTarget(device);
|
|
506
|
+
attributeManager.add({
|
|
507
|
+
filterIndices: {
|
|
508
|
+
size: useFloatTarget ? 1 : 2,
|
|
509
|
+
vertexOffset: 1,
|
|
510
|
+
type: import_constants2.GL.UNSIGNED_BYTE,
|
|
511
|
+
normalized: true,
|
|
512
|
+
accessor: (object, { index }) => {
|
|
513
|
+
const i = object && object.__source ? object.__source.index : index;
|
|
514
|
+
return useFloatTarget ? (i + 1) % 255 : [(i + 1) % 255, Math.floor(i / 255) % 255];
|
|
515
|
+
},
|
|
516
|
+
shaderAttributes: {
|
|
517
|
+
filterPrevIndices: {
|
|
518
|
+
vertexOffset: 0
|
|
519
|
+
},
|
|
520
|
+
filterIndices: {
|
|
521
|
+
vertexOffset: 1
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
});
|
|
526
|
+
const filterFBO = getFramebuffer(device, useFloatTarget);
|
|
527
|
+
const filterModel = getModel(device, extension.getShaders.call(this, extension), useFloatTarget);
|
|
528
|
+
this.setState({ filterFBO, filterModel });
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
updateState({ props, oldProps }) {
|
|
532
|
+
if (this.state.filterModel) {
|
|
533
|
+
const attributeManager = this.getAttributeManager();
|
|
534
|
+
const filterNeedsUpdate = attributeManager.attributes.filterValues.needsUpdate() || props.filterEnabled !== oldProps.filterEnabled || props.filterRange !== oldProps.filterRange || props.filterSoftRange !== oldProps.filterSoftRange;
|
|
535
|
+
if (filterNeedsUpdate) {
|
|
536
|
+
this.setState({ filterNeedsUpdate });
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
draw(params, extension) {
|
|
541
|
+
const filterFBO = this.state.filterFBO;
|
|
542
|
+
const filterModel = this.state.filterModel;
|
|
543
|
+
const filterNeedsUpdate = this.state.filterNeedsUpdate;
|
|
544
|
+
const { onFilteredItemsChange } = this.props;
|
|
545
|
+
if (filterNeedsUpdate && onFilteredItemsChange && filterModel) {
|
|
546
|
+
const { attributes: { filterValues, filterIndices } } = this.getAttributeManager();
|
|
547
|
+
filterModel.setVertexCount(this.getNumInstances());
|
|
548
|
+
this.context.device.clearWebGL({ framebuffer: filterFBO, color: [0, 0, 0, 0] });
|
|
549
|
+
filterModel.updateModuleSettings(params.moduleParameters);
|
|
550
|
+
filterModel.setAttributes({
|
|
551
|
+
...filterValues.getValue(),
|
|
552
|
+
...filterIndices == null ? void 0 : filterIndices.getValue()
|
|
553
|
+
});
|
|
554
|
+
filterModel.device.withParametersWebGL({
|
|
555
|
+
framebuffer: filterFBO,
|
|
556
|
+
...parameters,
|
|
557
|
+
viewport: [0, 0, filterFBO.width, filterFBO.height]
|
|
558
|
+
}, () => {
|
|
559
|
+
filterModel.draw(this.context.renderPass);
|
|
560
|
+
});
|
|
561
|
+
const color = filterModel.device.readPixelsToArrayWebGL(filterFBO);
|
|
562
|
+
let count = 0;
|
|
563
|
+
for (let i = 0; i < color.length; i++) {
|
|
564
|
+
count += color[i];
|
|
565
|
+
}
|
|
566
|
+
onFilteredItemsChange({ id: this.id, count });
|
|
567
|
+
this.state.filterNeedsUpdate = false;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
finalizeState() {
|
|
571
|
+
const filterFBO = this.state.filterFBO;
|
|
572
|
+
const filterModel = this.state.filterModel;
|
|
573
|
+
filterFBO == null ? void 0 : filterFBO.destroy();
|
|
574
|
+
filterModel == null ? void 0 : filterModel.destroy();
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
var DataFilterExtension = _DataFilterExtension;
|
|
578
|
+
(() => {
|
|
579
|
+
_DataFilterExtension.defaultProps = defaultProps2;
|
|
580
|
+
})();
|
|
581
|
+
(() => {
|
|
582
|
+
_DataFilterExtension.extensionName = "DataFilterExtension";
|
|
583
|
+
})();
|
|
584
|
+
|
|
585
|
+
// dist/fp64/fp64-extension.js
|
|
586
|
+
var import_core5 = require("@deck.gl/core");
|
|
587
|
+
|
|
588
|
+
// dist/fp64/project64.js
|
|
589
|
+
var import_shadertools = require("@luma.gl/shadertools");
|
|
590
|
+
var import_core4 = require("@deck.gl/core");
|
|
591
|
+
|
|
592
|
+
// dist/fp64/project64.glsl.js
|
|
593
|
+
var project64_glsl_default = `
|
|
594
|
+
const vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);
|
|
595
|
+
|
|
596
|
+
uniform vec2 project_uViewProjectionMatrixFP64[16];
|
|
597
|
+
|
|
598
|
+
// longitude: lnglat_fp64.xy; latitude: lnglat_fp64.zw
|
|
599
|
+
void mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {
|
|
600
|
+
|
|
601
|
+
#if defined(NVIDIA_FP64_WORKAROUND)
|
|
602
|
+
out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);
|
|
603
|
+
#else
|
|
604
|
+
out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);
|
|
605
|
+
#endif
|
|
606
|
+
out_val[1] = sum_fp64(PI_FP64,
|
|
607
|
+
log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
void project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {
|
|
612
|
+
vec2 pos_fp64[2];
|
|
613
|
+
mercatorProject_fp64(position_fp64, pos_fp64);
|
|
614
|
+
out_val[0] = mul_fp64(pos_fp64[0], WORLD_SCALE_FP64);
|
|
615
|
+
out_val[1] = mul_fp64(pos_fp64[1], WORLD_SCALE_FP64);
|
|
616
|
+
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
void project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {
|
|
621
|
+
vec4 position64xy = vec4(
|
|
622
|
+
position.x, position64xyLow.x,
|
|
623
|
+
position.y, position64xyLow.y);
|
|
624
|
+
|
|
625
|
+
project_position_fp64(position64xy, out_val);
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
vec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {
|
|
629
|
+
vec2 vertex_pos_clipspace[4];
|
|
630
|
+
mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,
|
|
631
|
+
vertex_pos_clipspace);
|
|
632
|
+
return vec4(
|
|
633
|
+
vertex_pos_clipspace[0].x,
|
|
634
|
+
vertex_pos_clipspace[1].x,
|
|
635
|
+
vertex_pos_clipspace[2].x,
|
|
636
|
+
vertex_pos_clipspace[3].x
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
vec4 project_position_to_clipspace(
|
|
641
|
+
vec3 position, vec3 position64xyLow, vec3 offset, out vec4 commonPosition
|
|
642
|
+
) {
|
|
643
|
+
// This is the local offset to the instance position
|
|
644
|
+
vec2 offset64[4];
|
|
645
|
+
vec4_fp64(vec4(offset, 0.0), offset64);
|
|
646
|
+
|
|
647
|
+
float z = project_size(position.z);
|
|
648
|
+
|
|
649
|
+
// Apply web mercator projection (depends on coordinate system imn use)
|
|
650
|
+
vec2 projectedPosition64xy[2];
|
|
651
|
+
project_position_fp64(position.xy, position64xyLow.xy, projectedPosition64xy);
|
|
652
|
+
|
|
653
|
+
vec2 commonPosition64[4];
|
|
654
|
+
commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);
|
|
655
|
+
commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);
|
|
656
|
+
commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));
|
|
657
|
+
commonPosition64[3] = vec2(1.0, 0.0);
|
|
658
|
+
|
|
659
|
+
commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);
|
|
660
|
+
|
|
661
|
+
return project_common_position_to_clipspace_fp64(commonPosition64);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
vec4 project_position_to_clipspace(
|
|
665
|
+
vec3 position, vec3 position64xyLow, vec3 offset
|
|
666
|
+
) {
|
|
667
|
+
vec4 commonPosition;
|
|
668
|
+
return project_position_to_clipspace(
|
|
669
|
+
position, position64xyLow, offset, commonPosition
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
`;
|
|
673
|
+
|
|
674
|
+
// dist/fp64/project64.js
|
|
675
|
+
var { fp64ify, fp64ifyMatrix4 } = import_shadertools.fp64;
|
|
676
|
+
var project64_default = {
|
|
677
|
+
name: "project64",
|
|
678
|
+
dependencies: [import_core4.project, import_shadertools.fp64],
|
|
679
|
+
vs: project64_glsl_default,
|
|
680
|
+
getUniforms: getUniforms2
|
|
681
|
+
};
|
|
682
|
+
var getMemoizedUniforms = (0, import_core4._memoize)(calculateUniforms);
|
|
683
|
+
function getUniforms2(opts) {
|
|
684
|
+
if (opts && "viewport" in opts) {
|
|
685
|
+
const { viewProjectionMatrix, scale } = opts.viewport;
|
|
686
|
+
return getMemoizedUniforms({ viewProjectionMatrix, scale });
|
|
687
|
+
}
|
|
688
|
+
return {};
|
|
689
|
+
}
|
|
690
|
+
function calculateUniforms({ viewProjectionMatrix, scale }) {
|
|
691
|
+
const glViewProjectionMatrixFP64 = fp64ifyMatrix4(viewProjectionMatrix);
|
|
692
|
+
const scaleFP64 = fp64ify(scale);
|
|
693
|
+
return {
|
|
694
|
+
project_uViewProjectionMatrixFP64: glViewProjectionMatrixFP64,
|
|
695
|
+
project64_uViewProjectionMatrix: glViewProjectionMatrixFP64,
|
|
696
|
+
project64_uScale: scaleFP64
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// dist/fp64/fp64-extension.js
|
|
701
|
+
var _Fp64Extension = class extends import_core5.LayerExtension {
|
|
702
|
+
getShaders() {
|
|
703
|
+
const { coordinateSystem } = this.props;
|
|
704
|
+
if (coordinateSystem !== import_core5.COORDINATE_SYSTEM.LNGLAT && coordinateSystem !== import_core5.COORDINATE_SYSTEM.DEFAULT) {
|
|
705
|
+
throw new Error("fp64: coordinateSystem must be LNGLAT");
|
|
706
|
+
}
|
|
707
|
+
return {
|
|
708
|
+
modules: [project64_default]
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
var Fp64Extension = _Fp64Extension;
|
|
713
|
+
(() => {
|
|
714
|
+
_Fp64Extension.extensionName = "Fp64Extension";
|
|
715
|
+
})();
|
|
716
|
+
|
|
717
|
+
// dist/path-style/path-style-extension.js
|
|
718
|
+
var import_core6 = require("@deck.gl/core");
|
|
719
|
+
var import_core7 = require("@math.gl/core");
|
|
720
|
+
|
|
721
|
+
// dist/path-style/shaders.glsl.js
|
|
722
|
+
var dashShaders = {
|
|
723
|
+
inject: {
|
|
724
|
+
"vs:#decl": `
|
|
725
|
+
in vec2 instanceDashArrays;
|
|
726
|
+
in float instanceDashOffsets;
|
|
727
|
+
out vec2 vDashArray;
|
|
728
|
+
out float vDashOffset;
|
|
729
|
+
`,
|
|
730
|
+
"vs:#main-end": `
|
|
731
|
+
vDashArray = instanceDashArrays;
|
|
732
|
+
vDashOffset = instanceDashOffsets / width.x;
|
|
733
|
+
`,
|
|
734
|
+
"fs:#decl": `
|
|
735
|
+
uniform float dashAlignMode;
|
|
736
|
+
uniform float capType;
|
|
737
|
+
uniform bool dashGapPickable;
|
|
738
|
+
in vec2 vDashArray;
|
|
739
|
+
in float vDashOffset;
|
|
740
|
+
`,
|
|
741
|
+
"fs:#main-start": `
|
|
742
|
+
float solidLength = vDashArray.x;
|
|
743
|
+
float gapLength = vDashArray.y;
|
|
744
|
+
float unitLength = solidLength + gapLength;
|
|
745
|
+
|
|
746
|
+
float offset;
|
|
747
|
+
|
|
748
|
+
if (unitLength > 0.0) {
|
|
749
|
+
if (dashAlignMode == 0.0) {
|
|
750
|
+
offset = vDashOffset;
|
|
751
|
+
} else {
|
|
752
|
+
unitLength = vPathLength / round(vPathLength / unitLength);
|
|
753
|
+
offset = solidLength / 2.0;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
float unitOffset = mod(vPathPosition.y + offset, unitLength);
|
|
757
|
+
|
|
758
|
+
if (gapLength > 0.0 && unitOffset > solidLength) {
|
|
759
|
+
if (capType <= 0.5) {
|
|
760
|
+
if (!(dashGapPickable && bool(picking.isActive))) {
|
|
761
|
+
discard;
|
|
762
|
+
}
|
|
763
|
+
} else {
|
|
764
|
+
// caps are rounded, test the distance to solid ends
|
|
765
|
+
float distToEnd = length(vec2(
|
|
766
|
+
min(unitOffset - solidLength, unitLength - unitOffset),
|
|
767
|
+
vPathPosition.x
|
|
768
|
+
));
|
|
769
|
+
if (distToEnd > 1.0) {
|
|
770
|
+
if (!(dashGapPickable && bool(picking.isActive))) {
|
|
771
|
+
discard;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
`
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
var offsetShaders = {
|
|
781
|
+
inject: {
|
|
782
|
+
"vs:#decl": `
|
|
783
|
+
in float instanceOffsets;
|
|
784
|
+
`,
|
|
785
|
+
"vs:DECKGL_FILTER_SIZE": `
|
|
786
|
+
float offsetWidth = abs(instanceOffsets * 2.0) + 1.0;
|
|
787
|
+
size *= offsetWidth;
|
|
788
|
+
`,
|
|
789
|
+
"vs:#main-end": `
|
|
790
|
+
float offsetWidth = abs(instanceOffsets * 2.0) + 1.0;
|
|
791
|
+
float offsetDir = sign(instanceOffsets);
|
|
792
|
+
vPathPosition.x = (vPathPosition.x + offsetDir) * offsetWidth - offsetDir;
|
|
793
|
+
vPathPosition.y *= offsetWidth;
|
|
794
|
+
vPathLength *= offsetWidth;
|
|
795
|
+
`,
|
|
796
|
+
"fs:#main-start": `
|
|
797
|
+
float isInside;
|
|
798
|
+
isInside = step(-1.0, vPathPosition.x) * step(vPathPosition.x, 1.0);
|
|
799
|
+
if (isInside == 0.0) {
|
|
800
|
+
discard;
|
|
801
|
+
}
|
|
802
|
+
`
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
// dist/path-style/path-style-extension.js
|
|
807
|
+
var defaultProps3 = {
|
|
808
|
+
getDashArray: { type: "accessor", value: [0, 0] },
|
|
809
|
+
getOffset: { type: "accessor", value: 0 },
|
|
810
|
+
dashJustified: false,
|
|
811
|
+
dashGapPickable: false
|
|
812
|
+
};
|
|
813
|
+
var _PathStyleExtension = class extends import_core6.LayerExtension {
|
|
814
|
+
constructor({ dash = false, offset = false, highPrecisionDash = false } = {}) {
|
|
815
|
+
super({ dash: dash || highPrecisionDash, offset, highPrecisionDash });
|
|
816
|
+
}
|
|
817
|
+
isEnabled(layer) {
|
|
818
|
+
return "pathTesselator" in layer.state;
|
|
819
|
+
}
|
|
820
|
+
getShaders(extension) {
|
|
821
|
+
if (!extension.isEnabled(this)) {
|
|
822
|
+
return null;
|
|
823
|
+
}
|
|
824
|
+
let result = {};
|
|
825
|
+
if (extension.opts.dash) {
|
|
826
|
+
result = (0, import_core6._mergeShaders)(result, dashShaders);
|
|
827
|
+
}
|
|
828
|
+
if (extension.opts.offset) {
|
|
829
|
+
result = (0, import_core6._mergeShaders)(result, offsetShaders);
|
|
830
|
+
}
|
|
831
|
+
return result;
|
|
832
|
+
}
|
|
833
|
+
initializeState(context, extension) {
|
|
834
|
+
const attributeManager = this.getAttributeManager();
|
|
835
|
+
if (!attributeManager || !extension.isEnabled(this)) {
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
if (extension.opts.dash) {
|
|
839
|
+
attributeManager.addInstanced({
|
|
840
|
+
instanceDashArrays: { size: 2, accessor: "getDashArray" },
|
|
841
|
+
instanceDashOffsets: extension.opts.highPrecisionDash ? {
|
|
842
|
+
size: 1,
|
|
843
|
+
accessor: "getPath",
|
|
844
|
+
transform: extension.getDashOffsets.bind(this)
|
|
845
|
+
} : {
|
|
846
|
+
size: 1,
|
|
847
|
+
update: (attribute) => {
|
|
848
|
+
attribute.constant = true;
|
|
849
|
+
attribute.value = [0];
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
if (extension.opts.offset) {
|
|
855
|
+
attributeManager.addInstanced({
|
|
856
|
+
instanceOffsets: { size: 1, accessor: "getOffset" }
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
updateState(params, extension) {
|
|
861
|
+
var _a;
|
|
862
|
+
if (!extension.isEnabled(this)) {
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
const uniforms = {};
|
|
866
|
+
if (extension.opts.dash) {
|
|
867
|
+
uniforms.dashAlignMode = this.props.dashJustified ? 1 : 0;
|
|
868
|
+
uniforms.dashGapPickable = Boolean(this.props.dashGapPickable);
|
|
869
|
+
}
|
|
870
|
+
(_a = this.state.model) == null ? void 0 : _a.setUniforms(uniforms);
|
|
871
|
+
}
|
|
872
|
+
getDashOffsets(path) {
|
|
873
|
+
const result = [0];
|
|
874
|
+
const positionSize = this.props.positionFormat === "XY" ? 2 : 3;
|
|
875
|
+
const isNested = Array.isArray(path[0]);
|
|
876
|
+
const geometrySize = isNested ? path.length : path.length / positionSize;
|
|
877
|
+
let p;
|
|
878
|
+
let prevP;
|
|
879
|
+
for (let i = 0; i < geometrySize - 1; i++) {
|
|
880
|
+
p = isNested ? path[i] : path.slice(i * positionSize, i * positionSize + positionSize);
|
|
881
|
+
p = this.projectPosition(p);
|
|
882
|
+
if (i > 0) {
|
|
883
|
+
result[i] = result[i - 1] + import_core7.vec3.dist(prevP, p);
|
|
884
|
+
}
|
|
885
|
+
prevP = p;
|
|
886
|
+
}
|
|
887
|
+
return result;
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
var PathStyleExtension = _PathStyleExtension;
|
|
891
|
+
(() => {
|
|
892
|
+
_PathStyleExtension.defaultProps = defaultProps3;
|
|
893
|
+
})();
|
|
894
|
+
(() => {
|
|
895
|
+
_PathStyleExtension.extensionName = "PathStyleExtension";
|
|
896
|
+
})();
|
|
897
|
+
|
|
898
|
+
// dist/fill-style/fill-style-extension.js
|
|
899
|
+
var import_core9 = require("@deck.gl/core");
|
|
900
|
+
|
|
901
|
+
// dist/fill-style/shaders.glsl.js
|
|
902
|
+
var import_core8 = require("@deck.gl/core");
|
|
903
|
+
var patternVs = `
|
|
904
|
+
#ifdef NON_INSTANCED_MODEL
|
|
905
|
+
#define FILL_PATTERN_FRAME_ATTRIB fillPatternFrames
|
|
906
|
+
#define FILL_PATTERN_SCALE_ATTRIB fillPatternScales
|
|
907
|
+
#define FILL_PATTERN_OFFSET_ATTRIB fillPatternOffsets
|
|
908
|
+
#else
|
|
909
|
+
#define FILL_PATTERN_FRAME_ATTRIB instanceFillPatternFrames
|
|
910
|
+
#define FILL_PATTERN_SCALE_ATTRIB instanceFillPatternScales
|
|
911
|
+
#define FILL_PATTERN_OFFSET_ATTRIB instanceFillPatternOffsets
|
|
912
|
+
#endif
|
|
913
|
+
|
|
914
|
+
in vec4 FILL_PATTERN_FRAME_ATTRIB;
|
|
915
|
+
in float FILL_PATTERN_SCALE_ATTRIB;
|
|
916
|
+
in vec2 FILL_PATTERN_OFFSET_ATTRIB;
|
|
917
|
+
|
|
918
|
+
uniform bool fill_patternEnabled;
|
|
919
|
+
uniform vec2 fill_patternTextureSize;
|
|
920
|
+
|
|
921
|
+
out vec2 fill_uv;
|
|
922
|
+
out vec4 fill_patternBounds;
|
|
923
|
+
out vec4 fill_patternPlacement;
|
|
924
|
+
`;
|
|
925
|
+
var patternFs = `
|
|
926
|
+
uniform bool fill_patternEnabled;
|
|
927
|
+
uniform bool fill_patternMask;
|
|
928
|
+
uniform sampler2D fill_patternTexture;
|
|
929
|
+
uniform vec2 fill_uvCoordinateOrigin;
|
|
930
|
+
uniform vec2 fill_uvCoordinateOrigin64Low;
|
|
931
|
+
|
|
932
|
+
in vec4 fill_patternBounds;
|
|
933
|
+
in vec4 fill_patternPlacement;
|
|
934
|
+
in vec2 fill_uv;
|
|
935
|
+
|
|
936
|
+
const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
937
|
+
`;
|
|
938
|
+
var inject3 = {
|
|
939
|
+
"vs:DECKGL_FILTER_GL_POSITION": `
|
|
940
|
+
fill_uv = geometry.position.xy;
|
|
941
|
+
`,
|
|
942
|
+
"vs:DECKGL_FILTER_COLOR": `
|
|
943
|
+
if (fill_patternEnabled) {
|
|
944
|
+
fill_patternBounds = FILL_PATTERN_FRAME_ATTRIB / vec4(fill_patternTextureSize, fill_patternTextureSize);
|
|
945
|
+
fill_patternPlacement.xy = FILL_PATTERN_OFFSET_ATTRIB;
|
|
946
|
+
fill_patternPlacement.zw = FILL_PATTERN_SCALE_ATTRIB * FILL_PATTERN_FRAME_ATTRIB.zw;
|
|
947
|
+
}
|
|
948
|
+
`,
|
|
949
|
+
"fs:DECKGL_FILTER_COLOR": `
|
|
950
|
+
if (fill_patternEnabled) {
|
|
951
|
+
vec2 scale = FILL_UV_SCALE * fill_patternPlacement.zw;
|
|
952
|
+
vec2 patternUV = mod(mod(fill_uvCoordinateOrigin, scale) + fill_uvCoordinateOrigin64Low + fill_uv, scale) / scale;
|
|
953
|
+
patternUV = mod(fill_patternPlacement.xy + patternUV, 1.0);
|
|
954
|
+
|
|
955
|
+
vec2 texCoords = fill_patternBounds.xy + fill_patternBounds.zw * patternUV;
|
|
956
|
+
|
|
957
|
+
vec4 patternColor = texture(fill_patternTexture, texCoords);
|
|
958
|
+
color.a *= patternColor.a;
|
|
959
|
+
if (!fill_patternMask) {
|
|
960
|
+
color.rgb = patternColor.rgb;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
`
|
|
964
|
+
};
|
|
965
|
+
function getPatternUniforms(opts, uniforms) {
|
|
966
|
+
if (!opts) {
|
|
967
|
+
return {};
|
|
968
|
+
}
|
|
969
|
+
if ("fillPatternTexture" in opts) {
|
|
970
|
+
const { fillPatternTexture } = opts;
|
|
971
|
+
return {
|
|
972
|
+
fill_patternTexture: fillPatternTexture,
|
|
973
|
+
fill_patternTextureSize: [fillPatternTexture.width, fillPatternTexture.height]
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
if ("viewport" in opts) {
|
|
977
|
+
const { fillPatternMask = true, fillPatternEnabled = true } = opts;
|
|
978
|
+
const { project_uCommonOrigin: coordinateOriginCommon } = uniforms;
|
|
979
|
+
const coordinateOriginCommon64Low = [
|
|
980
|
+
(0, import_core8.fp64LowPart)(coordinateOriginCommon[0]),
|
|
981
|
+
(0, import_core8.fp64LowPart)(coordinateOriginCommon[1])
|
|
982
|
+
];
|
|
983
|
+
return {
|
|
984
|
+
fill_uvCoordinateOrigin: coordinateOriginCommon.slice(0, 2),
|
|
985
|
+
fill_uvCoordinateOrigin64Low: coordinateOriginCommon64Low,
|
|
986
|
+
fill_patternMask: fillPatternMask,
|
|
987
|
+
fill_patternEnabled: fillPatternEnabled
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
return {};
|
|
991
|
+
}
|
|
992
|
+
var patternShaders = {
|
|
993
|
+
name: "fill-pattern",
|
|
994
|
+
vs: patternVs,
|
|
995
|
+
fs: patternFs,
|
|
996
|
+
inject: inject3,
|
|
997
|
+
dependencies: [import_core8.project],
|
|
998
|
+
getUniforms: getPatternUniforms
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
// dist/fill-style/fill-style-extension.js
|
|
1002
|
+
var defaultProps4 = {
|
|
1003
|
+
fillPatternEnabled: true,
|
|
1004
|
+
fillPatternAtlas: {
|
|
1005
|
+
type: "image",
|
|
1006
|
+
value: null,
|
|
1007
|
+
async: true,
|
|
1008
|
+
parameters: {
|
|
1009
|
+
minFilter: "linear"
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
fillPatternMapping: { type: "object", value: {}, async: true },
|
|
1013
|
+
fillPatternMask: true,
|
|
1014
|
+
getFillPattern: { type: "accessor", value: (d) => d.pattern },
|
|
1015
|
+
getFillPatternScale: { type: "accessor", value: 1 },
|
|
1016
|
+
getFillPatternOffset: { type: "accessor", value: [0, 0] }
|
|
1017
|
+
};
|
|
1018
|
+
var _FillStyleExtension = class extends import_core9.LayerExtension {
|
|
1019
|
+
constructor({ pattern = false } = {}) {
|
|
1020
|
+
super({ pattern });
|
|
1021
|
+
}
|
|
1022
|
+
isEnabled(layer) {
|
|
1023
|
+
return layer.getAttributeManager() !== null && !("pathTesselator" in layer.state);
|
|
1024
|
+
}
|
|
1025
|
+
getShaders(extension) {
|
|
1026
|
+
if (!extension.isEnabled(this)) {
|
|
1027
|
+
return null;
|
|
1028
|
+
}
|
|
1029
|
+
return {
|
|
1030
|
+
modules: [extension.opts.pattern && patternShaders].filter(Boolean)
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
initializeState(context, extension) {
|
|
1034
|
+
if (!extension.isEnabled(this)) {
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
const attributeManager = this.getAttributeManager();
|
|
1038
|
+
if (extension.opts.pattern) {
|
|
1039
|
+
attributeManager.add({
|
|
1040
|
+
fillPatternFrames: {
|
|
1041
|
+
size: 4,
|
|
1042
|
+
accessor: "getFillPattern",
|
|
1043
|
+
transform: extension.getPatternFrame.bind(this),
|
|
1044
|
+
shaderAttributes: {
|
|
1045
|
+
fillPatternFrames: {
|
|
1046
|
+
divisor: 0
|
|
1047
|
+
},
|
|
1048
|
+
instanceFillPatternFrames: {
|
|
1049
|
+
divisor: 1
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
},
|
|
1053
|
+
fillPatternScales: {
|
|
1054
|
+
size: 1,
|
|
1055
|
+
accessor: "getFillPatternScale",
|
|
1056
|
+
defaultValue: 1,
|
|
1057
|
+
shaderAttributes: {
|
|
1058
|
+
fillPatternScales: {
|
|
1059
|
+
divisor: 0
|
|
1060
|
+
},
|
|
1061
|
+
instanceFillPatternScales: {
|
|
1062
|
+
divisor: 1
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
fillPatternOffsets: {
|
|
1067
|
+
size: 2,
|
|
1068
|
+
accessor: "getFillPatternOffset",
|
|
1069
|
+
shaderAttributes: {
|
|
1070
|
+
fillPatternOffsets: {
|
|
1071
|
+
divisor: 0
|
|
1072
|
+
},
|
|
1073
|
+
instanceFillPatternOffsets: {
|
|
1074
|
+
divisor: 1
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
this.setState({
|
|
1081
|
+
emptyTexture: this.context.device.createTexture({
|
|
1082
|
+
data: new Uint8Array(4),
|
|
1083
|
+
width: 1,
|
|
1084
|
+
height: 1
|
|
1085
|
+
})
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
updateState({ props, oldProps }, extension) {
|
|
1089
|
+
if (!extension.isEnabled(this)) {
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
if (props.fillPatternMapping && props.fillPatternMapping !== oldProps.fillPatternMapping) {
|
|
1093
|
+
this.getAttributeManager().invalidate("getFillPattern");
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
draw(params, extension) {
|
|
1097
|
+
if (!extension.isEnabled(this)) {
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
const { fillPatternAtlas } = this.props;
|
|
1101
|
+
this.setModuleParameters({
|
|
1102
|
+
fillPatternTexture: fillPatternAtlas || this.state.emptyTexture
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
finalizeState() {
|
|
1106
|
+
const emptyTexture = this.state.emptyTexture;
|
|
1107
|
+
emptyTexture == null ? void 0 : emptyTexture.delete();
|
|
1108
|
+
}
|
|
1109
|
+
getPatternFrame(name) {
|
|
1110
|
+
const { fillPatternMapping } = this.getCurrentLayer().props;
|
|
1111
|
+
const def = fillPatternMapping && fillPatternMapping[name];
|
|
1112
|
+
return def ? [def.x, def.y, def.width, def.height] : [0, 0, 0, 0];
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
var FillStyleExtension = _FillStyleExtension;
|
|
1116
|
+
(() => {
|
|
1117
|
+
_FillStyleExtension.defaultProps = defaultProps4;
|
|
1118
|
+
})();
|
|
1119
|
+
(() => {
|
|
1120
|
+
_FillStyleExtension.extensionName = "FillStyleExtension";
|
|
1121
|
+
})();
|
|
1122
|
+
|
|
1123
|
+
// dist/clip/clip-extension.js
|
|
1124
|
+
var import_core10 = require("@deck.gl/core");
|
|
1125
|
+
var defaultProps5 = {
|
|
1126
|
+
clipBounds: [0, 0, 1, 1],
|
|
1127
|
+
clipByInstance: void 0
|
|
1128
|
+
};
|
|
1129
|
+
var shaderFunction = `
|
|
1130
|
+
uniform vec4 clip_bounds;
|
|
1131
|
+
|
|
1132
|
+
bool clip_isInBounds(vec2 position) {
|
|
1133
|
+
return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];
|
|
1134
|
+
}
|
|
1135
|
+
`;
|
|
1136
|
+
var shaderModuleVs = {
|
|
1137
|
+
name: "clip-vs",
|
|
1138
|
+
vs: shaderFunction
|
|
1139
|
+
};
|
|
1140
|
+
var injectionVs = {
|
|
1141
|
+
"vs:#decl": `
|
|
1142
|
+
out float clip_isVisible;
|
|
1143
|
+
`,
|
|
1144
|
+
"vs:DECKGL_FILTER_GL_POSITION": `
|
|
1145
|
+
clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));
|
|
1146
|
+
`,
|
|
1147
|
+
"fs:#decl": `
|
|
1148
|
+
in float clip_isVisible;
|
|
1149
|
+
`,
|
|
1150
|
+
"fs:DECKGL_FILTER_COLOR": `
|
|
1151
|
+
if (clip_isVisible < 0.5) discard;
|
|
1152
|
+
`
|
|
1153
|
+
};
|
|
1154
|
+
var shaderModuleFs = {
|
|
1155
|
+
name: "clip-fs",
|
|
1156
|
+
fs: shaderFunction
|
|
1157
|
+
};
|
|
1158
|
+
var injectionFs = {
|
|
1159
|
+
"vs:#decl": `
|
|
1160
|
+
out vec2 clip_commonPosition;
|
|
1161
|
+
`,
|
|
1162
|
+
"vs:DECKGL_FILTER_GL_POSITION": `
|
|
1163
|
+
clip_commonPosition = geometry.position.xy;
|
|
1164
|
+
`,
|
|
1165
|
+
"fs:#decl": `
|
|
1166
|
+
in vec2 clip_commonPosition;
|
|
1167
|
+
`,
|
|
1168
|
+
"fs:DECKGL_FILTER_COLOR": `
|
|
1169
|
+
if (!clip_isInBounds(clip_commonPosition)) discard;
|
|
1170
|
+
`
|
|
1171
|
+
};
|
|
1172
|
+
var _ClipExtension = class extends import_core10.LayerExtension {
|
|
1173
|
+
getShaders() {
|
|
1174
|
+
let clipByInstance = "instancePositions" in this.getAttributeManager().attributes;
|
|
1175
|
+
if (this.props.clipByInstance !== void 0) {
|
|
1176
|
+
clipByInstance = Boolean(this.props.clipByInstance);
|
|
1177
|
+
}
|
|
1178
|
+
this.state.clipByInstance = clipByInstance;
|
|
1179
|
+
return clipByInstance ? {
|
|
1180
|
+
modules: [shaderModuleVs],
|
|
1181
|
+
inject: injectionVs
|
|
1182
|
+
} : {
|
|
1183
|
+
modules: [shaderModuleFs],
|
|
1184
|
+
inject: injectionFs
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
draw({ uniforms }) {
|
|
1188
|
+
const { clipBounds } = this.props;
|
|
1189
|
+
if (this.state.clipByInstance) {
|
|
1190
|
+
uniforms.clip_bounds = clipBounds;
|
|
1191
|
+
} else {
|
|
1192
|
+
const corner0 = this.projectPosition([clipBounds[0], clipBounds[1], 0]);
|
|
1193
|
+
const corner1 = this.projectPosition([clipBounds[2], clipBounds[3], 0]);
|
|
1194
|
+
uniforms.clip_bounds = [
|
|
1195
|
+
Math.min(corner0[0], corner1[0]),
|
|
1196
|
+
Math.min(corner0[1], corner1[1]),
|
|
1197
|
+
Math.max(corner0[0], corner1[0]),
|
|
1198
|
+
Math.max(corner0[1], corner1[1])
|
|
1199
|
+
];
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
var ClipExtension = _ClipExtension;
|
|
1204
|
+
(() => {
|
|
1205
|
+
_ClipExtension.defaultProps = defaultProps5;
|
|
1206
|
+
})();
|
|
1207
|
+
(() => {
|
|
1208
|
+
_ClipExtension.extensionName = "ClipExtension";
|
|
1209
|
+
})();
|
|
1210
|
+
|
|
1211
|
+
// dist/collision-filter/collision-filter-extension.js
|
|
1212
|
+
var import_core19 = require("@deck.gl/core");
|
|
1213
|
+
|
|
1214
|
+
// dist/collision-filter/shader-module.js
|
|
1215
|
+
var import_core11 = require("@deck.gl/core");
|
|
1216
|
+
var vs3 = `
|
|
1217
|
+
#ifdef NON_INSTANCED_MODEL
|
|
1218
|
+
in float collisionPriorities;
|
|
1219
|
+
#else
|
|
1220
|
+
in float instanceCollisionPriorities;
|
|
1221
|
+
#endif
|
|
1222
|
+
|
|
1223
|
+
uniform sampler2D collision_texture;
|
|
1224
|
+
uniform bool collision_sort;
|
|
1225
|
+
uniform bool collision_enabled;
|
|
1226
|
+
|
|
1227
|
+
vec2 collision_getCoords(vec4 position) {
|
|
1228
|
+
vec4 collision_clipspace = project_common_position_to_clipspace(position);
|
|
1229
|
+
return (1.0 + collision_clipspace.xy / collision_clipspace.w) / 2.0;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
float collision_match(vec2 tex, vec3 pickingColor) {
|
|
1233
|
+
vec4 collision_pickingColor = texture(collision_texture, tex);
|
|
1234
|
+
float delta = dot(abs(collision_pickingColor.rgb - pickingColor), vec3(1.0));
|
|
1235
|
+
float e = 0.001;
|
|
1236
|
+
return step(delta, e);
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
1240
|
+
if (!collision_enabled) {
|
|
1241
|
+
return 1.0;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// Visibility test, sample area of 5x5 pixels in order to fade in/out.
|
|
1245
|
+
// Due to the locality, the lookups will be cached
|
|
1246
|
+
// This reduces the flicker present when objects are shown/hidden
|
|
1247
|
+
const int N = 2;
|
|
1248
|
+
float accumulator = 0.0;
|
|
1249
|
+
vec2 step = vec2(1.0 / project_uViewportSize);
|
|
1250
|
+
|
|
1251
|
+
const float floatN = float(N);
|
|
1252
|
+
vec2 delta = -floatN * step;
|
|
1253
|
+
for(int i = -N; i <= N; i++) {
|
|
1254
|
+
delta.x = -step.x * floatN;
|
|
1255
|
+
for(int j = -N; j <= N; j++) {
|
|
1256
|
+
accumulator += collision_match(texCoords + delta, pickingColor);
|
|
1257
|
+
delta.x += step.x;
|
|
1258
|
+
}
|
|
1259
|
+
delta.y += step.y;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
float W = 2.0 * floatN + 1.0;
|
|
1263
|
+
return pow(accumulator / (W * W), 2.2);
|
|
1264
|
+
}
|
|
1265
|
+
`;
|
|
1266
|
+
var inject4 = {
|
|
1267
|
+
"vs:#decl": `
|
|
1268
|
+
float collision_fade = 1.0;
|
|
1269
|
+
`,
|
|
1270
|
+
"vs:DECKGL_FILTER_GL_POSITION": `
|
|
1271
|
+
if (collision_sort) {
|
|
1272
|
+
#ifdef NON_INSTANCED_MODEL
|
|
1273
|
+
float collisionPriority = collisionPriorities;
|
|
1274
|
+
#else
|
|
1275
|
+
float collisionPriority = instanceCollisionPriorities;
|
|
1276
|
+
#endif
|
|
1277
|
+
position.z = -0.001 * collisionPriority * position.w; // Support range -1000 -> 1000
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
if (collision_enabled) {
|
|
1281
|
+
vec4 collision_common_position = project_position(vec4(geometry.worldPosition, 1.0));
|
|
1282
|
+
vec2 collision_texCoords = collision_getCoords(collision_common_position);
|
|
1283
|
+
collision_fade = collision_isVisible(collision_texCoords, geometry.pickingColor / 255.0);
|
|
1284
|
+
if (collision_fade < 0.0001) {
|
|
1285
|
+
// Position outside clip space bounds to discard
|
|
1286
|
+
position = vec4(0.0, 0.0, 2.0, 1.0);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
`,
|
|
1290
|
+
"vs:DECKGL_FILTER_COLOR": `
|
|
1291
|
+
color.a *= collision_fade;
|
|
1292
|
+
`
|
|
1293
|
+
};
|
|
1294
|
+
var getCollisionUniforms = (opts, uniforms) => {
|
|
1295
|
+
if (!opts || !("dummyCollisionMap" in opts)) {
|
|
1296
|
+
return {};
|
|
1297
|
+
}
|
|
1298
|
+
const { collisionFBO, drawToCollisionMap, dummyCollisionMap } = opts;
|
|
1299
|
+
return {
|
|
1300
|
+
collision_sort: Boolean(drawToCollisionMap),
|
|
1301
|
+
collision_texture: !drawToCollisionMap && collisionFBO ? collisionFBO.colorAttachments[0] : dummyCollisionMap
|
|
1302
|
+
};
|
|
1303
|
+
};
|
|
1304
|
+
var shader_module_default2 = {
|
|
1305
|
+
name: "collision",
|
|
1306
|
+
dependencies: [import_core11.project],
|
|
1307
|
+
vs: vs3,
|
|
1308
|
+
inject: inject4,
|
|
1309
|
+
getUniforms: getCollisionUniforms
|
|
1310
|
+
};
|
|
1311
|
+
|
|
1312
|
+
// dist/collision-filter/collision-filter-effect.js
|
|
1313
|
+
var import_core17 = require("@math.gl/core");
|
|
1314
|
+
var import_core18 = require("@deck.gl/core");
|
|
1315
|
+
|
|
1316
|
+
// dist/collision-filter/collision-filter-pass.js
|
|
1317
|
+
var import_core12 = require("@deck.gl/core");
|
|
1318
|
+
var CollisionFilterPass = class extends import_core12._LayersPass {
|
|
1319
|
+
renderCollisionMap(target, options) {
|
|
1320
|
+
const padding = 1;
|
|
1321
|
+
const clearColor = [0, 0, 0, 0];
|
|
1322
|
+
return this.device.withParametersWebGL({
|
|
1323
|
+
scissorTest: true,
|
|
1324
|
+
scissor: [padding, padding, target.width - 2 * padding, target.height - 2 * padding],
|
|
1325
|
+
blend: false,
|
|
1326
|
+
depthTest: true,
|
|
1327
|
+
depthRange: [0, 1]
|
|
1328
|
+
}, () => this.render({ ...options, clearColor, target, pass: "collision" }));
|
|
1329
|
+
}
|
|
1330
|
+
getModuleParameters() {
|
|
1331
|
+
return {
|
|
1332
|
+
drawToCollisionMap: true,
|
|
1333
|
+
picking: {
|
|
1334
|
+
isActive: 1,
|
|
1335
|
+
isAttribute: false
|
|
1336
|
+
},
|
|
1337
|
+
lightSources: {}
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
// dist/mask/mask-effect.js
|
|
1343
|
+
var import_core15 = require("@deck.gl/core");
|
|
1344
|
+
var import_core16 = require("@math.gl/core");
|
|
1345
|
+
|
|
1346
|
+
// dist/mask/mask-pass.js
|
|
1347
|
+
var import_constants3 = require("@luma.gl/constants");
|
|
1348
|
+
var import_core13 = require("@deck.gl/core");
|
|
1349
|
+
var MaskPass = class extends import_core13._LayersPass {
|
|
1350
|
+
constructor(device, props) {
|
|
1351
|
+
super(device, props);
|
|
1352
|
+
const { mapSize = 2048 } = props;
|
|
1353
|
+
this.maskMap = device.createTexture({
|
|
1354
|
+
format: "rgba8unorm",
|
|
1355
|
+
width: mapSize,
|
|
1356
|
+
height: mapSize,
|
|
1357
|
+
sampler: {
|
|
1358
|
+
minFilter: "linear",
|
|
1359
|
+
magFilter: "linear",
|
|
1360
|
+
addressModeU: "clamp-to-edge",
|
|
1361
|
+
addressModeV: "clamp-to-edge"
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
this.fbo = device.createFramebuffer({
|
|
1365
|
+
id: "maskmap",
|
|
1366
|
+
width: mapSize,
|
|
1367
|
+
height: mapSize,
|
|
1368
|
+
colorAttachments: [this.maskMap]
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
render(options) {
|
|
1372
|
+
const colorMask = [false, false, false, false];
|
|
1373
|
+
colorMask[options.channel] = true;
|
|
1374
|
+
const clearColor = [255, 255, 255, 255];
|
|
1375
|
+
return this.device.withParametersWebGL({
|
|
1376
|
+
blend: true,
|
|
1377
|
+
blendFunc: [import_constants3.GL.ZERO, import_constants3.GL.ONE],
|
|
1378
|
+
blendEquation: import_constants3.GL.FUNC_SUBTRACT,
|
|
1379
|
+
colorMask,
|
|
1380
|
+
depthTest: false
|
|
1381
|
+
}, () => super.render({ ...options, clearColor, target: this.fbo, pass: "mask" }));
|
|
1382
|
+
}
|
|
1383
|
+
shouldDrawLayer(layer) {
|
|
1384
|
+
return layer.props.operation.includes("mask");
|
|
1385
|
+
}
|
|
1386
|
+
delete() {
|
|
1387
|
+
this.fbo.delete();
|
|
1388
|
+
this.maskMap.delete();
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
// dist/utils/projection-utils.js
|
|
1393
|
+
var import_core14 = require("@deck.gl/core");
|
|
1394
|
+
function joinLayerBounds(layers, viewport) {
|
|
1395
|
+
const bounds = [Infinity, Infinity, -Infinity, -Infinity];
|
|
1396
|
+
for (const layer of layers) {
|
|
1397
|
+
const layerBounds = layer.getBounds();
|
|
1398
|
+
if (layerBounds) {
|
|
1399
|
+
const bottomLeftCommon = layer.projectPosition(layerBounds[0], { viewport, autoOffset: false });
|
|
1400
|
+
const topRightCommon = layer.projectPosition(layerBounds[1], { viewport, autoOffset: false });
|
|
1401
|
+
bounds[0] = Math.min(bounds[0], bottomLeftCommon[0]);
|
|
1402
|
+
bounds[1] = Math.min(bounds[1], bottomLeftCommon[1]);
|
|
1403
|
+
bounds[2] = Math.max(bounds[2], topRightCommon[0]);
|
|
1404
|
+
bounds[3] = Math.max(bounds[3], topRightCommon[1]);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
if (Number.isFinite(bounds[0])) {
|
|
1408
|
+
return bounds;
|
|
1409
|
+
}
|
|
1410
|
+
return null;
|
|
1411
|
+
}
|
|
1412
|
+
var MAX_VIEWPORT_SIZE = 2048;
|
|
1413
|
+
function makeViewport(opts) {
|
|
1414
|
+
const { bounds, viewport, border = 0 } = opts;
|
|
1415
|
+
const { isGeospatial } = viewport;
|
|
1416
|
+
if (bounds[2] <= bounds[0] || bounds[3] <= bounds[1]) {
|
|
1417
|
+
return null;
|
|
1418
|
+
}
|
|
1419
|
+
const centerWorld = viewport.unprojectPosition([
|
|
1420
|
+
(bounds[0] + bounds[2]) / 2,
|
|
1421
|
+
(bounds[1] + bounds[3]) / 2,
|
|
1422
|
+
0
|
|
1423
|
+
]);
|
|
1424
|
+
let { width, height, zoom } = opts;
|
|
1425
|
+
if (zoom === void 0) {
|
|
1426
|
+
width = width - border * 2;
|
|
1427
|
+
height = height - border * 2;
|
|
1428
|
+
const scale = Math.min(width / (bounds[2] - bounds[0]), height / (bounds[3] - bounds[1]));
|
|
1429
|
+
zoom = Math.min(Math.log2(scale), 20);
|
|
1430
|
+
} else if (!width || !height) {
|
|
1431
|
+
const scale = 2 ** zoom;
|
|
1432
|
+
width = Math.round(Math.abs(bounds[2] - bounds[0]) * scale);
|
|
1433
|
+
height = Math.round(Math.abs(bounds[3] - bounds[1]) * scale);
|
|
1434
|
+
const maxSize = MAX_VIEWPORT_SIZE - border * 2;
|
|
1435
|
+
if (width > maxSize || height > maxSize) {
|
|
1436
|
+
const r = maxSize / Math.max(width, height);
|
|
1437
|
+
width = Math.round(width * r);
|
|
1438
|
+
height = Math.round(height * r);
|
|
1439
|
+
zoom += Math.log2(r);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
return isGeospatial ? new import_core14.WebMercatorViewport({
|
|
1443
|
+
id: viewport.id,
|
|
1444
|
+
x: border,
|
|
1445
|
+
y: border,
|
|
1446
|
+
width,
|
|
1447
|
+
height,
|
|
1448
|
+
longitude: centerWorld[0],
|
|
1449
|
+
latitude: centerWorld[1],
|
|
1450
|
+
zoom,
|
|
1451
|
+
orthographic: true
|
|
1452
|
+
}) : new import_core14.OrthographicViewport({
|
|
1453
|
+
id: viewport.id,
|
|
1454
|
+
x: border,
|
|
1455
|
+
y: border,
|
|
1456
|
+
width,
|
|
1457
|
+
height,
|
|
1458
|
+
target: centerWorld,
|
|
1459
|
+
zoom,
|
|
1460
|
+
flipY: false
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
function getViewportBounds(viewport, zRange) {
|
|
1464
|
+
let viewportBoundsWorld;
|
|
1465
|
+
if (zRange && zRange.length === 2) {
|
|
1466
|
+
const [minZ, maxZ] = zRange;
|
|
1467
|
+
const bounds0 = viewport.getBounds({ z: minZ });
|
|
1468
|
+
const bounds1 = viewport.getBounds({ z: maxZ });
|
|
1469
|
+
viewportBoundsWorld = [
|
|
1470
|
+
Math.min(bounds0[0], bounds1[0]),
|
|
1471
|
+
Math.min(bounds0[1], bounds1[1]),
|
|
1472
|
+
Math.max(bounds0[2], bounds1[2]),
|
|
1473
|
+
Math.max(bounds0[3], bounds1[3])
|
|
1474
|
+
];
|
|
1475
|
+
} else {
|
|
1476
|
+
viewportBoundsWorld = viewport.getBounds();
|
|
1477
|
+
}
|
|
1478
|
+
const viewportBottomLeftCommon = viewport.projectPosition(viewportBoundsWorld.slice(0, 2));
|
|
1479
|
+
const viewportTopRightCommon = viewport.projectPosition(viewportBoundsWorld.slice(2, 4));
|
|
1480
|
+
return [
|
|
1481
|
+
viewportBottomLeftCommon[0],
|
|
1482
|
+
viewportBottomLeftCommon[1],
|
|
1483
|
+
viewportTopRightCommon[0],
|
|
1484
|
+
viewportTopRightCommon[1]
|
|
1485
|
+
];
|
|
1486
|
+
}
|
|
1487
|
+
function getRenderBounds(layerBounds, viewport, zRange) {
|
|
1488
|
+
if (!layerBounds) {
|
|
1489
|
+
return [0, 0, 1, 1];
|
|
1490
|
+
}
|
|
1491
|
+
const viewportBounds = getViewportBounds(viewport, zRange);
|
|
1492
|
+
const paddedBounds = doubleBounds(viewportBounds);
|
|
1493
|
+
if (layerBounds[2] - layerBounds[0] <= paddedBounds[2] - paddedBounds[0] && layerBounds[3] - layerBounds[1] <= paddedBounds[3] - paddedBounds[1]) {
|
|
1494
|
+
return layerBounds;
|
|
1495
|
+
}
|
|
1496
|
+
return [
|
|
1497
|
+
Math.max(layerBounds[0], paddedBounds[0]),
|
|
1498
|
+
Math.max(layerBounds[1], paddedBounds[1]),
|
|
1499
|
+
Math.min(layerBounds[2], paddedBounds[2]),
|
|
1500
|
+
Math.min(layerBounds[3], paddedBounds[3])
|
|
1501
|
+
];
|
|
1502
|
+
}
|
|
1503
|
+
function doubleBounds(bounds) {
|
|
1504
|
+
const dx = bounds[2] - bounds[0];
|
|
1505
|
+
const dy = bounds[3] - bounds[1];
|
|
1506
|
+
const centerX = (bounds[0] + bounds[2]) / 2;
|
|
1507
|
+
const centerY = (bounds[1] + bounds[3]) / 2;
|
|
1508
|
+
return [centerX - dx, centerY - dy, centerX + dx, centerY + dy];
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// dist/mask/mask-effect.js
|
|
1512
|
+
var MaskEffect = class {
|
|
1513
|
+
constructor() {
|
|
1514
|
+
this.id = "mask-effect";
|
|
1515
|
+
this.props = null;
|
|
1516
|
+
this.useInPicking = true;
|
|
1517
|
+
this.order = 0;
|
|
1518
|
+
this.channels = [];
|
|
1519
|
+
this.masks = null;
|
|
1520
|
+
}
|
|
1521
|
+
preRender(device, { layers, layerFilter, viewports, onViewportActive, views, isPicking }) {
|
|
1522
|
+
let didRender = false;
|
|
1523
|
+
if (!this.dummyMaskMap) {
|
|
1524
|
+
this.dummyMaskMap = device.createTexture({
|
|
1525
|
+
width: 1,
|
|
1526
|
+
height: 1
|
|
1527
|
+
});
|
|
1528
|
+
}
|
|
1529
|
+
if (isPicking) {
|
|
1530
|
+
return { didRender };
|
|
1531
|
+
}
|
|
1532
|
+
const maskLayers = layers.filter((l) => l.props.visible && l.props.operation.includes("mask"));
|
|
1533
|
+
if (maskLayers.length === 0) {
|
|
1534
|
+
this.masks = null;
|
|
1535
|
+
this.channels.length = 0;
|
|
1536
|
+
return { didRender };
|
|
1537
|
+
}
|
|
1538
|
+
this.masks = {};
|
|
1539
|
+
if (!this.maskPass) {
|
|
1540
|
+
this.maskPass = new MaskPass(device, { id: "default-mask" });
|
|
1541
|
+
this.maskMap = this.maskPass.maskMap;
|
|
1542
|
+
}
|
|
1543
|
+
const channelMap = this._sortMaskChannels(maskLayers);
|
|
1544
|
+
const viewport = viewports[0];
|
|
1545
|
+
const viewportChanged = !this.lastViewport || !this.lastViewport.equals(viewport);
|
|
1546
|
+
if (viewport.resolution !== void 0) {
|
|
1547
|
+
import_core15.log.warn("MaskExtension is not supported in GlobeView")();
|
|
1548
|
+
return { didRender };
|
|
1549
|
+
}
|
|
1550
|
+
for (const maskId in channelMap) {
|
|
1551
|
+
const result = this._renderChannel(channelMap[maskId], {
|
|
1552
|
+
layerFilter,
|
|
1553
|
+
onViewportActive,
|
|
1554
|
+
views,
|
|
1555
|
+
viewport,
|
|
1556
|
+
viewportChanged
|
|
1557
|
+
});
|
|
1558
|
+
didRender ||= result;
|
|
1559
|
+
}
|
|
1560
|
+
return { didRender };
|
|
1561
|
+
}
|
|
1562
|
+
_renderChannel(channelInfo, { layerFilter, onViewportActive, views, viewport, viewportChanged }) {
|
|
1563
|
+
let didRender = false;
|
|
1564
|
+
const oldChannelInfo = this.channels[channelInfo.index];
|
|
1565
|
+
if (!oldChannelInfo) {
|
|
1566
|
+
return didRender;
|
|
1567
|
+
}
|
|
1568
|
+
const maskChanged = channelInfo === oldChannelInfo || channelInfo.layers.length !== oldChannelInfo.layers.length || channelInfo.layers.some((layer, i) => layer !== oldChannelInfo.layers[i] || layer.props.transitions) || channelInfo.layerBounds.some((b, i) => b !== oldChannelInfo.layerBounds[i]);
|
|
1569
|
+
channelInfo.bounds = oldChannelInfo.bounds;
|
|
1570
|
+
channelInfo.maskBounds = oldChannelInfo.maskBounds;
|
|
1571
|
+
this.channels[channelInfo.index] = channelInfo;
|
|
1572
|
+
if (maskChanged || viewportChanged) {
|
|
1573
|
+
this.lastViewport = viewport;
|
|
1574
|
+
const layerBounds = joinLayerBounds(channelInfo.layers, viewport);
|
|
1575
|
+
channelInfo.bounds = layerBounds && getRenderBounds(layerBounds, viewport);
|
|
1576
|
+
if (maskChanged || !(0, import_core16.equals)(channelInfo.bounds, oldChannelInfo.bounds)) {
|
|
1577
|
+
const { maskPass, maskMap } = this;
|
|
1578
|
+
const maskViewport = layerBounds && makeViewport({
|
|
1579
|
+
bounds: channelInfo.bounds,
|
|
1580
|
+
viewport,
|
|
1581
|
+
width: maskMap.width,
|
|
1582
|
+
height: maskMap.height,
|
|
1583
|
+
border: 1
|
|
1584
|
+
});
|
|
1585
|
+
channelInfo.maskBounds = maskViewport ? maskViewport.getBounds() : [0, 0, 1, 1];
|
|
1586
|
+
maskPass.render({
|
|
1587
|
+
pass: "mask",
|
|
1588
|
+
channel: channelInfo.index,
|
|
1589
|
+
layers: channelInfo.layers,
|
|
1590
|
+
layerFilter,
|
|
1591
|
+
viewports: maskViewport ? [maskViewport] : [],
|
|
1592
|
+
onViewportActive,
|
|
1593
|
+
views,
|
|
1594
|
+
moduleParameters: {
|
|
1595
|
+
devicePixelRatio: 1
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
didRender = true;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
this.masks[channelInfo.id] = {
|
|
1602
|
+
index: channelInfo.index,
|
|
1603
|
+
bounds: channelInfo.maskBounds,
|
|
1604
|
+
coordinateOrigin: channelInfo.coordinateOrigin,
|
|
1605
|
+
coordinateSystem: channelInfo.coordinateSystem
|
|
1606
|
+
};
|
|
1607
|
+
return didRender;
|
|
1608
|
+
}
|
|
1609
|
+
_sortMaskChannels(maskLayers) {
|
|
1610
|
+
const channelMap = {};
|
|
1611
|
+
let channelCount = 0;
|
|
1612
|
+
for (const layer of maskLayers) {
|
|
1613
|
+
const { id } = layer.root;
|
|
1614
|
+
let channelInfo = channelMap[id];
|
|
1615
|
+
if (!channelInfo) {
|
|
1616
|
+
if (++channelCount > 4) {
|
|
1617
|
+
import_core15.log.warn("Too many mask layers. The max supported is 4")();
|
|
1618
|
+
continue;
|
|
1619
|
+
}
|
|
1620
|
+
channelInfo = {
|
|
1621
|
+
id,
|
|
1622
|
+
index: this.channels.findIndex((c) => (c == null ? void 0 : c.id) === id),
|
|
1623
|
+
layers: [],
|
|
1624
|
+
layerBounds: [],
|
|
1625
|
+
coordinateOrigin: layer.root.props.coordinateOrigin,
|
|
1626
|
+
coordinateSystem: layer.root.props.coordinateSystem
|
|
1627
|
+
};
|
|
1628
|
+
channelMap[id] = channelInfo;
|
|
1629
|
+
}
|
|
1630
|
+
channelInfo.layers.push(layer);
|
|
1631
|
+
channelInfo.layerBounds.push(layer.getBounds());
|
|
1632
|
+
}
|
|
1633
|
+
for (let i = 0; i < 4; i++) {
|
|
1634
|
+
const channelInfo = this.channels[i];
|
|
1635
|
+
if (!channelInfo || !(channelInfo.id in channelMap)) {
|
|
1636
|
+
this.channels[i] = null;
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
for (const maskId in channelMap) {
|
|
1640
|
+
const channelInfo = channelMap[maskId];
|
|
1641
|
+
if (channelInfo.index < 0) {
|
|
1642
|
+
channelInfo.index = this.channels.findIndex((c) => !c);
|
|
1643
|
+
this.channels[channelInfo.index] = channelInfo;
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
return channelMap;
|
|
1647
|
+
}
|
|
1648
|
+
getModuleParameters() {
|
|
1649
|
+
return {
|
|
1650
|
+
maskMap: this.masks ? this.maskMap : this.dummyMaskMap,
|
|
1651
|
+
maskChannels: this.masks
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
cleanup() {
|
|
1655
|
+
if (this.dummyMaskMap) {
|
|
1656
|
+
this.dummyMaskMap.delete();
|
|
1657
|
+
this.dummyMaskMap = void 0;
|
|
1658
|
+
}
|
|
1659
|
+
if (this.maskPass) {
|
|
1660
|
+
this.maskPass.delete();
|
|
1661
|
+
this.maskPass = void 0;
|
|
1662
|
+
this.maskMap = void 0;
|
|
1663
|
+
}
|
|
1664
|
+
this.lastViewport = void 0;
|
|
1665
|
+
this.masks = null;
|
|
1666
|
+
this.channels.length = 0;
|
|
1667
|
+
}
|
|
1668
|
+
};
|
|
1669
|
+
|
|
1670
|
+
// dist/collision-filter/collision-filter-effect.js
|
|
1671
|
+
var DOWNSCALE = 2;
|
|
1672
|
+
var CollisionFilterEffect = class {
|
|
1673
|
+
constructor() {
|
|
1674
|
+
this.id = "collision-filter-effect";
|
|
1675
|
+
this.props = null;
|
|
1676
|
+
this.useInPicking = true;
|
|
1677
|
+
this.order = 1;
|
|
1678
|
+
this.channels = {};
|
|
1679
|
+
this.collisionFBOs = {};
|
|
1680
|
+
}
|
|
1681
|
+
preRender(device, { effects: allEffects, layers, layerFilter, viewports, onViewportActive, views, isPicking, preRenderStats = {} }) {
|
|
1682
|
+
var _a;
|
|
1683
|
+
if (!this.dummyCollisionMap) {
|
|
1684
|
+
this.dummyCollisionMap = device.createTexture({ width: 1, height: 1 });
|
|
1685
|
+
}
|
|
1686
|
+
if (isPicking) {
|
|
1687
|
+
return;
|
|
1688
|
+
}
|
|
1689
|
+
const collisionLayers = layers.filter(
|
|
1690
|
+
({ props: { visible, collisionEnabled } }) => visible && collisionEnabled
|
|
1691
|
+
);
|
|
1692
|
+
if (collisionLayers.length === 0) {
|
|
1693
|
+
this.channels = {};
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1696
|
+
if (!this.collisionFilterPass) {
|
|
1697
|
+
this.collisionFilterPass = new CollisionFilterPass(device, { id: "default-collision-filter" });
|
|
1698
|
+
}
|
|
1699
|
+
const effects = allEffects == null ? void 0 : allEffects.filter((e) => e.constructor === MaskEffect);
|
|
1700
|
+
const maskEffectRendered = (_a = preRenderStats["mask-effect"]) == null ? void 0 : _a.didRender;
|
|
1701
|
+
const channels = this._groupByCollisionGroup(device, collisionLayers);
|
|
1702
|
+
const viewport = viewports[0];
|
|
1703
|
+
const viewportChanged = !this.lastViewport || !this.lastViewport.equals(viewport) || maskEffectRendered;
|
|
1704
|
+
for (const collisionGroup in channels) {
|
|
1705
|
+
const collisionFBO = this.collisionFBOs[collisionGroup];
|
|
1706
|
+
const renderInfo = channels[collisionGroup];
|
|
1707
|
+
const [width, height] = device.canvasContext.getPixelSize();
|
|
1708
|
+
collisionFBO.resize({
|
|
1709
|
+
width: width / DOWNSCALE,
|
|
1710
|
+
height: height / DOWNSCALE
|
|
1711
|
+
});
|
|
1712
|
+
this._render(renderInfo, {
|
|
1713
|
+
effects,
|
|
1714
|
+
layerFilter,
|
|
1715
|
+
onViewportActive,
|
|
1716
|
+
views,
|
|
1717
|
+
viewport,
|
|
1718
|
+
viewportChanged
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
_render(renderInfo, { effects, layerFilter, onViewportActive, views, viewport, viewportChanged }) {
|
|
1723
|
+
const { collisionGroup } = renderInfo;
|
|
1724
|
+
const oldRenderInfo = this.channels[collisionGroup];
|
|
1725
|
+
if (!oldRenderInfo) {
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
const needsRender = viewportChanged || renderInfo === oldRenderInfo || !(0, import_core18._deepEqual)(oldRenderInfo.layers, renderInfo.layers, 1) || renderInfo.layerBounds.some((b, i) => !(0, import_core17.equals)(b, oldRenderInfo.layerBounds[i])) || renderInfo.allLayersLoaded !== oldRenderInfo.allLayersLoaded || renderInfo.layers.some((layer) => layer.props.transitions);
|
|
1729
|
+
this.channels[collisionGroup] = renderInfo;
|
|
1730
|
+
if (needsRender) {
|
|
1731
|
+
this.lastViewport = viewport;
|
|
1732
|
+
const collisionFBO = this.collisionFBOs[collisionGroup];
|
|
1733
|
+
this.collisionFilterPass.renderCollisionMap(collisionFBO, {
|
|
1734
|
+
pass: "collision-filter",
|
|
1735
|
+
isPicking: true,
|
|
1736
|
+
layers: renderInfo.layers,
|
|
1737
|
+
effects,
|
|
1738
|
+
layerFilter,
|
|
1739
|
+
viewports: viewport ? [viewport] : [],
|
|
1740
|
+
onViewportActive,
|
|
1741
|
+
views,
|
|
1742
|
+
moduleParameters: {
|
|
1743
|
+
dummyCollisionMap: this.dummyCollisionMap,
|
|
1744
|
+
devicePixelRatio: collisionFBO.device.canvasContext.getDevicePixelRatio() / DOWNSCALE
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
_groupByCollisionGroup(device, collisionLayers) {
|
|
1750
|
+
const channelMap = {};
|
|
1751
|
+
for (const layer of collisionLayers) {
|
|
1752
|
+
const { collisionGroup } = layer.props;
|
|
1753
|
+
let channelInfo = channelMap[collisionGroup];
|
|
1754
|
+
if (!channelInfo) {
|
|
1755
|
+
channelInfo = { collisionGroup, layers: [], layerBounds: [], allLayersLoaded: true };
|
|
1756
|
+
channelMap[collisionGroup] = channelInfo;
|
|
1757
|
+
}
|
|
1758
|
+
channelInfo.layers.push(layer);
|
|
1759
|
+
channelInfo.layerBounds.push(layer.getBounds());
|
|
1760
|
+
if (!layer.isLoaded) {
|
|
1761
|
+
channelInfo.allLayersLoaded = false;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
for (const collisionGroup of Object.keys(channelMap)) {
|
|
1765
|
+
if (!this.collisionFBOs[collisionGroup]) {
|
|
1766
|
+
this.createFBO(device, collisionGroup);
|
|
1767
|
+
}
|
|
1768
|
+
if (!this.channels[collisionGroup]) {
|
|
1769
|
+
this.channels[collisionGroup] = channelMap[collisionGroup];
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
for (const collisionGroup of Object.keys(this.collisionFBOs)) {
|
|
1773
|
+
if (!channelMap[collisionGroup]) {
|
|
1774
|
+
this.destroyFBO(collisionGroup);
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
return channelMap;
|
|
1778
|
+
}
|
|
1779
|
+
getModuleParameters(layer) {
|
|
1780
|
+
const { collisionGroup } = layer.props;
|
|
1781
|
+
const { collisionFBOs, dummyCollisionMap } = this;
|
|
1782
|
+
return { collisionFBO: collisionFBOs[collisionGroup], dummyCollisionMap };
|
|
1783
|
+
}
|
|
1784
|
+
cleanup() {
|
|
1785
|
+
if (this.dummyCollisionMap) {
|
|
1786
|
+
this.dummyCollisionMap.delete();
|
|
1787
|
+
this.dummyCollisionMap = void 0;
|
|
1788
|
+
}
|
|
1789
|
+
this.channels = {};
|
|
1790
|
+
for (const collisionGroup of Object.keys(this.collisionFBOs)) {
|
|
1791
|
+
this.destroyFBO(collisionGroup);
|
|
1792
|
+
}
|
|
1793
|
+
this.collisionFBOs = {};
|
|
1794
|
+
this.lastViewport = void 0;
|
|
1795
|
+
}
|
|
1796
|
+
createFBO(device, collisionGroup) {
|
|
1797
|
+
const { width, height } = device.gl.canvas;
|
|
1798
|
+
const collisionMap = device.createTexture({
|
|
1799
|
+
format: "rgba8unorm",
|
|
1800
|
+
width,
|
|
1801
|
+
height,
|
|
1802
|
+
sampler: {
|
|
1803
|
+
minFilter: "nearest",
|
|
1804
|
+
magFilter: "nearest",
|
|
1805
|
+
addressModeU: "clamp-to-edge",
|
|
1806
|
+
addressModeV: "clamp-to-edge"
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
const depthStencilAttachment = device.createTexture({
|
|
1810
|
+
format: "depth16unorm",
|
|
1811
|
+
width,
|
|
1812
|
+
height,
|
|
1813
|
+
mipmaps: false,
|
|
1814
|
+
dataFormat: 6402,
|
|
1815
|
+
type: 5125
|
|
1816
|
+
});
|
|
1817
|
+
this.collisionFBOs[collisionGroup] = device.createFramebuffer({
|
|
1818
|
+
id: `collision-${collisionGroup}`,
|
|
1819
|
+
width,
|
|
1820
|
+
height,
|
|
1821
|
+
colorAttachments: [collisionMap],
|
|
1822
|
+
depthStencilAttachment
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
destroyFBO(collisionGroup) {
|
|
1826
|
+
var _a, _b;
|
|
1827
|
+
const fbo = this.collisionFBOs[collisionGroup];
|
|
1828
|
+
(_a = fbo.colorAttachments[0]) == null ? void 0 : _a.destroy();
|
|
1829
|
+
(_b = fbo.depthStencilAttachment) == null ? void 0 : _b.destroy();
|
|
1830
|
+
fbo.destroy();
|
|
1831
|
+
delete this.collisionFBOs[collisionGroup];
|
|
1832
|
+
}
|
|
1833
|
+
};
|
|
1834
|
+
|
|
1835
|
+
// dist/collision-filter/collision-filter-extension.js
|
|
1836
|
+
var defaultProps6 = {
|
|
1837
|
+
getCollisionPriority: { type: "accessor", value: 0 },
|
|
1838
|
+
collisionEnabled: true,
|
|
1839
|
+
collisionGroup: { type: "string", value: "default" },
|
|
1840
|
+
collisionTestProps: {}
|
|
1841
|
+
};
|
|
1842
|
+
var _CollisionFilterExtension = class extends import_core19.LayerExtension {
|
|
1843
|
+
getShaders() {
|
|
1844
|
+
return { modules: [shader_module_default2] };
|
|
1845
|
+
}
|
|
1846
|
+
draw({ uniforms, context, moduleParameters }) {
|
|
1847
|
+
const { collisionEnabled } = this.props;
|
|
1848
|
+
const { collisionFBO, drawToCollisionMap } = moduleParameters;
|
|
1849
|
+
const enabled = collisionEnabled && Boolean(collisionFBO);
|
|
1850
|
+
uniforms.collision_enabled = enabled;
|
|
1851
|
+
if (drawToCollisionMap) {
|
|
1852
|
+
this.props = this.clone(this.props.collisionTestProps).props;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
initializeState(context, extension) {
|
|
1856
|
+
var _a;
|
|
1857
|
+
if (this.getAttributeManager() === null) {
|
|
1858
|
+
return;
|
|
1859
|
+
}
|
|
1860
|
+
(_a = this.context.deck) == null ? void 0 : _a._addDefaultEffect(new CollisionFilterEffect());
|
|
1861
|
+
const attributeManager = this.getAttributeManager();
|
|
1862
|
+
attributeManager.add({
|
|
1863
|
+
collisionPriorities: {
|
|
1864
|
+
size: 1,
|
|
1865
|
+
accessor: "getCollisionPriority",
|
|
1866
|
+
shaderAttributes: {
|
|
1867
|
+
collisionPriorities: { divisor: 0 },
|
|
1868
|
+
instanceCollisionPriorities: { divisor: 1 }
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
getNeedsPickingBuffer() {
|
|
1874
|
+
return this.props.collisionEnabled;
|
|
1875
|
+
}
|
|
1876
|
+
};
|
|
1877
|
+
var CollisionFilterExtension = _CollisionFilterExtension;
|
|
1878
|
+
(() => {
|
|
1879
|
+
_CollisionFilterExtension.defaultProps = defaultProps6;
|
|
1880
|
+
})();
|
|
1881
|
+
(() => {
|
|
1882
|
+
_CollisionFilterExtension.extensionName = "CollisionFilterExtension";
|
|
1883
|
+
})();
|
|
1884
|
+
|
|
1885
|
+
// dist/mask/mask-extension.js
|
|
1886
|
+
var import_core21 = require("@deck.gl/core");
|
|
1887
|
+
|
|
1888
|
+
// dist/mask/shader-module.js
|
|
1889
|
+
var import_core20 = require("@deck.gl/core");
|
|
1890
|
+
var vs4 = `
|
|
1891
|
+
uniform vec4 mask_bounds;
|
|
1892
|
+
uniform bool mask_maskByInstance;
|
|
1893
|
+
vec2 mask_getCoords(vec4 position) {
|
|
1894
|
+
return (position.xy - mask_bounds.xy) / (mask_bounds.zw - mask_bounds.xy);
|
|
1895
|
+
}
|
|
1896
|
+
`;
|
|
1897
|
+
var fs3 = `
|
|
1898
|
+
uniform sampler2D mask_texture;
|
|
1899
|
+
uniform int mask_channel;
|
|
1900
|
+
uniform bool mask_enabled;
|
|
1901
|
+
uniform bool mask_inverted;
|
|
1902
|
+
bool mask_isInBounds(vec2 texCoords) {
|
|
1903
|
+
if (!mask_enabled) {
|
|
1904
|
+
return true;
|
|
1905
|
+
}
|
|
1906
|
+
vec4 maskColor = texture(mask_texture, texCoords);
|
|
1907
|
+
float maskValue = 1.0;
|
|
1908
|
+
if (mask_channel == 0) {
|
|
1909
|
+
maskValue = maskColor.r;
|
|
1910
|
+
} else if (mask_channel == 1) {
|
|
1911
|
+
maskValue = maskColor.g;
|
|
1912
|
+
} else if (mask_channel == 2) {
|
|
1913
|
+
maskValue = maskColor.b;
|
|
1914
|
+
} else if (mask_channel == 3) {
|
|
1915
|
+
maskValue = maskColor.a;
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
if (mask_inverted) {
|
|
1919
|
+
return maskValue >= 0.5;
|
|
1920
|
+
} else {
|
|
1921
|
+
return maskValue < 0.5;
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
`;
|
|
1925
|
+
var inject5 = {
|
|
1926
|
+
"vs:#decl": `
|
|
1927
|
+
out vec2 mask_texCoords;
|
|
1928
|
+
`,
|
|
1929
|
+
"vs:#main-end": `
|
|
1930
|
+
vec4 mask_common_position;
|
|
1931
|
+
if (mask_maskByInstance) {
|
|
1932
|
+
mask_common_position = project_position(vec4(geometry.worldPosition, 1.0));
|
|
1933
|
+
} else {
|
|
1934
|
+
mask_common_position = geometry.position;
|
|
1935
|
+
}
|
|
1936
|
+
mask_texCoords = mask_getCoords(mask_common_position);
|
|
1937
|
+
`,
|
|
1938
|
+
"fs:#decl": `
|
|
1939
|
+
in vec2 mask_texCoords;
|
|
1940
|
+
`,
|
|
1941
|
+
"fs:#main-start": `
|
|
1942
|
+
if (mask_enabled) {
|
|
1943
|
+
bool mask = mask_isInBounds(mask_texCoords);
|
|
1944
|
+
|
|
1945
|
+
// Debug: show extent of render target
|
|
1946
|
+
// fragColor = vec4(mask_texCoords, 0.0, 1.0);
|
|
1947
|
+
fragColor = texture(mask_texture, mask_texCoords);
|
|
1948
|
+
|
|
1949
|
+
if (!mask) discard;
|
|
1950
|
+
}
|
|
1951
|
+
`
|
|
1952
|
+
};
|
|
1953
|
+
var getMaskUniforms = (opts) => {
|
|
1954
|
+
if (opts && "maskMap" in opts) {
|
|
1955
|
+
return {
|
|
1956
|
+
mask_texture: opts.maskMap
|
|
1957
|
+
};
|
|
1958
|
+
}
|
|
1959
|
+
return {};
|
|
1960
|
+
};
|
|
1961
|
+
var shader_module_default3 = {
|
|
1962
|
+
name: "mask",
|
|
1963
|
+
dependencies: [import_core20.project],
|
|
1964
|
+
vs: vs4,
|
|
1965
|
+
fs: fs3,
|
|
1966
|
+
inject: inject5,
|
|
1967
|
+
getUniforms: getMaskUniforms
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
// dist/mask/mask-extension.js
|
|
1971
|
+
var defaultProps7 = {
|
|
1972
|
+
maskId: "",
|
|
1973
|
+
maskByInstance: void 0,
|
|
1974
|
+
maskInverted: false
|
|
1975
|
+
};
|
|
1976
|
+
var _MaskExtension = class extends import_core21.LayerExtension {
|
|
1977
|
+
initializeState() {
|
|
1978
|
+
var _a;
|
|
1979
|
+
(_a = this.context.deck) == null ? void 0 : _a._addDefaultEffect(new MaskEffect());
|
|
1980
|
+
}
|
|
1981
|
+
getShaders() {
|
|
1982
|
+
let maskByInstance = "instancePositions" in this.getAttributeManager().attributes;
|
|
1983
|
+
if (this.props.maskByInstance !== void 0) {
|
|
1984
|
+
maskByInstance = Boolean(this.props.maskByInstance);
|
|
1985
|
+
}
|
|
1986
|
+
this.state.maskByInstance = maskByInstance;
|
|
1987
|
+
return {
|
|
1988
|
+
modules: [shader_module_default3]
|
|
1989
|
+
};
|
|
1990
|
+
}
|
|
1991
|
+
draw({ uniforms, context, moduleParameters }) {
|
|
1992
|
+
uniforms.mask_maskByInstance = this.state.maskByInstance;
|
|
1993
|
+
const { maskId, maskInverted } = this.props;
|
|
1994
|
+
const { maskChannels } = moduleParameters;
|
|
1995
|
+
const { viewport } = context;
|
|
1996
|
+
if (maskChannels && maskChannels[maskId]) {
|
|
1997
|
+
const { index, bounds, coordinateOrigin: fromCoordinateOrigin } = maskChannels[maskId];
|
|
1998
|
+
let { coordinateSystem: fromCoordinateSystem } = maskChannels[maskId];
|
|
1999
|
+
uniforms.mask_enabled = true;
|
|
2000
|
+
uniforms.mask_channel = index;
|
|
2001
|
+
uniforms.mask_inverted = maskInverted;
|
|
2002
|
+
if (fromCoordinateSystem === import_core21.COORDINATE_SYSTEM.DEFAULT) {
|
|
2003
|
+
fromCoordinateSystem = viewport.isGeospatial ? import_core21.COORDINATE_SYSTEM.LNGLAT : import_core21.COORDINATE_SYSTEM.CARTESIAN;
|
|
2004
|
+
}
|
|
2005
|
+
const opts = { modelMatrix: null, fromCoordinateOrigin, fromCoordinateSystem };
|
|
2006
|
+
const bl = this.projectPosition([bounds[0], bounds[1], 0], opts);
|
|
2007
|
+
const tr = this.projectPosition([bounds[2], bounds[3], 0], opts);
|
|
2008
|
+
uniforms.mask_bounds = [bl[0], bl[1], tr[0], tr[1]];
|
|
2009
|
+
} else {
|
|
2010
|
+
if (maskId) {
|
|
2011
|
+
import_core21.log.warn(`Could not find a mask layer with id: ${maskId}`)();
|
|
2012
|
+
}
|
|
2013
|
+
uniforms.mask_enabled = false;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
};
|
|
2017
|
+
var MaskExtension = _MaskExtension;
|
|
2018
|
+
(() => {
|
|
2019
|
+
_MaskExtension.defaultProps = defaultProps7;
|
|
2020
|
+
})();
|
|
2021
|
+
(() => {
|
|
2022
|
+
_MaskExtension.extensionName = "MaskExtension";
|
|
2023
|
+
})();
|
|
2024
|
+
|
|
2025
|
+
// dist/terrain/terrain-extension.js
|
|
2026
|
+
var import_core26 = require("@deck.gl/core");
|
|
2027
|
+
|
|
2028
|
+
// dist/terrain/terrain-effect.js
|
|
2029
|
+
var import_core25 = require("@deck.gl/core");
|
|
2030
|
+
|
|
2031
|
+
// dist/terrain/shader-module.js
|
|
2032
|
+
var import_core22 = require("@deck.gl/core");
|
|
2033
|
+
var TERRAIN_MODE = {
|
|
2034
|
+
NONE: 0,
|
|
2035
|
+
WRITE_HEIGHT_MAP: 1,
|
|
2036
|
+
USE_HEIGHT_MAP: 2,
|
|
2037
|
+
USE_COVER: 3,
|
|
2038
|
+
USE_COVER_ONLY: 4,
|
|
2039
|
+
SKIP: 5
|
|
2040
|
+
};
|
|
2041
|
+
var TERRAIN_MODE_CONSTANTS = Object.keys(TERRAIN_MODE).map((key) => `const float TERRAIN_MODE_${key} = ${TERRAIN_MODE[key]}.0;`).join("\n");
|
|
2042
|
+
var terrainModule = {
|
|
2043
|
+
name: "terrain",
|
|
2044
|
+
dependencies: [import_core22.project],
|
|
2045
|
+
inject: {
|
|
2046
|
+
"vs:#decl": `
|
|
2047
|
+
uniform float terrain_mode;
|
|
2048
|
+
uniform sampler2D terrain_map;
|
|
2049
|
+
uniform vec4 terrain_bounds;
|
|
2050
|
+
out vec3 commonPos;
|
|
2051
|
+
${TERRAIN_MODE_CONSTANTS}
|
|
2052
|
+
`,
|
|
2053
|
+
"vs:#main-start": `
|
|
2054
|
+
if (terrain_mode == TERRAIN_MODE_SKIP) {
|
|
2055
|
+
gl_Position = vec4(0.0);
|
|
2056
|
+
return;
|
|
2057
|
+
}
|
|
2058
|
+
`,
|
|
2059
|
+
"vs:DECKGL_FILTER_GL_POSITION": `
|
|
2060
|
+
commonPos = geometry.position.xyz;
|
|
2061
|
+
if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
|
|
2062
|
+
vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
|
|
2063
|
+
position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);
|
|
2064
|
+
commonPos.z += project_uCommonOrigin.z;
|
|
2065
|
+
}
|
|
2066
|
+
if (terrain_mode == TERRAIN_MODE_USE_HEIGHT_MAP) {
|
|
2067
|
+
vec3 anchor = geometry.worldPosition;
|
|
2068
|
+
anchor.z = 0.0;
|
|
2069
|
+
vec3 anchorCommon = project_position(anchor);
|
|
2070
|
+
vec2 texCoords = (anchorCommon.xy - terrain_bounds.xy) / terrain_bounds.zw;
|
|
2071
|
+
if (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {
|
|
2072
|
+
float terrainZ = texture(terrain_map, texCoords).r;
|
|
2073
|
+
geometry.position.z += terrainZ;
|
|
2074
|
+
position = project_common_position_to_clipspace(geometry.position);
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
`,
|
|
2078
|
+
"fs:#decl": `
|
|
2079
|
+
uniform float terrain_mode;
|
|
2080
|
+
uniform sampler2D terrain_map;
|
|
2081
|
+
uniform vec4 terrain_bounds;
|
|
2082
|
+
in vec3 commonPos;
|
|
2083
|
+
${TERRAIN_MODE_CONSTANTS}
|
|
2084
|
+
`,
|
|
2085
|
+
"fs:#main-start": `
|
|
2086
|
+
if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
|
|
2087
|
+
fragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);
|
|
2088
|
+
return;
|
|
2089
|
+
}
|
|
2090
|
+
`,
|
|
2091
|
+
"fs:DECKGL_FILTER_COLOR": `
|
|
2092
|
+
if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY)) {
|
|
2093
|
+
vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
|
|
2094
|
+
vec4 pixel = texture(terrain_map, texCoords);
|
|
2095
|
+
if (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY) {
|
|
2096
|
+
color = pixel;
|
|
2097
|
+
} else {
|
|
2098
|
+
// pixel is premultiplied
|
|
2099
|
+
color = pixel + color * (1.0 - pixel.a);
|
|
2100
|
+
}
|
|
2101
|
+
return;
|
|
2102
|
+
}
|
|
2103
|
+
`
|
|
2104
|
+
},
|
|
2105
|
+
getUniforms: (opts = {}, uniforms) => {
|
|
2106
|
+
var _a;
|
|
2107
|
+
if ("dummyHeightMap" in opts) {
|
|
2108
|
+
const { drawToTerrainHeightMap, heightMap, heightMapBounds, dummyHeightMap, terrainCover, useTerrainHeightMap, terrainSkipRender } = opts;
|
|
2109
|
+
const { project_uCommonOrigin } = uniforms;
|
|
2110
|
+
let mode = terrainSkipRender ? TERRAIN_MODE.SKIP : TERRAIN_MODE.NONE;
|
|
2111
|
+
let sampler = dummyHeightMap;
|
|
2112
|
+
let bounds = null;
|
|
2113
|
+
if (drawToTerrainHeightMap) {
|
|
2114
|
+
mode = TERRAIN_MODE.WRITE_HEIGHT_MAP;
|
|
2115
|
+
bounds = heightMapBounds;
|
|
2116
|
+
} else if (useTerrainHeightMap && heightMap) {
|
|
2117
|
+
mode = TERRAIN_MODE.USE_HEIGHT_MAP;
|
|
2118
|
+
sampler = heightMap;
|
|
2119
|
+
bounds = heightMapBounds;
|
|
2120
|
+
} else if (terrainCover) {
|
|
2121
|
+
const isPicking = (_a = opts.picking) == null ? void 0 : _a.isActive;
|
|
2122
|
+
sampler = isPicking ? terrainCover.getPickingFramebuffer() : terrainCover.getRenderFramebuffer();
|
|
2123
|
+
if (isPicking) {
|
|
2124
|
+
mode = TERRAIN_MODE.SKIP;
|
|
2125
|
+
}
|
|
2126
|
+
if (sampler) {
|
|
2127
|
+
mode = mode === TERRAIN_MODE.SKIP ? TERRAIN_MODE.USE_COVER_ONLY : TERRAIN_MODE.USE_COVER;
|
|
2128
|
+
bounds = terrainCover.bounds;
|
|
2129
|
+
} else {
|
|
2130
|
+
sampler = dummyHeightMap;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
return {
|
|
2134
|
+
terrain_mode: mode,
|
|
2135
|
+
terrain_map: sampler,
|
|
2136
|
+
terrain_bounds: bounds ? [
|
|
2137
|
+
bounds[0] - project_uCommonOrigin[0],
|
|
2138
|
+
bounds[1] - project_uCommonOrigin[1],
|
|
2139
|
+
bounds[2] - bounds[0],
|
|
2140
|
+
bounds[3] - bounds[1]
|
|
2141
|
+
] : [0, 0, 0, 0]
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
return null;
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2147
|
+
|
|
2148
|
+
// dist/terrain/utils.js
|
|
2149
|
+
var import_constants4 = require("@luma.gl/constants");
|
|
2150
|
+
function createRenderTarget(device, opts) {
|
|
2151
|
+
return device.createFramebuffer({
|
|
2152
|
+
id: opts.id,
|
|
2153
|
+
colorAttachments: [
|
|
2154
|
+
device.createTexture({
|
|
2155
|
+
...opts.float && {
|
|
2156
|
+
format: device.info.type === "webgl2" ? "rgba32float" : "rgba8unorm",
|
|
2157
|
+
type: import_constants4.GL.FLOAT
|
|
2158
|
+
},
|
|
2159
|
+
mipmaps: false,
|
|
2160
|
+
sampler: {
|
|
2161
|
+
minFilter: "linear",
|
|
2162
|
+
magFilter: "linear",
|
|
2163
|
+
addressModeU: "clamp-to-edge",
|
|
2164
|
+
addressModeV: "clamp-to-edge"
|
|
2165
|
+
}
|
|
2166
|
+
})
|
|
2167
|
+
]
|
|
2168
|
+
});
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
// dist/terrain/terrain-cover.js
|
|
2172
|
+
var TerrainCover = class {
|
|
2173
|
+
constructor(targetLayer) {
|
|
2174
|
+
this.isDirty = true;
|
|
2175
|
+
this.renderViewport = null;
|
|
2176
|
+
this.bounds = null;
|
|
2177
|
+
this.layers = [];
|
|
2178
|
+
this.targetBounds = null;
|
|
2179
|
+
this.targetBoundsCommon = null;
|
|
2180
|
+
this.targetLayer = targetLayer;
|
|
2181
|
+
this.tile = getTile(targetLayer);
|
|
2182
|
+
}
|
|
2183
|
+
get id() {
|
|
2184
|
+
return this.targetLayer.id;
|
|
2185
|
+
}
|
|
2186
|
+
get isActive() {
|
|
2187
|
+
return Boolean(this.targetLayer.getCurrentLayer());
|
|
2188
|
+
}
|
|
2189
|
+
shouldUpdate({ targetLayer, viewport, layers, layerNeedsRedraw }) {
|
|
2190
|
+
if (targetLayer) {
|
|
2191
|
+
this.targetLayer = targetLayer;
|
|
2192
|
+
}
|
|
2193
|
+
const sizeChanged = viewport ? this._updateViewport(viewport) : false;
|
|
2194
|
+
let layersChanged = layers ? this._updateLayers(layers) : false;
|
|
2195
|
+
if (layerNeedsRedraw) {
|
|
2196
|
+
for (const id of this.layers) {
|
|
2197
|
+
if (layerNeedsRedraw[id]) {
|
|
2198
|
+
layersChanged = true;
|
|
2199
|
+
break;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
return layersChanged || sizeChanged;
|
|
2204
|
+
}
|
|
2205
|
+
_updateLayers(layers) {
|
|
2206
|
+
let needsRedraw = false;
|
|
2207
|
+
layers = this.tile ? getIntersectingLayers(this.tile, layers) : layers;
|
|
2208
|
+
if (layers.length !== this.layers.length) {
|
|
2209
|
+
needsRedraw = true;
|
|
2210
|
+
} else {
|
|
2211
|
+
for (let i = 0; i < layers.length; i++) {
|
|
2212
|
+
const id = layers[i].id;
|
|
2213
|
+
if (id !== this.layers[i]) {
|
|
2214
|
+
needsRedraw = true;
|
|
2215
|
+
break;
|
|
2216
|
+
}
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
if (needsRedraw) {
|
|
2220
|
+
this.layers = layers.map((layer) => layer.id);
|
|
2221
|
+
}
|
|
2222
|
+
return needsRedraw;
|
|
2223
|
+
}
|
|
2224
|
+
_updateViewport(viewport) {
|
|
2225
|
+
var _a;
|
|
2226
|
+
const targetLayer = this.targetLayer;
|
|
2227
|
+
let shouldRedraw = false;
|
|
2228
|
+
if (this.tile && "boundingBox" in this.tile) {
|
|
2229
|
+
if (!this.targetBounds) {
|
|
2230
|
+
shouldRedraw = true;
|
|
2231
|
+
this.targetBounds = this.tile.boundingBox;
|
|
2232
|
+
const bottomLeftCommon = viewport.projectPosition(this.targetBounds[0]);
|
|
2233
|
+
const topRightCommon = viewport.projectPosition(this.targetBounds[1]);
|
|
2234
|
+
this.targetBoundsCommon = [
|
|
2235
|
+
bottomLeftCommon[0],
|
|
2236
|
+
bottomLeftCommon[1],
|
|
2237
|
+
topRightCommon[0],
|
|
2238
|
+
topRightCommon[1]
|
|
2239
|
+
];
|
|
2240
|
+
}
|
|
2241
|
+
} else if (this.targetBounds !== targetLayer.getBounds()) {
|
|
2242
|
+
shouldRedraw = true;
|
|
2243
|
+
this.targetBounds = targetLayer.getBounds();
|
|
2244
|
+
this.targetBoundsCommon = joinLayerBounds([targetLayer], viewport);
|
|
2245
|
+
}
|
|
2246
|
+
if (!this.targetBoundsCommon) {
|
|
2247
|
+
return false;
|
|
2248
|
+
}
|
|
2249
|
+
const newZoom = Math.ceil(viewport.zoom + 0.5);
|
|
2250
|
+
if (this.tile) {
|
|
2251
|
+
this.bounds = this.targetBoundsCommon;
|
|
2252
|
+
} else {
|
|
2253
|
+
const oldZoom = (_a = this.renderViewport) == null ? void 0 : _a.zoom;
|
|
2254
|
+
shouldRedraw = shouldRedraw || newZoom !== oldZoom;
|
|
2255
|
+
const newBounds = getRenderBounds(this.targetBoundsCommon, viewport);
|
|
2256
|
+
const oldBounds = this.bounds;
|
|
2257
|
+
shouldRedraw = shouldRedraw || !oldBounds || newBounds.some((x, i) => x !== oldBounds[i]);
|
|
2258
|
+
this.bounds = newBounds;
|
|
2259
|
+
}
|
|
2260
|
+
if (shouldRedraw) {
|
|
2261
|
+
this.renderViewport = makeViewport({
|
|
2262
|
+
bounds: this.bounds,
|
|
2263
|
+
zoom: newZoom,
|
|
2264
|
+
viewport
|
|
2265
|
+
});
|
|
2266
|
+
}
|
|
2267
|
+
return shouldRedraw;
|
|
2268
|
+
}
|
|
2269
|
+
getRenderFramebuffer() {
|
|
2270
|
+
if (!this.renderViewport || this.layers.length === 0) {
|
|
2271
|
+
return null;
|
|
2272
|
+
}
|
|
2273
|
+
if (!this.fbo) {
|
|
2274
|
+
this.fbo = createRenderTarget(this.targetLayer.context.device, { id: this.id });
|
|
2275
|
+
}
|
|
2276
|
+
return this.fbo;
|
|
2277
|
+
}
|
|
2278
|
+
getPickingFramebuffer() {
|
|
2279
|
+
if (!this.renderViewport || this.layers.length === 0 && !this.targetLayer.props.pickable) {
|
|
2280
|
+
return null;
|
|
2281
|
+
}
|
|
2282
|
+
if (!this.pickingFbo) {
|
|
2283
|
+
this.pickingFbo = createRenderTarget(this.targetLayer.context.device, {
|
|
2284
|
+
id: `${this.id}-picking`
|
|
2285
|
+
});
|
|
2286
|
+
}
|
|
2287
|
+
return this.pickingFbo;
|
|
2288
|
+
}
|
|
2289
|
+
filterLayers(layers) {
|
|
2290
|
+
return layers.filter(({ id }) => this.layers.includes(id));
|
|
2291
|
+
}
|
|
2292
|
+
delete() {
|
|
2293
|
+
const { fbo, pickingFbo } = this;
|
|
2294
|
+
if (fbo) {
|
|
2295
|
+
fbo.colorAttachments[0].destroy();
|
|
2296
|
+
fbo.destroy();
|
|
2297
|
+
}
|
|
2298
|
+
if (pickingFbo) {
|
|
2299
|
+
pickingFbo.colorAttachments[0].destroy();
|
|
2300
|
+
pickingFbo.destroy();
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
};
|
|
2304
|
+
function getIntersectingLayers(sourceTile, layers) {
|
|
2305
|
+
return layers.filter((layer) => {
|
|
2306
|
+
const tile = getTile(layer);
|
|
2307
|
+
if (tile) {
|
|
2308
|
+
return intersect(sourceTile.boundingBox, tile.boundingBox);
|
|
2309
|
+
}
|
|
2310
|
+
return true;
|
|
2311
|
+
});
|
|
2312
|
+
}
|
|
2313
|
+
function getTile(layer) {
|
|
2314
|
+
while (layer) {
|
|
2315
|
+
const { tile } = layer.props;
|
|
2316
|
+
if (tile) {
|
|
2317
|
+
return tile;
|
|
2318
|
+
}
|
|
2319
|
+
layer = layer.parent;
|
|
2320
|
+
}
|
|
2321
|
+
return null;
|
|
2322
|
+
}
|
|
2323
|
+
function intersect(b1, b2) {
|
|
2324
|
+
if (b1 && b2) {
|
|
2325
|
+
return b1[0][0] < b2[1][0] && b2[0][0] < b1[1][0] && b1[0][1] < b2[1][1] && b2[0][1] < b1[1][1];
|
|
2326
|
+
}
|
|
2327
|
+
return false;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
// dist/terrain/terrain-pass.js
|
|
2331
|
+
var import_constants5 = require("@luma.gl/constants");
|
|
2332
|
+
var import_core23 = require("@deck.gl/core");
|
|
2333
|
+
var TerrainPass = class extends import_core23._LayersPass {
|
|
2334
|
+
getRenderableLayers(viewport, opts) {
|
|
2335
|
+
const { layers } = opts;
|
|
2336
|
+
const result = [];
|
|
2337
|
+
const drawParamsByIndex = this._getDrawLayerParams(viewport, opts, true);
|
|
2338
|
+
for (let i = 0; i < layers.length; i++) {
|
|
2339
|
+
const layer = layers[i];
|
|
2340
|
+
if (!layer.isComposite && drawParamsByIndex[i].shouldDrawLayer) {
|
|
2341
|
+
result.push(layer);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
return result;
|
|
2345
|
+
}
|
|
2346
|
+
renderHeightMap(heightMap, opts) {
|
|
2347
|
+
const target = heightMap.getRenderFramebuffer();
|
|
2348
|
+
const viewport = heightMap.renderViewport;
|
|
2349
|
+
if (!target || !viewport) {
|
|
2350
|
+
return;
|
|
2351
|
+
}
|
|
2352
|
+
target.resize(viewport);
|
|
2353
|
+
this.device.withParametersWebGL({
|
|
2354
|
+
clearColor: [0, 0, 0, 0],
|
|
2355
|
+
blend: true,
|
|
2356
|
+
blendFunc: [import_constants5.GL.ONE, import_constants5.GL.ONE],
|
|
2357
|
+
blendEquation: import_constants5.GL.MAX,
|
|
2358
|
+
depthTest: false
|
|
2359
|
+
}, () => this.render({
|
|
2360
|
+
...opts,
|
|
2361
|
+
target,
|
|
2362
|
+
pass: "terrain-height-map",
|
|
2363
|
+
layers: opts.layers,
|
|
2364
|
+
viewports: [viewport],
|
|
2365
|
+
effects: []
|
|
2366
|
+
}));
|
|
2367
|
+
}
|
|
2368
|
+
renderTerrainCover(terrainCover, opts) {
|
|
2369
|
+
const target = terrainCover.getRenderFramebuffer();
|
|
2370
|
+
const viewport = terrainCover.renderViewport;
|
|
2371
|
+
if (!target || !viewport) {
|
|
2372
|
+
return;
|
|
2373
|
+
}
|
|
2374
|
+
const layers = terrainCover.filterLayers(opts.layers);
|
|
2375
|
+
target.resize(viewport);
|
|
2376
|
+
this.device.withParametersWebGL({
|
|
2377
|
+
clearColor: [0, 0, 0, 0],
|
|
2378
|
+
depthTest: false
|
|
2379
|
+
}, () => this.render({
|
|
2380
|
+
...opts,
|
|
2381
|
+
target,
|
|
2382
|
+
pass: `terrain-cover-${terrainCover.id}`,
|
|
2383
|
+
layers,
|
|
2384
|
+
effects: [],
|
|
2385
|
+
viewports: [viewport]
|
|
2386
|
+
}));
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
|
|
2390
|
+
// dist/terrain/terrain-picking-pass.js
|
|
2391
|
+
var import_core24 = require("@deck.gl/core");
|
|
2392
|
+
var TerrainPickingPass = class extends import_core24._PickLayersPass {
|
|
2393
|
+
constructor() {
|
|
2394
|
+
super(...arguments);
|
|
2395
|
+
this.drawParameters = {};
|
|
2396
|
+
}
|
|
2397
|
+
getRenderableLayers(viewport, opts) {
|
|
2398
|
+
const { layers } = opts;
|
|
2399
|
+
const result = [];
|
|
2400
|
+
this.drawParameters = {};
|
|
2401
|
+
this._resetColorEncoder(opts.pickZ);
|
|
2402
|
+
const drawParamsByIndex = this._getDrawLayerParams(viewport, opts);
|
|
2403
|
+
for (let i = 0; i < layers.length; i++) {
|
|
2404
|
+
const layer = layers[i];
|
|
2405
|
+
if (!layer.isComposite && drawParamsByIndex[i].shouldDrawLayer) {
|
|
2406
|
+
result.push(layer);
|
|
2407
|
+
this.drawParameters[layer.id] = drawParamsByIndex[i].layerParameters;
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
return result;
|
|
2411
|
+
}
|
|
2412
|
+
renderTerrainCover(terrainCover, opts) {
|
|
2413
|
+
const target = terrainCover.getPickingFramebuffer();
|
|
2414
|
+
const viewport = terrainCover.renderViewport;
|
|
2415
|
+
if (!target || !viewport) {
|
|
2416
|
+
return;
|
|
2417
|
+
}
|
|
2418
|
+
const layers = terrainCover.filterLayers(opts.layers);
|
|
2419
|
+
const terrainLayer = terrainCover.targetLayer;
|
|
2420
|
+
if (terrainLayer.props.pickable) {
|
|
2421
|
+
layers.unshift(terrainLayer);
|
|
2422
|
+
}
|
|
2423
|
+
target.resize(viewport);
|
|
2424
|
+
this.device.withParametersWebGL({
|
|
2425
|
+
depthTest: false
|
|
2426
|
+
}, () => this.render({
|
|
2427
|
+
...opts,
|
|
2428
|
+
pickingFBO: target,
|
|
2429
|
+
pass: `terrain-cover-picking-${terrainCover.id}`,
|
|
2430
|
+
layers,
|
|
2431
|
+
effects: [],
|
|
2432
|
+
viewports: [viewport],
|
|
2433
|
+
cullRect: void 0,
|
|
2434
|
+
deviceRect: viewport,
|
|
2435
|
+
pickZ: false
|
|
2436
|
+
}));
|
|
2437
|
+
}
|
|
2438
|
+
getLayerParameters(layer, layerIndex, viewport) {
|
|
2439
|
+
if (this.drawParameters[layer.id]) {
|
|
2440
|
+
return this.drawParameters[layer.id];
|
|
2441
|
+
}
|
|
2442
|
+
const parameters2 = super.getLayerParameters(layer, layerIndex, viewport);
|
|
2443
|
+
parameters2.blend = true;
|
|
2444
|
+
return parameters2;
|
|
2445
|
+
}
|
|
2446
|
+
};
|
|
2447
|
+
|
|
2448
|
+
// dist/terrain/height-map-builder.js
|
|
2449
|
+
var MAP_MAX_SIZE = 2048;
|
|
2450
|
+
var HeightMapBuilder = class {
|
|
2451
|
+
static isSupported(device) {
|
|
2452
|
+
return device.isTextureFormatRenderable("rgba32float");
|
|
2453
|
+
}
|
|
2454
|
+
constructor(device) {
|
|
2455
|
+
this.renderViewport = null;
|
|
2456
|
+
this.bounds = null;
|
|
2457
|
+
this.layers = [];
|
|
2458
|
+
this.layersBounds = [];
|
|
2459
|
+
this.layersBoundsCommon = null;
|
|
2460
|
+
this.lastViewport = null;
|
|
2461
|
+
this.device = device;
|
|
2462
|
+
}
|
|
2463
|
+
getRenderFramebuffer() {
|
|
2464
|
+
if (!this.renderViewport) {
|
|
2465
|
+
return null;
|
|
2466
|
+
}
|
|
2467
|
+
if (!this.fbo) {
|
|
2468
|
+
this.fbo = createRenderTarget(this.device, { id: "height-map", float: true });
|
|
2469
|
+
}
|
|
2470
|
+
return this.fbo;
|
|
2471
|
+
}
|
|
2472
|
+
shouldUpdate({ layers, viewport }) {
|
|
2473
|
+
const layersChanged = layers.length !== this.layers.length || layers.some((layer, i) => layer !== this.layers[i] || layer.props.transitions || layer.getBounds() !== this.layersBounds[i]);
|
|
2474
|
+
if (layersChanged) {
|
|
2475
|
+
this.layers = layers;
|
|
2476
|
+
this.layersBounds = layers.map((layer) => layer.getBounds());
|
|
2477
|
+
this.layersBoundsCommon = joinLayerBounds(layers, viewport);
|
|
2478
|
+
}
|
|
2479
|
+
const viewportChanged = !this.lastViewport || !viewport.equals(this.lastViewport);
|
|
2480
|
+
if (!this.layersBoundsCommon) {
|
|
2481
|
+
this.renderViewport = null;
|
|
2482
|
+
} else if (layersChanged || viewportChanged) {
|
|
2483
|
+
const bounds = getRenderBounds(this.layersBoundsCommon, viewport);
|
|
2484
|
+
if (bounds[2] <= bounds[0] || bounds[3] <= bounds[1]) {
|
|
2485
|
+
this.renderViewport = null;
|
|
2486
|
+
return false;
|
|
2487
|
+
}
|
|
2488
|
+
this.bounds = bounds;
|
|
2489
|
+
this.lastViewport = viewport;
|
|
2490
|
+
const scale = viewport.scale;
|
|
2491
|
+
const pixelWidth = (bounds[2] - bounds[0]) * scale;
|
|
2492
|
+
const pixelHeight = (bounds[3] - bounds[1]) * scale;
|
|
2493
|
+
this.renderViewport = pixelWidth > 0 || pixelHeight > 0 ? makeViewport({
|
|
2494
|
+
bounds: [
|
|
2495
|
+
viewport.center[0] - 1,
|
|
2496
|
+
viewport.center[1] - 1,
|
|
2497
|
+
viewport.center[0] + 1,
|
|
2498
|
+
viewport.center[1] + 1
|
|
2499
|
+
],
|
|
2500
|
+
zoom: viewport.zoom,
|
|
2501
|
+
width: Math.min(pixelWidth, MAP_MAX_SIZE),
|
|
2502
|
+
height: Math.min(pixelHeight, MAP_MAX_SIZE),
|
|
2503
|
+
viewport
|
|
2504
|
+
}) : null;
|
|
2505
|
+
return true;
|
|
2506
|
+
}
|
|
2507
|
+
return false;
|
|
2508
|
+
}
|
|
2509
|
+
delete() {
|
|
2510
|
+
if (this.fbo) {
|
|
2511
|
+
this.fbo.colorAttachments[0].delete();
|
|
2512
|
+
this.fbo.delete();
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
};
|
|
2516
|
+
|
|
2517
|
+
// dist/terrain/terrain-effect.js
|
|
2518
|
+
var TerrainEffect = class {
|
|
2519
|
+
constructor() {
|
|
2520
|
+
this.id = "terrain-effect";
|
|
2521
|
+
this.props = null;
|
|
2522
|
+
this.useInPicking = true;
|
|
2523
|
+
this.isPicking = false;
|
|
2524
|
+
this.isDrapingEnabled = false;
|
|
2525
|
+
this.terrainCovers = /* @__PURE__ */ new Map();
|
|
2526
|
+
}
|
|
2527
|
+
initialize(device) {
|
|
2528
|
+
this.dummyHeightMap = device.createTexture({
|
|
2529
|
+
width: 1,
|
|
2530
|
+
height: 1,
|
|
2531
|
+
data: new Uint8Array([0, 0, 0, 0])
|
|
2532
|
+
});
|
|
2533
|
+
this.terrainPass = new TerrainPass(device, { id: "terrain" });
|
|
2534
|
+
this.terrainPickingPass = new TerrainPickingPass(device, { id: "terrain-picking" });
|
|
2535
|
+
if (HeightMapBuilder.isSupported(device)) {
|
|
2536
|
+
this.heightMap = new HeightMapBuilder(device);
|
|
2537
|
+
} else {
|
|
2538
|
+
import_core25.log.warn("Terrain offset mode is not supported by this browser")();
|
|
2539
|
+
}
|
|
2540
|
+
(0, import_core25.getShaderAssembler)().addDefaultModule(terrainModule);
|
|
2541
|
+
}
|
|
2542
|
+
preRender(device, opts) {
|
|
2543
|
+
if (!this.dummyHeightMap) {
|
|
2544
|
+
this.initialize(device);
|
|
2545
|
+
for (const layer of opts.layers) {
|
|
2546
|
+
if (layer.props.operation.includes("terrain")) {
|
|
2547
|
+
layer.setChangeFlags({ extensionsChanged: true });
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
if (opts.pickZ) {
|
|
2552
|
+
this.isDrapingEnabled = false;
|
|
2553
|
+
return;
|
|
2554
|
+
}
|
|
2555
|
+
const { viewports } = opts;
|
|
2556
|
+
const isPicking = opts.pass.startsWith("picking");
|
|
2557
|
+
this.isPicking = isPicking;
|
|
2558
|
+
this.isDrapingEnabled = true;
|
|
2559
|
+
const viewport = viewports[0];
|
|
2560
|
+
const layers = (isPicking ? this.terrainPickingPass : this.terrainPass).getRenderableLayers(viewport, opts);
|
|
2561
|
+
const terrainLayers = layers.filter((l) => l.props.operation.includes("terrain"));
|
|
2562
|
+
if (terrainLayers.length === 0) {
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
if (!isPicking) {
|
|
2566
|
+
const offsetLayers = layers.filter((l) => l.state.terrainDrawMode === "offset");
|
|
2567
|
+
if (offsetLayers.length > 0) {
|
|
2568
|
+
this._updateHeightMap(terrainLayers, viewport, opts);
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
const drapeLayers = layers.filter((l) => l.state.terrainDrawMode === "drape");
|
|
2572
|
+
this._updateTerrainCovers(terrainLayers, drapeLayers, viewport, opts);
|
|
2573
|
+
}
|
|
2574
|
+
getModuleParameters(layer) {
|
|
2575
|
+
var _a, _b;
|
|
2576
|
+
const { terrainDrawMode } = layer.state;
|
|
2577
|
+
return {
|
|
2578
|
+
heightMap: (_a = this.heightMap) == null ? void 0 : _a.getRenderFramebuffer(),
|
|
2579
|
+
heightMapBounds: (_b = this.heightMap) == null ? void 0 : _b.bounds,
|
|
2580
|
+
dummyHeightMap: this.dummyHeightMap,
|
|
2581
|
+
terrainCover: this.isDrapingEnabled ? this.terrainCovers.get(layer.id) : null,
|
|
2582
|
+
useTerrainHeightMap: terrainDrawMode === "offset",
|
|
2583
|
+
terrainSkipRender: terrainDrawMode === "drape" || !layer.props.operation.includes("draw")
|
|
2584
|
+
};
|
|
2585
|
+
}
|
|
2586
|
+
cleanup() {
|
|
2587
|
+
if (this.dummyHeightMap) {
|
|
2588
|
+
this.dummyHeightMap.delete();
|
|
2589
|
+
this.dummyHeightMap = void 0;
|
|
2590
|
+
}
|
|
2591
|
+
if (this.heightMap) {
|
|
2592
|
+
this.heightMap.delete();
|
|
2593
|
+
this.heightMap = void 0;
|
|
2594
|
+
}
|
|
2595
|
+
for (const terrainCover of this.terrainCovers.values()) {
|
|
2596
|
+
terrainCover.delete();
|
|
2597
|
+
}
|
|
2598
|
+
this.terrainCovers.clear();
|
|
2599
|
+
}
|
|
2600
|
+
_updateHeightMap(terrainLayers, viewport, opts) {
|
|
2601
|
+
if (!this.heightMap) {
|
|
2602
|
+
return;
|
|
2603
|
+
}
|
|
2604
|
+
const shouldUpdate = this.heightMap.shouldUpdate({ layers: terrainLayers, viewport });
|
|
2605
|
+
if (!shouldUpdate) {
|
|
2606
|
+
return;
|
|
2607
|
+
}
|
|
2608
|
+
this.terrainPass.renderHeightMap(this.heightMap, {
|
|
2609
|
+
...opts,
|
|
2610
|
+
layers: terrainLayers,
|
|
2611
|
+
moduleParameters: {
|
|
2612
|
+
heightMapBounds: this.heightMap.bounds,
|
|
2613
|
+
dummyHeightMap: this.dummyHeightMap,
|
|
2614
|
+
devicePixelRatio: 1,
|
|
2615
|
+
drawToTerrainHeightMap: true
|
|
2616
|
+
}
|
|
2617
|
+
});
|
|
2618
|
+
}
|
|
2619
|
+
_updateTerrainCovers(terrainLayers, drapeLayers, viewport, opts) {
|
|
2620
|
+
const layerNeedsRedraw = {};
|
|
2621
|
+
for (const layer of drapeLayers) {
|
|
2622
|
+
if (layer.state.terrainCoverNeedsRedraw) {
|
|
2623
|
+
layerNeedsRedraw[layer.id] = true;
|
|
2624
|
+
layer.state.terrainCoverNeedsRedraw = false;
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
for (const terrainCover of this.terrainCovers.values()) {
|
|
2628
|
+
terrainCover.isDirty = terrainCover.isDirty || terrainCover.shouldUpdate({ layerNeedsRedraw });
|
|
2629
|
+
}
|
|
2630
|
+
for (const layer of terrainLayers) {
|
|
2631
|
+
this._updateTerrainCover(layer, drapeLayers, viewport, opts);
|
|
2632
|
+
}
|
|
2633
|
+
if (!this.isPicking) {
|
|
2634
|
+
this._pruneTerrainCovers();
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
_updateTerrainCover(terrainLayer, drapeLayers, viewport, opts) {
|
|
2638
|
+
const renderPass = this.isPicking ? this.terrainPickingPass : this.terrainPass;
|
|
2639
|
+
let terrainCover = this.terrainCovers.get(terrainLayer.id);
|
|
2640
|
+
if (!terrainCover) {
|
|
2641
|
+
terrainCover = new TerrainCover(terrainLayer);
|
|
2642
|
+
this.terrainCovers.set(terrainLayer.id, terrainCover);
|
|
2643
|
+
}
|
|
2644
|
+
try {
|
|
2645
|
+
const isDirty = terrainCover.shouldUpdate({
|
|
2646
|
+
targetLayer: terrainLayer,
|
|
2647
|
+
viewport,
|
|
2648
|
+
layers: drapeLayers
|
|
2649
|
+
});
|
|
2650
|
+
if (this.isPicking || terrainCover.isDirty || isDirty) {
|
|
2651
|
+
renderPass.renderTerrainCover(terrainCover, {
|
|
2652
|
+
...opts,
|
|
2653
|
+
layers: drapeLayers,
|
|
2654
|
+
moduleParameters: {
|
|
2655
|
+
dummyHeightMap: this.dummyHeightMap,
|
|
2656
|
+
terrainSkipRender: false,
|
|
2657
|
+
devicePixelRatio: 1
|
|
2658
|
+
}
|
|
2659
|
+
});
|
|
2660
|
+
if (!this.isPicking) {
|
|
2661
|
+
terrainCover.isDirty = false;
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
} catch (err) {
|
|
2665
|
+
terrainLayer.raiseError(err, `Error rendering terrain cover ${terrainCover.id}`);
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
_pruneTerrainCovers() {
|
|
2669
|
+
const idsToRemove = [];
|
|
2670
|
+
for (const [id, terrainCover] of this.terrainCovers) {
|
|
2671
|
+
if (!terrainCover.isActive) {
|
|
2672
|
+
idsToRemove.push(id);
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
for (const id of idsToRemove) {
|
|
2676
|
+
this.terrainCovers.delete(id);
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
};
|
|
2680
|
+
|
|
2681
|
+
// dist/terrain/terrain-extension.js
|
|
2682
|
+
var defaultProps8 = {
|
|
2683
|
+
terrainDrawMode: void 0
|
|
2684
|
+
};
|
|
2685
|
+
var _TerrainExtension = class extends import_core26.LayerExtension {
|
|
2686
|
+
getShaders() {
|
|
2687
|
+
return {
|
|
2688
|
+
modules: [terrainModule]
|
|
2689
|
+
};
|
|
2690
|
+
}
|
|
2691
|
+
initializeState() {
|
|
2692
|
+
var _a;
|
|
2693
|
+
(_a = this.context.deck) == null ? void 0 : _a._addDefaultEffect(new TerrainEffect());
|
|
2694
|
+
}
|
|
2695
|
+
updateState(params) {
|
|
2696
|
+
var _a;
|
|
2697
|
+
const { props, oldProps } = params;
|
|
2698
|
+
if (this.state.terrainDrawMode && props.terrainDrawMode === oldProps.terrainDrawMode && props.extruded === oldProps.extruded) {
|
|
2699
|
+
return;
|
|
2700
|
+
}
|
|
2701
|
+
let { terrainDrawMode } = props;
|
|
2702
|
+
if (!terrainDrawMode) {
|
|
2703
|
+
const is3d = this.props.extruded;
|
|
2704
|
+
const attributes = (_a = this.getAttributeManager()) == null ? void 0 : _a.attributes;
|
|
2705
|
+
const hasAnchor = attributes && "instancePositions" in attributes;
|
|
2706
|
+
terrainDrawMode = is3d || hasAnchor ? "offset" : "drape";
|
|
2707
|
+
}
|
|
2708
|
+
this.setState({ terrainDrawMode });
|
|
2709
|
+
}
|
|
2710
|
+
onNeedsRedraw() {
|
|
2711
|
+
const state = this.state;
|
|
2712
|
+
if (state.terrainDrawMode === "drape") {
|
|
2713
|
+
state.terrainCoverNeedsRedraw = true;
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
};
|
|
2717
|
+
var TerrainExtension = _TerrainExtension;
|
|
2718
|
+
(() => {
|
|
2719
|
+
_TerrainExtension.defaultProps = defaultProps8;
|
|
2720
|
+
})();
|
|
2721
|
+
(() => {
|
|
2722
|
+
_TerrainExtension.extensionName = "TerrainExtension";
|
|
2723
|
+
})();
|
|
2724
|
+
//# sourceMappingURL=index.cjs.map
|