@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.82 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as s}from"../../../chunks/tslib.es6.js";import o from"../../../core/Accessor.js";import t from"../../../core/Collection.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{LineSnapper as r}from"./LineSnapper.js";import{ParallelLineSnapper as n}from"./ParallelLineSnapper.js";import{RightAngleSnapper as p}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 h=class extends o{constructor(s){super(s),this.updating=!1,this._snappers=new t,this._domain=c.SELF}initialize(){this._snappers.push(new n(this.view,this.options),new r(this.view,this.options,this.geodesicLengthMeasurementUtils),new p(this.view,this.options,this.geodesicLengthMeasurementUtils),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 e=[];for(const i of this._snappers.items)for(const o of i.snap(s,t))e.push(o);return m(s,e),e}};s([e({readOnly:!0})],h.prototype,"updating",void 0),s([e({constructOnly:!0})],h.prototype,"view",void 0),s([e({constructOnly:!0})],h.prototype,"geodesicLengthMeasurementUtils",void 0),s([e()],h.prototype,"options",null),h=s([i("esri.views.interactive.snapping.SelfSnappingEngine")],h);export{h as SelfSnappingEngine};