@antv/l7-layers 2.25.1 → 2.25.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.
@@ -31,8 +31,8 @@ export default class Arc3DModel extends BaseModel {
31
31
  }
32
32
  this.texture = createTexture2D({
33
33
  data: this.iconService.getCanvas(),
34
- mag: gl.NEAREST,
35
- min: gl.NEAREST,
34
+ mag: gl.LINEAR,
35
+ min: gl.LINEAR,
36
36
  premultiplyAlpha: false,
37
37
  width: 1024,
38
38
  height: this.iconService.canvasHeight || 128
@@ -12,4 +12,4 @@ import RegisterStyleAttributePlugin from './RegisterStyleAttributePlugin';
12
12
  import ShaderUniformPlugin from './ShaderUniformPlugin';
13
13
  import UpdateModelPlugin from './UpdateModelPlugin';
14
14
  import UpdateStyleAttributePlugin from './UpdateStyleAttributePlugin';
15
- export declare function createPlugins(): (DataSourcePlugin | RegisterStyleAttributePlugin | FeatureScalePlugin | DataMappingPlugin | LayerStylePlugin | LayerMaskPlugin | UpdateStyleAttributePlugin | UpdateModelPlugin | MultiPassRendererPlugin | ShaderUniformPlugin | LayerAnimateStylePlugin | LightingPlugin | PixelPickingPlugin | LayerModelPlugin)[];
15
+ export declare function createPlugins(): (DataMappingPlugin | DataSourcePlugin | FeatureScalePlugin | LayerAnimateStylePlugin | LayerMaskPlugin | LayerModelPlugin | LayerStylePlugin | LightingPlugin | MultiPassRendererPlugin | PixelPickingPlugin | RegisterStyleAttributePlugin | ShaderUniformPlugin | UpdateModelPlugin | UpdateStyleAttributePlugin)[];
@@ -34,7 +34,9 @@ void main() {
34
34
 
35
35
  highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
36
36
 
37
- outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));
37
+ // 根据 stroke alpha 值调整混合权重,避免透明 stroke 影响文本颜色
38
+ float stroke_mix_factor = smoothstep(0., 0.5, 1.- dist) * v_stroke_color.a;
39
+ outputColor = mix(v_color, v_stroke_color, stroke_mix_factor);
38
40
 
39
41
  outputColor.a *= alpha;
40
42
  // 作为 mask 模板时需要丢弃透明的像素
@@ -47,7 +47,7 @@ export default abstract class Tile extends EventEmitter implements ITile {
47
47
  enablePropagation?: boolean | undefined;
48
48
  fitBoundsOptions?: unknown;
49
49
  name?: string | undefined;
50
- blend?: "normal" | "none" | "additive" | "subtractive" | "min" | "max" | undefined;
50
+ blend?: "min" | "max" | "normal" | "additive" | "subtractive" | "none" | undefined;
51
51
  depth?: boolean | undefined;
52
52
  pickedFeatureID?: number | undefined;
53
53
  enableMultiPassRenderer?: boolean | undefined;
@@ -7,6 +7,6 @@ import RasterTerrainRGBTile from './RasterTerrainRGBTile';
7
7
  import RasterTile from './RasterTile';
8
8
  import VectorTile from './VectorTile';
9
9
  export type TileType = 'VectorTile' | 'DebugTile' | 'PolygonLayer' | 'PointLayer' | 'LineLayer' | 'RasterLayer' | 'image' | 'MaskLayer' | 'TileDebugLayer';
10
- export declare function getTileFactory(layer: ILayer): typeof VectorTile | typeof DebugTile | typeof MaskLayer | typeof RasterRGBTile | typeof RasterTile | typeof RasterTerrainRGBTile | typeof ImageTile;
10
+ export declare function getTileFactory(layer: ILayer): typeof DebugTile | typeof ImageTile | typeof MaskLayer | typeof RasterRGBTile | typeof RasterTerrainRGBTile | typeof RasterTile | typeof VectorTile;
11
11
  export * from '../interface';
12
12
  export * from './Tile';
@@ -1,5 +1,5 @@
1
1
  import LineLayer from '../../line';
2
2
  import PointLayer from '../../point/index';
3
3
  import PolygonLayer from '../../polygon';
4
- export declare function getTileLayer(type: string): typeof PointLayer | typeof PolygonLayer | typeof LineLayer;
4
+ export declare function getTileLayer(type: string): typeof LineLayer | typeof PointLayer | typeof PolygonLayer;
5
5
  export declare function isNeedMask(type: string): boolean;
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import { aProjectFlat } from '@antv/l7-utils';
3
3
  import { vec2 } from 'gl-matrix';
4
4
  const tmp = vec2.create();
5
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
5
  const capEnd = vec2.create();
7
6
  const lineA = vec2.create();
8
7
  const lineB = vec2.create();
@@ -304,9 +303,11 @@ export default class ExtrudePolyline {
304
303
  distanceRadio) {
305
304
  normals.push(normal[0], normal[1], 0);
306
305
  normals.push(normal[0], normal[1], 0);
307
- positions.push(point[0], point[1], point[2] | 0, distanceRadio, -thickness, point[2] | 0);
306
+ // 修复:正确处理 z 坐标,当 point[2] 不存在时使用 0,但保留传入的高度值
307
+ const z = point[2] !== undefined ? point[2] : 0;
308
+ positions.push(point[0], point[1], z, distanceRadio, -thickness, z);
308
309
  this.complex.indexes.push(this.currentIndex);
309
- positions.push(point[0], point[1], point[2] | 0, distanceRadio, thickness, point[2] | 0);
310
+ positions.push(point[0], point[1], z, distanceRadio, thickness, z);
310
311
  this.complex.indexes.push(this.currentIndex);
311
312
  this.currentIndex++;
312
313
  }
@@ -38,8 +38,8 @@ class Arc3DModel extends _BaseModel.default {
38
38
  }
39
39
  this.texture = createTexture2D({
40
40
  data: this.iconService.getCanvas(),
41
- mag: _l7Core.gl.NEAREST,
42
- min: _l7Core.gl.NEAREST,
41
+ mag: _l7Core.gl.LINEAR,
42
+ min: _l7Core.gl.LINEAR,
43
43
  premultiplyAlpha: false,
44
44
  width: 1024,
45
45
  height: this.iconService.canvasHeight || 128
@@ -12,4 +12,4 @@ import RegisterStyleAttributePlugin from './RegisterStyleAttributePlugin';
12
12
  import ShaderUniformPlugin from './ShaderUniformPlugin';
13
13
  import UpdateModelPlugin from './UpdateModelPlugin';
14
14
  import UpdateStyleAttributePlugin from './UpdateStyleAttributePlugin';
15
- export declare function createPlugins(): (DataSourcePlugin | RegisterStyleAttributePlugin | FeatureScalePlugin | DataMappingPlugin | LayerStylePlugin | LayerMaskPlugin | UpdateStyleAttributePlugin | UpdateModelPlugin | MultiPassRendererPlugin | ShaderUniformPlugin | LayerAnimateStylePlugin | LightingPlugin | PixelPickingPlugin | LayerModelPlugin)[];
15
+ export declare function createPlugins(): (DataMappingPlugin | DataSourcePlugin | FeatureScalePlugin | LayerAnimateStylePlugin | LayerMaskPlugin | LayerModelPlugin | LayerStylePlugin | LightingPlugin | MultiPassRendererPlugin | PixelPickingPlugin | RegisterStyleAttributePlugin | ShaderUniformPlugin | UpdateModelPlugin | UpdateStyleAttributePlugin)[];
@@ -34,7 +34,9 @@ void main() {
34
34
 
35
35
  highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);
36
36
 
37
- outputColor = mix(v_color, v_stroke_color, smoothstep(0., 0.5, 1.- dist));
37
+ // 根据 stroke alpha 值调整混合权重,避免透明 stroke 影响文本颜色
38
+ float stroke_mix_factor = smoothstep(0., 0.5, 1.- dist) * v_stroke_color.a;
39
+ outputColor = mix(v_color, v_stroke_color, stroke_mix_factor);
38
40
 
39
41
  outputColor.a *= alpha;
40
42
  // 作为 mask 模板时需要丢弃透明的像素
@@ -47,7 +47,7 @@ export default abstract class Tile extends EventEmitter implements ITile {
47
47
  enablePropagation?: boolean | undefined;
48
48
  fitBoundsOptions?: unknown;
49
49
  name?: string | undefined;
50
- blend?: "normal" | "none" | "additive" | "subtractive" | "min" | "max" | undefined;
50
+ blend?: "min" | "max" | "normal" | "additive" | "subtractive" | "none" | undefined;
51
51
  depth?: boolean | undefined;
52
52
  pickedFeatureID?: number | undefined;
53
53
  enableMultiPassRenderer?: boolean | undefined;
@@ -7,6 +7,6 @@ import RasterTerrainRGBTile from './RasterTerrainRGBTile';
7
7
  import RasterTile from './RasterTile';
8
8
  import VectorTile from './VectorTile';
9
9
  export type TileType = 'VectorTile' | 'DebugTile' | 'PolygonLayer' | 'PointLayer' | 'LineLayer' | 'RasterLayer' | 'image' | 'MaskLayer' | 'TileDebugLayer';
10
- export declare function getTileFactory(layer: ILayer): typeof VectorTile | typeof DebugTile | typeof MaskLayer | typeof RasterRGBTile | typeof RasterTile | typeof RasterTerrainRGBTile | typeof ImageTile;
10
+ export declare function getTileFactory(layer: ILayer): typeof DebugTile | typeof ImageTile | typeof MaskLayer | typeof RasterRGBTile | typeof RasterTerrainRGBTile | typeof RasterTile | typeof VectorTile;
11
11
  export * from '../interface';
12
12
  export * from './Tile';
@@ -1,5 +1,5 @@
1
1
  import LineLayer from '../../line';
2
2
  import PointLayer from '../../point/index';
3
3
  import PolygonLayer from '../../polygon';
4
- export declare function getTileLayer(type: string): typeof PointLayer | typeof PolygonLayer | typeof LineLayer;
4
+ export declare function getTileLayer(type: string): typeof LineLayer | typeof PointLayer | typeof PolygonLayer;
5
5
  export declare function isNeedMask(type: string): boolean;
@@ -13,7 +13,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
13
13
  var _l7Utils = require("@antv/l7-utils");
14
14
  var _glMatrix = require("gl-matrix");
15
15
  const tmp = _glMatrix.vec2.create();
16
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
16
  const capEnd = _glMatrix.vec2.create();
18
17
  const lineA = _glMatrix.vec2.create();
19
18
  const lineB = _glMatrix.vec2.create();
@@ -315,9 +314,11 @@ class ExtrudePolyline {
315
314
  distanceRadio) {
316
315
  normals.push(normal[0], normal[1], 0);
317
316
  normals.push(normal[0], normal[1], 0);
318
- positions.push(point[0], point[1], point[2] | 0, distanceRadio, -thickness, point[2] | 0);
317
+ // 修复:正确处理 z 坐标,当 point[2] 不存在时使用 0,但保留传入的高度值
318
+ const z = point[2] !== undefined ? point[2] : 0;
319
+ positions.push(point[0], point[1], z, distanceRadio, -thickness, z);
319
320
  this.complex.indexes.push(this.currentIndex);
320
- positions.push(point[0], point[1], point[2] | 0, distanceRadio, thickness, point[2] | 0);
321
+ positions.push(point[0], point[1], z, distanceRadio, thickness, z);
321
322
  this.complex.indexes.push(this.currentIndex);
322
323
  this.currentIndex++;
323
324
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/l7-layers",
3
- "version": "2.25.1",
3
+ "version": "2.25.3",
4
4
  "description": "L7's collection of built-in layers",
5
5
  "license": "MIT",
6
6
  "author": "https://github.com/orgs/antvis/people",
@@ -26,10 +26,10 @@
26
26
  "earcut": "^2.2.1",
27
27
  "eventemitter3": "^4.0.0",
28
28
  "gl-matrix": "^3.1.0",
29
- "@antv/l7-core": "2.25.1",
30
- "@antv/l7-maps": "2.25.1",
31
- "@antv/l7-source": "2.25.1",
32
- "@antv/l7-utils": "2.25.1"
29
+ "@antv/l7-core": "2.25.3",
30
+ "@antv/l7-maps": "2.25.3",
31
+ "@antv/l7-source": "2.25.3",
32
+ "@antv/l7-utils": "2.25.3"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/earcut": "^2.1.0",