@antv/l7-layers 2.21.5 → 2.21.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/core/BaseLayer.js +1 -1
- package/es/core/BaseModel.js +6 -0
- package/es/core/utils.d.ts +0 -3
- package/es/core/utils.js +0 -12
- package/es/utils/stencil.js +1 -1
- package/lib/core/BaseLayer.js +1 -1
- package/lib/core/BaseModel.js +6 -0
- package/lib/core/utils.d.ts +0 -3
- package/lib/core/utils.js +0 -13
- package/lib/utils/stencil.js +1 -1
- package/package.json +6 -6
package/es/core/BaseLayer.js
CHANGED
|
@@ -849,7 +849,7 @@ export default class BaseLayer extends EventEmitter {
|
|
|
849
849
|
this.layerChildren.map(child => child.destroy(false));
|
|
850
850
|
this.layerChildren = [];
|
|
851
851
|
|
|
852
|
-
// remove mask list maskfence
|
|
852
|
+
// remove mask list maskfence 掩模需要销毁
|
|
853
853
|
const {
|
|
854
854
|
maskfence
|
|
855
855
|
} = this.getLayerConfig();
|
package/es/core/BaseModel.js
CHANGED
|
@@ -120,6 +120,12 @@ export default class BaseModel {
|
|
|
120
120
|
const attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
|
|
121
121
|
this.updateStyleUnifoms();
|
|
122
122
|
const result = _objectSpread(_objectSpread({}, attributeInfo.uniformsOption), commoninfo.uniformsOption);
|
|
123
|
+
// 兼容 Regl Boolean 类型
|
|
124
|
+
Object.keys(result).forEach(key => {
|
|
125
|
+
if (typeof result[key] === 'boolean') {
|
|
126
|
+
result[key] = result[key] ? 1 : 0;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
123
129
|
//如果是regl渲染 需要在uniform中带上u_texture 暂时用this.rendererService.device判断
|
|
124
130
|
if (!this.rendererService.hasOwnProperty('device') && this.textures && this.textures.length === 1) {
|
|
125
131
|
result['u_texture'] = this.textures[0];
|
package/es/core/utils.d.ts
CHANGED
package/es/core/utils.js
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
export function formatUniformsOption2Std140(uniformsOption) {
|
|
2
|
-
let std140_str = '';
|
|
3
|
-
Object.keys(uniformsOption).forEach(key => {
|
|
4
|
-
const value = uniformsOption[key];
|
|
5
|
-
if (Array.isArray(value)) {
|
|
6
|
-
std140_str += `vec${value.length} ${key};\n`;
|
|
7
|
-
} else {
|
|
8
|
-
std140_str += `flot ${key};\n`;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
return std140_str;
|
|
12
|
-
}
|
|
13
1
|
export function MultipleOfFourNumber(num) {
|
|
14
2
|
return Math.max(Math.ceil(num / 4) * 4, 4);
|
|
15
3
|
}
|
package/es/utils/stencil.js
CHANGED
package/lib/core/BaseLayer.js
CHANGED
|
@@ -855,7 +855,7 @@ class BaseLayer extends _eventemitter.EventEmitter {
|
|
|
855
855
|
this.layerChildren.map(child => child.destroy(false));
|
|
856
856
|
this.layerChildren = [];
|
|
857
857
|
|
|
858
|
-
// remove mask list maskfence
|
|
858
|
+
// remove mask list maskfence 掩模需要销毁
|
|
859
859
|
const {
|
|
860
860
|
maskfence
|
|
861
861
|
} = this.getLayerConfig();
|
package/lib/core/BaseModel.js
CHANGED
|
@@ -127,6 +127,12 @@ class BaseModel {
|
|
|
127
127
|
const attributeInfo = this.getUniformsBufferInfo(this.getStyleAttribute());
|
|
128
128
|
this.updateStyleUnifoms();
|
|
129
129
|
const result = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, attributeInfo.uniformsOption), commoninfo.uniformsOption);
|
|
130
|
+
// 兼容 Regl Boolean 类型
|
|
131
|
+
Object.keys(result).forEach(key => {
|
|
132
|
+
if (typeof result[key] === 'boolean') {
|
|
133
|
+
result[key] = result[key] ? 1 : 0;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
130
136
|
//如果是regl渲染 需要在uniform中带上u_texture 暂时用this.rendererService.device判断
|
|
131
137
|
if (!this.rendererService.hasOwnProperty('device') && this.textures && this.textures.length === 1) {
|
|
132
138
|
result['u_texture'] = this.textures[0];
|
package/lib/core/utils.d.ts
CHANGED
package/lib/core/utils.js
CHANGED
|
@@ -4,19 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MultipleOfFourNumber = MultipleOfFourNumber;
|
|
7
|
-
exports.formatUniformsOption2Std140 = formatUniformsOption2Std140;
|
|
8
|
-
function formatUniformsOption2Std140(uniformsOption) {
|
|
9
|
-
let std140_str = '';
|
|
10
|
-
Object.keys(uniformsOption).forEach(key => {
|
|
11
|
-
const value = uniformsOption[key];
|
|
12
|
-
if (Array.isArray(value)) {
|
|
13
|
-
std140_str += `vec${value.length} ${key};\n`;
|
|
14
|
-
} else {
|
|
15
|
-
std140_str += `flot ${key};\n`;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
return std140_str;
|
|
19
|
-
}
|
|
20
7
|
function MultipleOfFourNumber(num) {
|
|
21
8
|
return Math.max(Math.ceil(num / 4) * 4, 4);
|
|
22
9
|
}
|
package/lib/utils/stencil.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/l7-layers",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.7",
|
|
4
4
|
"description": "L7's collection of built-in layers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "https://github.com/orgs/antvis/people",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"gl-matrix": "^3.1.0",
|
|
34
34
|
"gl-vec2": "^1.3.0",
|
|
35
35
|
"polyline-miter-util": "^1.0.1",
|
|
36
|
-
"@antv/l7-core": "2.21.
|
|
37
|
-
"@antv/l7-maps": "2.21.
|
|
38
|
-
"@antv/l7-source": "2.21.
|
|
39
|
-
"@antv/l7-utils": "2.21.
|
|
36
|
+
"@antv/l7-core": "2.21.7",
|
|
37
|
+
"@antv/l7-maps": "2.21.7",
|
|
38
|
+
"@antv/l7-source": "2.21.7",
|
|
39
|
+
"@antv/l7-utils": "2.21.7"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/d3-array": "^2.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@types/d3-scale": "^2.1.1",
|
|
46
46
|
"@types/earcut": "^2.1.0",
|
|
47
47
|
"@types/gl-matrix": "^2.4.5",
|
|
48
|
-
"@antv/l7-test-utils": "^2.21.
|
|
48
|
+
"@antv/l7-test-utils": "^2.21.7"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public",
|