????
Current Path : C:/inetpub/vhost/binhdinhinvest.gdtvietnam.com/www/esri/views/2d/layers/features/ |
Current File : C:/inetpub/vhost/binhdinhinvest.gdtvietnam.com/www/esri/views/2d/layers/features/Pipeline.js |
// COPYRIGHT © 2020 Esri // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // This material is licensed for use under the Esri Master License // Agreement (MLA), and is bound by the terms of that agreement. // You may redistribute and use this code without modification, // provided you adhere to the terms of the MLA and include this // copyright notice. // // See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english // // For additional information, contact: // Environmental Systems Research Institute, Inc. // Attn: Contracts and Legal Services Department // 380 New York Street // Redlands, California, USA 92373 // USA // // email: contracts@esri.com // // See http://js.arcgis.com/4.16/esri/copyright.txt for details. define(["require","exports","tslib","../../../../core/Accessor","../../../../core/Error","../../../../core/has","../../../../core/Logger","../../../../core/promiseUtils","../../../../core/accessorSupport/decorators","../../../../layers/support/TileInfo","../../ViewState","./controllers","./processors","./support/TileStore","../../tiling/TileInfoView"],(function(e,t,r,o,i,n,s,a,l,c,u,p,h,d,f){Object.defineProperty(t,"__esModule",{value:!0});var v=s.getLogger("esri.views.2d.layers.features.Pipeline"),_=new Set;t.getInstances=function(){return _};var g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.controller=null,t.processor=null,t.remoteClient=null,t.tileStore=null,t.service=null,t.viewState=null,t}return r.__extends(t,e),t.prototype.initialize=function(){var e=this;this.watch("updating",(function(t){e.remoteClient.invoke("setUpdating",t)})),n("esri-performance-tests")&&!n("esri-workers")&&_.add(this)},t.prototype.destroy=function(){n("esri-performance-tests")&&!n("esri-workers")&&_.delete(this),this.controller&&this.controller.destroy(),this.processor&&this.processor.destroy()},Object.defineProperty(t.prototype,"updating",{get:function(){var e=this.controller,t=this.processor;return!e||!t||e.updating||t.updating||!1},enumerable:!0,configurable:!0}),t.prototype.startup=function(e){var t=e.service,o=e.config,i=e.tileInfo,n=e.options;return r.__awaiter(this,void 0,void 0,(function(){var e;return r.__generator(this,(function(r){switch(r.label){case 0:return this.service=t,this.tileStore||(e=new f(c.fromJSON(i)),this.tileStore=new d.default(e)),[4,this._configure(o,n)];case 1:return r.sent(),this.viewState&&(this.tileStore.clear(),this.tileStore.setViewState(this.viewState)),[2]}}))}))},t.prototype.update=function(e){var t=e.config,o=e.options;return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:return this.processor&&this.controller?o.layerFilterChanged||o.invalidateFeatureData||o.invalidateMesh?[4,this.controller.update(t,o.layerFilterChanged)]:[3,2]:(v.error(new i("mapview-pipeline","Tried to update an unconfigured pipeline.")),[2]);case 1:e.sent(),e.label=2;case 2:return o.invalidateMesh?[4,this.processor.update(t)]:[3,4];case 3:e.sent(),this.controller.invalidate(),e.label=4;case 4:return[4,this.remoteClient.invoke("setUpdating",this.updating)];case 5:return e.sent(),[2]}}))}))},t.prototype.setViewState=function(e){var t=u.fromJSON(e);this._set("viewState",t),this.tileStore&&this.tileStore.setViewState(t),this.controller&&this.controller.setViewState(t)},t.prototype._configure=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(r){switch(r.label){case 0:return[4,a.all([this._handleControllerConfig(e),this._handleProcessorConfig(e)])];case 1:return r.sent(),this.controller.processor=this.processor,this.viewState&&this.controller.setViewState(this.viewState),[4,this.update({config:e,options:t})];case 2:return r.sent(),[2]}}))}))},t.prototype._handleControllerConfig=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,this._createController(this.service,e)];case 1:return[4,(t=r.sent()).startup()];case 2:return r.sent(),[2,t]}}))}))},t.prototype._handleProcessorConfig=function(e){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(t){return[2,this._createProcessor(this.service,e)]}))}))},t.prototype._createController=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var o,i,n,s,a;return r.__generator(this,(function(r){switch(r.label){case 0:return this.controller&&this.controller.destroy(),[4,p.loadControllerModule(e.type)];case 1:return o=r.sent().default,n=(i=this).tileStore,s=i.remoteClient,a=new o({service:e,config:t,tileStore:n,remoteClient:s}),this.controller=a,[2,a]}}))}))},t.prototype._createProcessor=function(e,t){return r.__awaiter(this,void 0,void 0,(function(){var o,i,n,s,a;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,h.loadProcessorModule(t.renderer.type)];case 1:return o=r.sent().default,n=(i=this).remoteClient,s=i.tileStore,a=new o({service:e,config:t,tileStore:s,remoteClient:n}),this.processor&&this.processor.destroy(),this.processor=a,[2,a]}}))}))},r.__decorate([l.property()],t.prototype,"controller",void 0),r.__decorate([l.property()],t.prototype,"processor",void 0),r.__decorate([l.property({dependsOn:["controller.updating","processor.updating"]})],t.prototype,"updating",null),r.__decorate([l.property()],t.prototype,"viewState",void 0),t=r.__decorate([l.subclass("esri.views.2d.layers.features.Pipeline")],t)}(o);t.default=g}));