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.
 
 

13 lines
5.0 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("require ../chunks/tslib.es6 ../core/promiseUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./Slice/SliceViewModel ../chunks/componentsUtils ./support/globalCss ./support/Heading ./support/widgetUtils ./support/decorators/messageBundle ./support/jsxFactory".split(" "),function(p,e,v,f,d,B,C,w,x,t,y,u,z,D,A,c){d=class extends x{constructor(a,b){super(a,b);this.headingLevel=3;this.messages=null;
this.viewModel=new t;this._onNewSliceClick=()=>{v.ignoreAbortErrors(this.viewModel.start())}}loadDependencies(){return y.loadCalciteComponents({action:()=>new Promise((a,b)=>p(["../chunks/calcite-action"],a,b)),button:()=>new Promise((a,b)=>p(["../chunks/calcite-button"],a,b)),"list-item":()=>new Promise((a,b)=>p(["../chunks/calcite-list-item"],a,b)),list:()=>new Promise((a,b)=>p(["../chunks/calcite-list"],a,b))})}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(a){this.viewModel.analysis=
a}get excludedLayers(){return this.viewModel.excludedLayers}set excludedLayers(a){this.viewModel.excludedLayers=a}get excludeGroundSurface(){return this.viewModel.excludeGroundSurface}set excludeGroundSurface(a){this.viewModel.excludeGroundSurface=a}get icon(){return"slice"}set icon(a){this._overrideIfSome("icon",a)}get label(){return this.messages?.widgetLabel??""}set label(a){this._overrideIfSome("label",a)}get view(){return this.viewModel.view}set view(a){this.viewModel.view=a}get visible(){return this.viewModel.visible}set visible(a){this.viewModel.visible=
a}get hasVoxelLayers(){const a=this.viewModel?.view;return null!=a?a.allLayerViews.some(b=>"voxel-3d"===b.type):!1}render(){return c.tsx("div",{class:this.classes("esri-slice",u.globalCss.widget,u.globalCss.panel),role:"presentation"},this.visible?c.tsx("div",{class:"esri-slice__container"},this.viewModel.supported?[this._renderHint(),this._renderLayerList(),this._renderActions()]:this._renderUnsupported()):null)}_renderUnsupported(){return c.tsx("div",{class:"esri-slice__error",key:"unsupported"},
c.tsx("p",null,this.messages.unsupported))}_renderHint(){const {hasVoxelLayers:a,messages:b,viewModel:m}=this,{active:h,layersMode:k,state:n}=m;let g=null;h&&("exclude"===k?g=b.excludeHint:"ready"===n&&(g=a?b.voxelHint:b.hint));return g?c.tsx("div",{class:"esri-slice__hint",key:"hint"},c.tsx("p",{class:"esri-slice__hint-text"},g),c.tsx("p",{class:"esri-slice__hint-text"},b.verticalHint)):null}_renderLayerList(){const {excludedLayers:a,excludeGroundSurface:b,headingLevel:m,messages:h,viewModel:k}=
this,{layersMode:n,state:g}=k,l="slicing"===g||"sliced"===g,r=a?a.toArray().map(q=>this._renderLayerItem({uid:q.uid,title:q.title,onClick:()=>{this.excludedLayers.remove(q);return!1}})):[];b&&r.push(this._renderLayerItem({uid:"ground",title:h.ground,onClick:()=>this.excludeGroundSurface=!1}));return"exclude"!==n&&l&&0!==r.length?c.tsx("div",{class:"esri-slice__layer-list",key:"settings"},c.tsx(z.Heading,{class:"esri-slice__layer-list-title",level:m},h.excludedLayers),c.tsx("calcite-list",{selectionMode:"none"},
r)):null}_renderActions(){const {messages:a,viewModel:b}=this,{active:m,state:h}=b,k="disabled"===h,n="slicing"===h||"sliced"===h,g="exclude"===b.layersMode,l=[];m&&!n||g||l.push(c.tsx("calcite-button",{class:"esri-slice__clear-button",disabled:k,key:"new-slice",onclick:this._onNewSliceClick},a.newSlice));n&&!g&&l.push(c.tsx("calcite-button",{appearance:"outline-fill",class:"esri-slice__exclude-button",disabled:k,key:"exclude",onclick:()=>b.enterExcludeLayerMode()},a.excludeLayer));m&&g&&l.push(c.tsx("calcite-button",
{appearance:"outline-fill",class:"esri-slice__cancel-button",disabled:k,key:"cancel-exclude",onclick:()=>b.exitExcludeLayerMode()},a.cancel));return 0===l.length?null:c.tsx("div",{class:"esri-slice__actions"},l)}_renderLayerItem(a){const b=this.messages.includeLayer;return c.tsx("calcite-list-item",{class:"esri-slice__layer-item",key:a.uid,label:a.title??""},c.tsx("calcite-action",{icon:"x",onclick:a.onClick,scale:"s",slot:"actions-end",text:b,title:b}))}};e.__decorate([f.property()],d.prototype,
"active",null);e.__decorate([f.property({constructOnly:!0,nonNullable:!0})],d.prototype,"analysis",null);e.__decorate([f.property()],d.prototype,"excludedLayers",null);e.__decorate([f.property()],d.prototype,"excludeGroundSurface",null);e.__decorate([f.property()],d.prototype,"headingLevel",void 0);e.__decorate([f.property()],d.prototype,"icon",null);e.__decorate([f.property()],d.prototype,"label",null);e.__decorate([f.property(),A.messageBundle("esri/widgets/Slice/t9n/Slice")],d.prototype,"messages",
void 0);e.__decorate([f.property()],d.prototype,"view",null);e.__decorate([f.property({type:t})],d.prototype,"viewModel",void 0);e.__decorate([f.property()],d.prototype,"visible",null);e.__decorate([f.property()],d.prototype,"hasVoxelLayers",null);return d=e.__decorate([w.subclass("esri.widgets.Slice")],d)});