@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 1.51 kB
JavaScript
import{_ as s}from"../../../chunks/tslib.es6.js";import o from"../../../core/Accessor.js";import t from"../../../core/Collection.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{LineSnapper as e}from"./LineSnapper.js";import{ParallelLineSnapper as p}from"./ParallelLineSnapper.js";import{RightAngleSnapper as n}from"./RightAngleSnapper.js";import{RightAngleTriangleSnapper as a}from"./RightAngleTriangleSnapper.js";import{SnappingDomain as c}from"./SnappingDomain.js";import{sortCandidatesInPlace as m}from"./snappingUtils.js";let f=class extends o{constructor(s){super(s),this.updating=!1,this._snappers=new t,this._domain=c.SELF}initialize(){this._snappers.push(new p(this.view,this.options),new e(this.view,this.options),new n(this.view,this.options),new a(this.view,this.options))}set options(s){this._set("options",s);for(const o of this._snappers)o.options=s}async fetchCandidates(s,o,t){if(!(o&this._domain&&this.options.effectiveSelfEnabled))return[];const i=[];for(const r of this._snappers.items)for(const o of r.snap(s,t))i.push(o);return m(s,i),i}};s([i({readOnly:!0})],f.prototype,"updating",void 0),s([i({constructOnly:!0})],f.prototype,"view",void 0),s([i()],f.prototype,"options",null),f=s([r("esri.views.interactive.snapping.SelfSnappingEngine")],f);export{f as SelfSnappingEngine};