From 1bf4847db0fb8c5bcd3c3f70e4dbae2237269e83 Mon Sep 17 00:00:00 2001 From: Dreammy23 Date: Fri, 19 Apr 2024 15:16:58 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BF=AE=E6=94=B9=E6=8E=A9=E6=A8=A1?= =?UTF-8?q?=E6=96=87=E6=A1=88=20(#2415)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 谨欣 --- .../src/tile/Mask/demos/raster_roller.tsx | 2 +- .../dev-demos/src/tile/Mask/raster_roller.md | 2 +- .../dev-demos/src/tile/Mask/vector_raster.md | 2 +- .../dev-demos/src/tile/Vector/vectormask.md | 2 +- packages/component/src/control/swipe.ts | 10 +++++----- .../core/src/services/layer/LayerService.ts | 2 +- packages/layers/src/core/BaseLayer.ts | 2 +- packages/layers/src/utils/stencil.ts | 2 +- packages/renderer/src/regl/ReglModel.ts | 2 +- site/docs/api/common/layer/mask_method.zh.md | 2 +- site/docs/api/common/layer/mask_options.zh.md | 14 ++++++------- site/examples/mask/basic/demo/meta.json | 20 +++++++++---------- site/examples/mask/basic/index.zh.md | 2 +- site/examples/tile/basemap/demo/meta.json | 2 +- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/legacy/dev-demos/src/tile/Mask/demos/raster_roller.tsx b/legacy/dev-demos/src/tile/Mask/demos/raster_roller.tsx index 8ba676b2cce..0e8eb635ed9 100644 --- a/legacy/dev-demos/src/tile/Mask/demos/raster_roller.tsx +++ b/legacy/dev-demos/src/tile/Mask/demos/raster_roller.tsx @@ -124,7 +124,7 @@ export default () => { layerRef.current = layer3; - // 栅格图层使用polygon 掩膜 + // 栅格图层使用polygon 掩模 const layer1 = new RasterLayer({ zIndex: 1, maskLayers: [layer3], diff --git a/legacy/dev-demos/src/tile/Mask/raster_roller.md b/legacy/dev-demos/src/tile/Mask/raster_roller.md index c233fbb5021..3781e069e92 100644 --- a/legacy/dev-demos/src/tile/Mask/raster_roller.md +++ b/legacy/dev-demos/src/tile/Mask/raster_roller.md @@ -1,7 +1,7 @@ --- group: path: 'Mask' - title: 掩膜 + title: 掩模 title: 地图卷帘 order: 2 --- diff --git a/legacy/dev-demos/src/tile/Mask/vector_raster.md b/legacy/dev-demos/src/tile/Mask/vector_raster.md index 7515e8733e0..ae9a240b136 100644 --- a/legacy/dev-demos/src/tile/Mask/vector_raster.md +++ b/legacy/dev-demos/src/tile/Mask/vector_raster.md @@ -1,7 +1,7 @@ --- group: path: 'Mask' - title: 掩膜 + title: 掩模 title: 矢量栅格瓦片 order: 2 --- diff --git a/legacy/dev-demos/src/tile/Vector/vectormask.md b/legacy/dev-demos/src/tile/Vector/vectormask.md index f27f28db003..9471292d901 100644 --- a/legacy/dev-demos/src/tile/Vector/vectormask.md +++ b/legacy/dev-demos/src/tile/Vector/vectormask.md @@ -3,7 +3,7 @@ group: path: 'vector' title: '矢量瓦片' order: 1 -title: 矢量瓦片-掩膜 +title: 矢量瓦片-掩模 order: 2 --- \ No newline at end of file diff --git a/packages/component/src/control/swipe.ts b/packages/component/src/control/swipe.ts index 2280a8a24b1..6e4793468fa 100644 --- a/packages/component/src/control/swipe.ts +++ b/packages/component/src/control/swipe.ts @@ -32,7 +32,7 @@ export default class Swipe extends Control { */ private isMoving: boolean = false; /** - * 掩膜图层实例 + * 掩模图层实例 */ private maskLayer: ILayer; @@ -94,12 +94,12 @@ export default class Swipe extends Control { this.registerEvent(); - // 添加掩膜图层到 scene + // 添加掩模图层到 scene const layerContainer = createLayerContainer(sceneContainer); this.maskLayer.setContainer(layerContainer); this.scene.addLayer(this.maskLayer); - // 给图层挂载掩膜 + // 给图层挂载掩模 this.addMaskToLayers(layers, false); this.addMaskToLayers(rightLayers, true); this.emit('add', this); @@ -120,7 +120,7 @@ export default class Swipe extends Control { public show() { const container = this.container; DOM.removeClass(container, 'l7-control-swipe_hide'); - // 启用掩膜 + // 启用掩模 const { layers, rightLayers } = this.controlOption; layers.forEach((layer) => layer.enableMask()); rightLayers.forEach((layer) => layer.enableMask()); @@ -132,7 +132,7 @@ export default class Swipe extends Control { public hide() { const container = this.container; DOM.addClass(container, 'l7-control-swipe_hide'); - // 禁用掩膜 + // 禁用掩模 const { layers, rightLayers } = this.controlOption; layers.forEach((layer) => layer.disableMask()); rightLayers.forEach((layer) => layer.disableMask()); diff --git a/packages/core/src/services/layer/LayerService.ts b/packages/core/src/services/layer/LayerService.ts index 7a8256a2546..376cd36053d 100644 --- a/packages/core/src/services/layer/LayerService.ts +++ b/packages/core/src/services/layer/LayerService.ts @@ -184,7 +184,7 @@ export default class LayerService extends EventEmitter implem maskCount = maskCount + (enableMask ? masklayers.length : 1); const stencilType = maskCount > 1 ? StencilType.MULTIPLE : StencilType.SINGLE; - // 兼容MaskLayer MaskLayer的掩膜不能clear + // 兼容MaskLayer MaskLayer的掩模不能clear if (layer.tileMask || (masklayers.length && enableMask)) { this.renderService.clear({ stencil: 0, diff --git a/packages/layers/src/core/BaseLayer.ts b/packages/layers/src/core/BaseLayer.ts index c4bea46d4ed..10903d8e741 100644 --- a/packages/layers/src/core/BaseLayer.ts +++ b/packages/layers/src/core/BaseLayer.ts @@ -987,7 +987,7 @@ export default class BaseLayer this.layerChildren.map((child: ILayer) => child.destroy(false)); this.layerChildren = []; - // remove mask list maskfence 掩膜需要销毁 + // remove mask list maskfence 掩模需要销毁 const { maskfence } = this.getLayerConfig(); if (maskfence) { this.masks.map((mask: ILayer) => mask.destroy(false)); diff --git a/packages/layers/src/utils/stencil.ts b/packages/layers/src/utils/stencil.ts index 9fb70cbf113..a116ace0fc1 100644 --- a/packages/layers/src/utils/stencil.ts +++ b/packages/layers/src/utils/stencil.ts @@ -1,6 +1,6 @@ import type { IRenderOptions, IStencilOptions, MaskOperationType } from '@antv/l7-core'; import { MaskOperation, StencilType, gl } from '@antv/l7-core'; -// 掩膜配置 +// 掩模配置 export function getStencil(mask: boolean, maskInside: boolean): Partial { return { enable: mask, diff --git a/packages/renderer/src/regl/ReglModel.ts b/packages/renderer/src/regl/ReglModel.ts index a5a89df8e3f..4c6777093b9 100644 --- a/packages/renderer/src/regl/ReglModel.ts +++ b/packages/renderer/src/regl/ReglModel.ts @@ -311,7 +311,7 @@ export default class ReglModel implements IModel { pick: boolean, ) { // TODO: 重构相关参数 - // 掩膜模式下,颜色通道全部关闭 + // 掩模模式下,颜色通道全部关闭 const colorMask = stencil?.enable && stencil.opFront && !pick ? [false, false, false, false] diff --git a/site/docs/api/common/layer/mask_method.zh.md b/site/docs/api/common/layer/mask_method.zh.md index 1bc5fb54e5d..b0eb2c280c0 100644 --- a/site/docs/api/common/layer/mask_method.zh.md +++ b/site/docs/api/common/layer/mask_method.zh.md @@ -1,4 +1,4 @@ -## 图层掩膜方法 +## 图层掩模方法 ### addMask diff --git a/site/docs/api/common/layer/mask_options.zh.md b/site/docs/api/common/layer/mask_options.zh.md index f3c647ad39e..85d84c1deec 100644 --- a/site/docs/api/common/layer/mask_options.zh.md +++ b/site/docs/api/common/layer/mask_options.zh.md @@ -1,25 +1,25 @@ ⚠️ mask、maskfence 不推荐使用,一下配置 2.14.x 之后版本生效 模板图层:用做模板的图层,PointLayer、LineLayer、PolygonLayer 都可以作为模板 -掩膜图层:被模板切割的图层 +掩模图层:被模板切割的图层 ### maskLayers -掩膜图层生效 +掩模图层生效 _array Layer_ **optional** _default:_ [] ### enableMask -掩膜图层生效 +掩模图层生效 -是否开启掩膜,默认开启 maskLayers 不为空时生效 +是否开启掩模,默认开启 maskLayers 不为空时生效 _bool_ **optional** _default:_ true ### maskInside - 掩膜图层生效 + 掩模图层生效 _boolean_ **optional** _default:_ true @@ -28,7 +28,7 @@ - `true` 在掩模内部显示 - `false` 在掩模外部显示 -### maskOpetation 掩膜方式 +### maskOpetation 掩模方式 模板图层生效 _枚举_ **optional** _default:_ and @@ -42,7 +42,7 @@ maskLayers 为多个时失效,需要在模板图层设置 ```ts const polygonLayer = new Polygon(); const rasterLayer = new Raster({ - // 栅格图层使用polygon 掩膜 + // 栅格图层使用polygon 掩模 maskLayers: [polygonLayer], enableMask: true, maskInside: true, diff --git a/site/examples/mask/basic/demo/meta.json b/site/examples/mask/basic/demo/meta.json index 704e01bd77d..e877c4c3ab3 100644 --- a/site/examples/mask/basic/demo/meta.json +++ b/site/examples/mask/basic/demo/meta.json @@ -1,52 +1,52 @@ { "title": { - "zh": "图层掩膜", + "zh": "图层掩模", "en": "Mask Layer" }, "demos": [ { "filename": "raster.ts", - "title": "栅格-多边形掩膜", + "title": "栅格-多边形掩模", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*ErY5Rp9GY-YAAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "heatmap.ts", - "title": "热力图-多边形掩膜", + "title": "热力图-多边形掩模", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*m32ARZNA1mQAAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "raster_vector.ts", - "title": "栅格瓦片-矢量瓦片掩膜", + "title": "栅格瓦片-矢量瓦片掩模", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Kkn2TYXvX6UAAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "vector_polygon.ts", - "title": "矢量瓦片-多边形掩膜", + "title": "矢量瓦片-多边形掩模", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*0mVdRZs08HsAAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "raster_polygon.js", - "title": "栅格瓦片-多边形掩膜", + "title": "栅格瓦片-多边形掩模", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*n0y_TZ2gr5AAAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "multi_mask_or.ts", - "title": "栅格瓦片-多个Plolygon掩膜-并集", + "title": "栅格瓦片-多个Plolygon掩模-并集", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*09_KQZqe8L8AAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "multi_mask_and.ts", - "title": "栅格瓦片-多个Polygon掩膜-交集", + "title": "栅格瓦片-多个Polygon掩模-交集", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*n4nwQ7ZgbDYAAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "multi_mask_or_not.ts", - "title": "栅格瓦片-多个Plolygon掩膜-并集取反", + "title": "栅格瓦片-多个Plolygon掩模-并集取反", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*bytjT7JNtekAAAAAAAAAAAAADmJ7AQ/original" }, { "filename": "rastertile_raster.ts", - "title": "栅格瓦片-栅格掩膜", + "title": "栅格瓦片-栅格掩模", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*vde4QYTTVhUAAAAAAAAAAAAADmJ7AQ/original" }, { diff --git a/site/examples/mask/basic/index.zh.md b/site/examples/mask/basic/index.zh.md index c0d061d80cb..80d91d693ef 100644 --- a/site/examples/mask/basic/index.zh.md +++ b/site/examples/mask/basic/index.zh.md @@ -1,4 +1,4 @@ --- -title: 图层掩膜 +title: 图层掩模 order: 1 --- diff --git a/site/examples/tile/basemap/demo/meta.json b/site/examples/tile/basemap/demo/meta.json index 1f15580cda6..f5d3059bebe 100644 --- a/site/examples/tile/basemap/demo/meta.json +++ b/site/examples/tile/basemap/demo/meta.json @@ -21,7 +21,7 @@ }, { "filename": "mask.ts", - "title": "影像底图掩膜", + "title": "影像底图掩模", "screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*UPwFRI5cUsoAAAAAAAAAAAAADmJ7AQ/original" }, {