Skip to content

Commit

Permalink
docs: 修改掩模文案 (#2415)
Browse files Browse the repository at this point in the history
Co-authored-by: 谨欣 <[email protected]>
  • Loading branch information
Dreammy23 and 谨欣 authored Apr 19, 2024
1 parent a49cd6f commit 1bf4847
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion legacy/dev-demos/src/tile/Mask/demos/raster_roller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default () => {

layerRef.current = layer3;

// 栅格图层使用polygon 掩膜
// 栅格图层使用polygon 掩模
const layer1 = new RasterLayer({
zIndex: 1,
maskLayers: [layer3],
Expand Down
2 changes: 1 addition & 1 deletion legacy/dev-demos/src/tile/Mask/raster_roller.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
group:
path: 'Mask'
title: 掩膜
title: 掩模
title: 地图卷帘
order: 2
---
Expand Down
2 changes: 1 addition & 1 deletion legacy/dev-demos/src/tile/Mask/vector_raster.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
group:
path: 'Mask'
title: 掩膜
title: 掩模
title: 矢量栅格瓦片
order: 2
---
Expand Down
2 changes: 1 addition & 1 deletion legacy/dev-demos/src/tile/Vector/vectormask.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ group:
path: 'vector'
title: '矢量瓦片'
order: 1
title: 矢量瓦片-掩膜
title: 矢量瓦片-掩模
order: 2
---
<code src="./demos/vectormask.tsx"></code>
10 changes: 5 additions & 5 deletions packages/component/src/control/swipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Swipe extends Control<ISwipeControlOption> {
*/
private isMoving: boolean = false;
/**
* 掩膜图层实例
* 掩模图层实例
*/
private maskLayer: ILayer;

Expand Down Expand Up @@ -94,12 +94,12 @@ export default class Swipe extends Control<ISwipeControlOption> {

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);
Expand All @@ -120,7 +120,7 @@ export default class Swipe extends Control<ISwipeControlOption> {
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());
Expand All @@ -132,7 +132,7 @@ export default class Swipe extends Control<ISwipeControlOption> {
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());
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/layer/LayerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default class LayerService extends EventEmitter<LayerServiceEvent> 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,
Expand Down
2 changes: 1 addition & 1 deletion packages/layers/src/core/BaseLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ export default class BaseLayer<ChildLayerStyleOptions = {}>
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));
Expand Down
2 changes: 1 addition & 1 deletion packages/layers/src/utils/stencil.ts
Original file line number Diff line number Diff line change
@@ -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<IStencilOptions> {
return {
enable: mask,
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/src/regl/ReglModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ export default class ReglModel implements IModel {
pick: boolean,
) {
// TODO: 重构相关参数
// 掩膜模式下,颜色通道全部关闭
// 掩模模式下,颜色通道全部关闭
const colorMask =
stencil?.enable && stencil.opFront && !pick
? [false, false, false, false]
Expand Down
2 changes: 1 addition & 1 deletion site/docs/api/common/layer/mask_method.zh.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 图层掩膜方法
## 图层掩模方法

### addMask

Expand Down
14 changes: 7 additions & 7 deletions site/docs/api/common/layer/mask_options.zh.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
⚠️ mask、maskfence 不推荐使用,一下配置 2.14.x 之后版本生效

模板图层:用做模板的图层,PointLayer、LineLayer、PolygonLayer 都可以作为模板
掩膜图层:被模板切割的图层
掩模图层:被模板切割的图层

### maskLayers

掩膜图层生效
掩模图层生效

<description> _array Layer_ **optional** _default:_ []</description>

### enableMask

掩膜图层生效
掩模图层生效

是否开启掩膜,默认开启 maskLayers 不为空时生效
是否开启掩模,默认开启 maskLayers 不为空时生效

<description> _bool_ **optional** _default:_ true</description>

### maskInside

掩膜图层生效
掩模图层生效

<description> _boolean_ **optional** _default:_ true</description>

Expand All @@ -28,7 +28,7 @@
- `true` 在掩模内部显示
- `false` 在掩模外部显示

### maskOpetation 掩膜方式
### maskOpetation 掩模方式

模板图层生效
<description> _枚举_ **optional** _default:_ and</description>
Expand All @@ -42,7 +42,7 @@ maskLayers 为多个时失效,需要在模板图层设置
```ts
const polygonLayer = new Polygon();
const rasterLayer = new Raster({
// 栅格图层使用polygon 掩膜
// 栅格图层使用polygon 掩模
maskLayers: [polygonLayer],
enableMask: true,
maskInside: true,
Expand Down
20 changes: 10 additions & 10 deletions site/examples/mask/basic/demo/meta.json
Original file line number Diff line number Diff line change
@@ -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"
},
{
Expand Down
2 changes: 1 addition & 1 deletion site/examples/mask/basic/index.zh.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
title: 图层掩膜
title: 图层掩模
order: 1
---
2 changes: 1 addition & 1 deletion site/examples/tile/basemap/demo/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"filename": "mask.ts",
"title": "影像底图掩膜",
"title": "影像底图掩模",
"screenshot": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*UPwFRI5cUsoAAAAAAAAAAAAADmJ7AQ/original"
},
{
Expand Down

0 comments on commit 1bf4847

Please sign in to comment.