@antv/l7-renderer 2.9.27-alpha.2 → 2.9.27-alpha.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/es/regl/ReglModel.js +34 -20
- package/lib/regl/ReglModel.js +29 -21
- package/package.json +5 -5
package/es/regl/ReglModel.js
CHANGED
|
@@ -19,7 +19,9 @@ var ReglModel = /*#__PURE__*/function () {
|
|
|
19
19
|
_defineProperty(this, "uniforms", {});
|
|
20
20
|
|
|
21
21
|
this.reGl = reGl;
|
|
22
|
-
var
|
|
22
|
+
var _options$pick = options.pick,
|
|
23
|
+
pick = _options$pick === void 0 ? true : _options$pick,
|
|
24
|
+
vs = options.vs,
|
|
23
25
|
fs = options.fs,
|
|
24
26
|
attributes = options.attributes,
|
|
25
27
|
uniforms = options.uniforms,
|
|
@@ -82,11 +84,15 @@ var ReglModel = /*#__PURE__*/function () {
|
|
|
82
84
|
cull: cull
|
|
83
85
|
}, drawParams);
|
|
84
86
|
this.drawCommand = reGl(drawParams);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
|
|
88
|
+
if (pick) {
|
|
89
|
+
var pickDrawParams = cloneDeep(drawParams);
|
|
90
|
+
pickDrawParams.blend = _objectSpread(_objectSpread({}, pickDrawParams.blend), {}, {
|
|
91
|
+
enable: false
|
|
92
|
+
});
|
|
93
|
+
this.drawPickCommand = reGl(pickDrawParams);
|
|
94
|
+
}
|
|
95
|
+
|
|
90
96
|
this.drawParams = drawParams;
|
|
91
97
|
}
|
|
92
98
|
|
|
@@ -100,11 +106,14 @@ var ReglModel = /*#__PURE__*/function () {
|
|
|
100
106
|
this.drawParams.attributes = reglAttributes;
|
|
101
107
|
this.drawParams.elements = elements.get();
|
|
102
108
|
this.drawCommand = this.reGl(this.drawParams);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
|
|
110
|
+
if (this.options.pick) {
|
|
111
|
+
var pickDrawParams = cloneDeep(this.drawParams);
|
|
112
|
+
pickDrawParams.blend = _objectSpread(_objectSpread({}, pickDrawParams.blend), {}, {
|
|
113
|
+
enable: false
|
|
114
|
+
});
|
|
115
|
+
this.drawPickCommand = this.reGl(pickDrawParams);
|
|
116
|
+
}
|
|
108
117
|
}
|
|
109
118
|
}, {
|
|
110
119
|
key: "updateAttributes",
|
|
@@ -115,11 +124,14 @@ var ReglModel = /*#__PURE__*/function () {
|
|
|
115
124
|
});
|
|
116
125
|
this.drawParams.attributes = reglAttributes;
|
|
117
126
|
this.drawCommand = this.reGl(this.drawParams);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
|
|
128
|
+
if (this.options.pick) {
|
|
129
|
+
var pickDrawParams = cloneDeep(this.drawParams);
|
|
130
|
+
pickDrawParams.blend = _objectSpread(_objectSpread({}, pickDrawParams.blend), {}, {
|
|
131
|
+
enable: false
|
|
132
|
+
});
|
|
133
|
+
this.drawPickCommand = this.reGl(pickDrawParams);
|
|
134
|
+
}
|
|
123
135
|
}
|
|
124
136
|
}, {
|
|
125
137
|
key: "addUniforms",
|
|
@@ -146,12 +158,12 @@ var ReglModel = /*#__PURE__*/function () {
|
|
|
146
158
|
} else {
|
|
147
159
|
reglDrawProps[uniformName] = uniforms[uniformName].get();
|
|
148
160
|
}
|
|
149
|
-
}); //
|
|
161
|
+
}); // 在进行拾取操作的绘制中,不应该使用叠加模式 - picking 根据拾取的颜色作为判断的输入,而叠加模式会产生新的,在 id 序列中不存在的颜色
|
|
150
162
|
|
|
151
163
|
if (!pick) {
|
|
152
164
|
this.drawCommand(reglDrawProps);
|
|
153
165
|
} else {
|
|
154
|
-
this.drawPickCommand(reglDrawProps);
|
|
166
|
+
this.drawPickCommand && this.drawPickCommand(reglDrawProps);
|
|
155
167
|
} // this.drawCommand(reglDrawProps);
|
|
156
168
|
// this.drawPickCommand(reglDrawProps);
|
|
157
169
|
|
|
@@ -159,13 +171,15 @@ var ReglModel = /*#__PURE__*/function () {
|
|
|
159
171
|
}, {
|
|
160
172
|
key: "destroy",
|
|
161
173
|
value: function destroy() {
|
|
174
|
+
var _this$drawParams, _this$drawParams$elem;
|
|
175
|
+
|
|
162
176
|
// @ts-ignore
|
|
163
|
-
this.drawParams.elements.destroy();
|
|
177
|
+
(_this$drawParams = this.drawParams) === null || _this$drawParams === void 0 ? void 0 : (_this$drawParams$elem = _this$drawParams.elements) === null || _this$drawParams$elem === void 0 ? void 0 : _this$drawParams$elem.destroy();
|
|
164
178
|
|
|
165
179
|
if (this.options.attributes) {
|
|
166
180
|
Object.values(this.options.attributes).forEach(function (attr) {
|
|
167
181
|
// @ts-ignore
|
|
168
|
-
attr.destroy();
|
|
182
|
+
attr === null || attr === void 0 ? void 0 : attr.destroy();
|
|
169
183
|
});
|
|
170
184
|
}
|
|
171
185
|
|
package/lib/regl/ReglModel.js
CHANGED
|
@@ -31,6 +31,7 @@ var ReglModel = class {
|
|
|
31
31
|
this.uniforms = {};
|
|
32
32
|
this.reGl = reGl;
|
|
33
33
|
const {
|
|
34
|
+
pick = true,
|
|
34
35
|
vs,
|
|
35
36
|
fs,
|
|
36
37
|
attributes,
|
|
@@ -77,12 +78,14 @@ var ReglModel = class {
|
|
|
77
78
|
this.initStencilDrawParams({ stencil }, drawParams);
|
|
78
79
|
this.initCullDrawParams({ cull }, drawParams);
|
|
79
80
|
this.drawCommand = reGl(drawParams);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
if (pick) {
|
|
82
|
+
const pickDrawParams = (0, import_lodash.cloneDeep)(drawParams);
|
|
83
|
+
pickDrawParams.blend = {
|
|
84
|
+
...pickDrawParams.blend,
|
|
85
|
+
enable: false
|
|
86
|
+
};
|
|
87
|
+
this.drawPickCommand = reGl(pickDrawParams);
|
|
88
|
+
}
|
|
86
89
|
this.drawParams = drawParams;
|
|
87
90
|
}
|
|
88
91
|
updateAttributesAndElements(attributes, elements) {
|
|
@@ -93,12 +96,14 @@ var ReglModel = class {
|
|
|
93
96
|
this.drawParams.attributes = reglAttributes;
|
|
94
97
|
this.drawParams.elements = elements.get();
|
|
95
98
|
this.drawCommand = this.reGl(this.drawParams);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
if (this.options.pick) {
|
|
100
|
+
const pickDrawParams = (0, import_lodash.cloneDeep)(this.drawParams);
|
|
101
|
+
pickDrawParams.blend = {
|
|
102
|
+
...pickDrawParams.blend,
|
|
103
|
+
enable: false
|
|
104
|
+
};
|
|
105
|
+
this.drawPickCommand = this.reGl(pickDrawParams);
|
|
106
|
+
}
|
|
102
107
|
}
|
|
103
108
|
updateAttributes(attributes) {
|
|
104
109
|
const reglAttributes = {};
|
|
@@ -107,12 +112,14 @@ var ReglModel = class {
|
|
|
107
112
|
});
|
|
108
113
|
this.drawParams.attributes = reglAttributes;
|
|
109
114
|
this.drawCommand = this.reGl(this.drawParams);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (this.options.pick) {
|
|
116
|
+
const pickDrawParams = (0, import_lodash.cloneDeep)(this.drawParams);
|
|
117
|
+
pickDrawParams.blend = {
|
|
118
|
+
...pickDrawParams.blend,
|
|
119
|
+
enable: false
|
|
120
|
+
};
|
|
121
|
+
this.drawPickCommand = this.reGl(pickDrawParams);
|
|
122
|
+
}
|
|
116
123
|
}
|
|
117
124
|
addUniforms(uniforms) {
|
|
118
125
|
this.uniforms = {
|
|
@@ -140,14 +147,15 @@ var ReglModel = class {
|
|
|
140
147
|
if (!pick) {
|
|
141
148
|
this.drawCommand(reglDrawProps);
|
|
142
149
|
} else {
|
|
143
|
-
this.drawPickCommand(reglDrawProps);
|
|
150
|
+
this.drawPickCommand && this.drawPickCommand(reglDrawProps);
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
destroy() {
|
|
147
|
-
|
|
154
|
+
var _a, _b;
|
|
155
|
+
(_b = (_a = this.drawParams) == null ? void 0 : _a.elements) == null ? void 0 : _b.destroy();
|
|
148
156
|
if (this.options.attributes) {
|
|
149
157
|
Object.values(this.options.attributes).forEach((attr) => {
|
|
150
|
-
attr.destroy();
|
|
158
|
+
attr == null ? void 0 : attr.destroy();
|
|
151
159
|
});
|
|
152
160
|
}
|
|
153
161
|
this.destroyed = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-renderer",
|
|
3
|
-
"version": "2.9.27-alpha.
|
|
3
|
+
"version": "2.9.27-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"author": "xiaoiver",
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@antv/l7-test-utils": "2.9.27-alpha.
|
|
28
|
+
"@antv/l7-test-utils": "2.9.27-alpha.3",
|
|
29
29
|
"gl": "^5.0.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@antv/l7-core": "2.9.27-alpha.
|
|
33
|
-
"@antv/l7-utils": "2.9.27-alpha.
|
|
32
|
+
"@antv/l7-core": "2.9.27-alpha.3",
|
|
33
|
+
"@antv/l7-utils": "2.9.27-alpha.3",
|
|
34
34
|
"@babel/runtime": "^7.7.7",
|
|
35
35
|
"inversify": "^5.0.1",
|
|
36
36
|
"l7regl": "^0.0.20",
|
|
37
37
|
"lodash": "^4.17.15",
|
|
38
38
|
"reflect-metadata": "^0.1.13"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "395ceeac3d64e838604f6acf8a84668488762ee3",
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
}
|