12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import"../../core/has.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{MultipointDrawAction as r}from"./MultipointDrawAction.js";import{PointDrawAction as c}from"./PointDrawAction.js";import{PolygonDrawAction as s}from"./PolygonDrawAction.js";import{PolylineDrawAction as n}from"./PolylineDrawAction.js";import{SegmentDrawAction as a}from"./SegmentDrawAction.js";let p=class extends e{constructor(){super(...arguments),this.activeAction=null,this.type="draw",this.view=null}destroy(){this.activeAction&&(this.activeAction.destroy(),this.activeAction=null)}create(t,e){this.reset();const o={view:this.view,...e};switch(t){case"point":o.editGeometryType="point",this.activeAction=new c(o);break;case"polyline":o.editGeometryType="polyline",this.activeAction=new n(o);break;case"multipoint":o.editGeometryType="polygon",this.activeAction=new r(o);break;case"polygon":o.editGeometryType="polygon",this.activeAction=new s(o);break;case"rectangle":case"circle":case"ellipse":case"triangle":o.editGeometryType="polygon",this.activeAction=new a(o)}return this.activeAction}complete(){this.activeAction&&this.activeAction.complete(),this.activeAction=null}reset(){this.activeAction&&this.activeAction.destroy(),this.activeAction=null}};t([o()],p.prototype,"activeAction",void 0),t([o({readOnly:!0})],p.prototype,"type",void 0),t([o()],p.prototype,"view",void 0),p=t([i("esri.views.draw.Draw")],p);const l=p;export{l as default};
|