Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

8 lines
2.7 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define(["exports","../../core/Collection"],function(c,h){c.ManipulatorVisibilityPredicate=void 0;(function(a){a[a.WhenToolEditable=0]="WhenToolEditable";a[a.WhenToolNotEditable=1]="WhenToolNotEditable";a[a.Always=2]="Always"})(c.ManipulatorVisibilityPredicate||(c.ManipulatorVisibilityPredicate={}));class k{constructor(){this._isToolEditable=!0;this._manipulators=new h;this._resourceContexts={manipulator3D:{}};this._attached=!1}set isToolEditable(a){this._isToolEditable=a}get length(){return this._manipulators.length}add(a,
b=c.ManipulatorVisibilityPredicate.WhenToolEditable){this.addMany([a],b)}addMany(a,b=c.ManipulatorVisibilityPredicate.WhenToolEditable){for(const d of a)a={manipulator:d,visibilityPredicate:b,attached:!1},this._manipulators.add(a),this._attached&&this._updateManipulatorAttachment(a)}remove(a){for(let b=0;b<this._manipulators.length;b++)if(this._manipulators.at(b).manipulator===a){a=this._manipulators.splice(b,1)[0];this._detachManipulator(a);break}}removeAll(){this._manipulators.forEach(a=>{this._detachManipulator(a)});
this._manipulators.removeAll()}attach(){this._manipulators.forEach(a=>{this._updateManipulatorAttachment(a)});this._attached=!0}detach(){this._manipulators.forEach(a=>{this._detachManipulator(a)});this._attached=!1}destroy(){this.detach();this._manipulators.forEach(({manipulator:a})=>a.destroy());this._manipulators.destroy();this._resourceContexts=null}on(a,b){return this._manipulators.on(a,d=>{b(d)})}forEach(a){for(const b of this._manipulators.items)a(b)}some(a){return this._manipulators.items.some(a)}toArray(){const a=
[];this.forEach(b=>a.push(b.manipulator));return a}intersect(a,b){let d=null,g=Number.MAX_VALUE;this._manipulators.forEach(({manipulator:f,attached:e})=>{e&&f.interactive&&(e=f.intersectionDistance(a,b),null!=e&&e<g&&(g=e,d=f))});return d}_updateManipulatorAttachment(a){this._isManipulatorItemVisible(a)?this._attachManipulator(a):this._detachManipulator(a)}_attachManipulator(a){a.attached||(a.manipulator.attach&&a.manipulator.attach(this._resourceContexts),a.attached=!0)}_detachManipulator(a){if(a.attached){var b=
a.manipulator;b.grabbing=!1;b.dragging=!1;b.hovering=!1;b.selected=!1;b.detach&&b.detach(this._resourceContexts);a.attached=!1}}_isManipulatorItemVisible(a){return a.visibilityPredicate===c.ManipulatorVisibilityPredicate.Always?!0:this._isToolEditable?a.visibilityPredicate===c.ManipulatorVisibilityPredicate.WhenToolEditable:a.visibilityPredicate===c.ManipulatorVisibilityPredicate.WhenToolNotEditable}}c.ManipulatorCollection=k;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});