Skip to content

Documentation / @geoverse/editor-ol / PunchHoleCommand

Class: PunchHoleCommand ​

Defined in: editor-core/dist/commands/punchHole.d.ts:7

面挖洞(2→1,结构插入内环):把第二个选中的面作为洞,结构性插入第一个面(目标)的内环。 与「面差集」的区别:非布尔运算,精确保留目标外边界;要求洞完全落在目标内部。 目标须为单面 Polygon;洞可为 Polygon/MultiPolygon(逐个外环插入)。两要素均被移除,结果继承目标属性。

Implements ​

  • Command

Constructors ​

Constructor ​

ts
new PunchHoleCommand(ids): PunchHoleCommand;

Defined in: editor-core/dist/commands/punchHole.d.ts:11

Parameters ​

ids ​

string[]

Returns ​

PunchHoleCommand

Properties ​

appliesTo ​

ts
readonly appliesTo: readonly GeometryKind[];

Defined in: editor-core/dist/commands/punchHole.d.ts:10

适用的几何类型(声明式);命令在 plan() 开头用 assertApplicable 据此硬拦截。

Implementation of ​

ts
Command.appliesTo

label ​

ts
readonly label: "面挖洞" = "\u9762\u6316\u6D1E";

Defined in: editor-core/dist/commands/punchHole.d.ts:9

Implementation of ​

ts
Command.label

Methods ​

plan() ​

ts
plan(ctx): ChangeSet;

Defined in: editor-core/dist/commands/punchHole.d.ts:12

Parameters ​

ctx ​

EditContext

Returns ​

ChangeSet

Implementation of ​

ts
Command.plan