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.
 
 

10 lines
3.5 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("../../chunks/tslib.es6 ../../core/Accessor ../../core/Collection ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../views/layers/support/ClipRect".split(" "),function(d,c,m,n,e,t,u,v,r,p){const q={left:0,right:0,top:0,bottom:0};c=class extends c{constructor(a){super(a);this._leadingClips=new Map;this._trailingClips=new Map;this.direction="horizontal";this.leadingLayers=
new m;this.max=100;this.min=0;this.precision=4;this.step=.5;this.stepMultiplier=10;this.trailingLayers=new m;this.view=null}initialize(){this.addHandles([n.watch(()=>[this.view,this.view?.ready,this.position,this.direction],()=>this._clipLayers(),n.initial),n.on(()=>this.leadingLayers,"change",()=>this._clipLeadingLayers()),n.on(()=>this.trailingLayers,"change",()=>this._clipTrailingLayers())])}destroy(){this._removeExistingClips()}get position(){return 25}set position(a){const {precision:b,min:h,
max:k}=this,f=10**b;this._set.call(this,"position",Math.round(Math.max(Math.min(a,k),h)*f)/f)}get state(){return this.view?.ready?"ready":"disabled"}_clipLayers(){this._clipLeadingLayers();this._clipTrailingLayers()}_clipLeadingLayers(){this._removeClips("leading");const {leadingLayers:a}=this;a.forEach(b=>this._clipLayer({layer:b,type:"leading"}))}_clipTrailingLayers(){this._removeClips("trailing");const {trailingLayers:a}=this;a.forEach(b=>this._clipLayer({layer:b,type:"trailing"}))}async _getLayerView(a){const {view:b}=
this;if(!a||!b)return null;a=await b.whenLayerView(a);return"clips"in a?a:null}_getVerticalClipRect(a){const {position:b}=this;return"leading"===a?new p({...q,bottom:`${100-b}%`}):"trailing"===a?new p({...q,top:`${b}%`}):null}_getHorizontalClipRect(a){const {position:b}=this;return"leading"===a?new p({...q,right:`${100-b}%`}):"trailing"===a?new p({...q,left:`${b}%`}):null}_getClipRect(a){const {direction:b}=this;return"vertical"===b?this._getVerticalClipRect(a):"horizontal"===b?this._getHorizontalClipRect(a):
null}async _clipLayer(a){const {_leadingClips:b,_trailingClips:h}=this,{layer:k,type:f}=a;a="trailing"===f?h:"leading"===f?b:null;const g=await this._getLayerView(k);if(g&&"clips"in g&&a&&g.hasOwnProperty("clips")){var l=a.get(g);l&&g.clips.remove(l);if(l=this._getClipRect(f))a.set(g,l),g.clips.add(l)}}_removeClips(a){const {_leadingClips:b,_trailingClips:h}=this;if(a="trailing"===a?h:"leading"===a?b:null)a.forEach((k,f)=>{f&&f.hasOwnProperty("clips")&&f.clips.remove(k)}),a.clear()}_removeExistingClips(){this._removeClips("leading");
this._removeClips("trailing")}};d.__decorate([e.property()],c.prototype,"direction",void 0);d.__decorate([e.property({type:m,nonNullable:!0})],c.prototype,"leadingLayers",void 0);d.__decorate([e.property({readOnly:!0})],c.prototype,"max",void 0);d.__decorate([e.property({readOnly:!0})],c.prototype,"min",void 0);d.__decorate([e.property()],c.prototype,"position",null);d.__decorate([e.property()],c.prototype,"precision",void 0);d.__decorate([e.property({readOnly:!0})],c.prototype,"state",null);d.__decorate([e.property()],
c.prototype,"step",void 0);d.__decorate([e.property()],c.prototype,"stepMultiplier",void 0);d.__decorate([e.property({type:m,nonNullable:!0})],c.prototype,"trailingLayers",void 0);d.__decorate([e.property()],c.prototype,"view",void 0);return c=d.__decorate([r.subclass("esri.widgets.Swipe.SwipeViewModel")],c)});