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 e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import"../../core/Error.js";import{HandleOwnerMixin as s}from"../../core/HandleOwner.js";import has from"../../core/has.js";import"../../core/Logger.js";import{throttle as i}from"../../core/throttle.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{CollisionEngine as a}from"./engine/webgl/collisions/CollisionEngine.js";const p=32;let l=class extends(s(t)){constructor(e){super(e),this._applyVisibilityPassThrottled=i(this._applyVisibilityPass,p,this),this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}initialize(){this.collisionEngine=new a}destroy(){this.collisionEngine=null,this._applyVisibilityPassThrottled.remove(),this._applyVisibilityPassThrottled=null}get updating(){return has("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}:\n-> updateRequested: ${this.updateRequested}`),this.updateRequested}update(e){this._applyVisibilityPassThrottled(e)}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}processUpdate(e){this._set("updateParameters",e),this.updateRequested&&(this.updateRequested=!1,this.update(e))}_applyVisibilityPass(e){try{const t=this.view.featuresTilingScheme.getClosestInfoForScale(e.state.scale).level;this.collisionEngine.run(this.view.allLayerViews.items,e,t)}catch(t){}}};e([r()],l.prototype,"updateRequested",void 0),e([r({readOnly:!0})],l.prototype,"updateParameters",void 0),e([r()],l.prototype,"updating",null),e([r()],l.prototype,"view",void 0),l=e([o("esri.views.2d.layers.labels.LabelManager")],l);const d=l;export{d as default};
|