Files
ADHA_mobile_project/assets/QueryTask-d8c13580.js
T
2024-02-28 17:06:42 +05:00

2 lines
8.1 KiB
JavaScript

import{aU as y,aV as _,ab as T,A as a,B as c,eX as D,C as A,bk as w,I as Q,Y as P,E as j,eY as d,_ as n,bN as h,bO as f,s as q}from"./index-b5c8f851.js";import{n as L,s as N}from"./executeForIds-8a8c155e.js";import{x as J}from"./query-cd419ad0.js";import{a as $}from"./executeQueryJSON-b554ead2.js";import{n as z}from"./executeQueryPBF-95281324.js";async function C(e,t,r){const o=y(e);return J(o,_.from(t),{...r}).then(s=>({count:s.data.count,extent:T.fromJSON(s.data.extent)}))}let i=class extends w{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return Q(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){var u;const r=this._normalizeQuery(e),o=((u=e.outStatistics)==null?void 0:u[0])!=null,s=P("featurelayer-pbf-statistics"),l=!o||s;let p;if(this.pbfSupported&&l)try{p=await z(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&l||(p=await $(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return j.fromJSON(t);const{meshFeatureSetFromJSON:o}=await d(n(()=>import("./meshFeatureSet-b57dd5d4.js").then(s=>s.b),["assets/meshFeatureSet-b57dd5d4.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/georeference-f533c6ae.js","assets/mat4f64-1413b4a7.js","assets/spatialReferenceEllipsoidUtils-bc18a3f3.js","assets/MeshLocalVertexSpace-702f1ae9.js","assets/MeshGeoreferencedRelativeVertexSpace-7e8894cd.js","assets/quat-59e6d063.js","assets/quatf64-3363c48e.js","assets/vec32-567858f4.js","assets/BufferView-db785e2d.js","assets/earcut-d423749e.js","assets/Indices-8bd7636c.js","assets/deduplicate-d84e5ef3.js","assets/plane-66dd48d1.js","assets/sphere-5667aa69.js","assets/ByteSizeUnit-d4757d40.js","assets/triangle-f93283ef.js","assets/lineSegment-95273d56.js","assets/basicInterfaces-11f56cb3.js","assets/VertexAttribute-0e674613.js","assets/External-7e16e2e2.js"]),r);return o(e,this.infoFor3D,t)}executeForCount(e,t){return L(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return C(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return N(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:o}]=await d(Promise.all([n(()=>import("./index-b5c8f851.js").then(s=>s.mK),["assets/index-b5c8f851.js","assets/index-86716609.css"]),n(()=>import("./executeRelationshipQuery-08f38fef.js"),["assets/executeRelationshipQuery-08f38fef.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/query-cd419ad0.js","assets/pbfQueryUtils-e46c5add.js","assets/pbf-eb90fa42.js","assets/OptimizedGeometry-d94e541f.js","assets/OptimizedFeatureSet-1d1ac4b9.js"])]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:o}]=await d(Promise.all([n(()=>import("./index-b5c8f851.js").then(s=>s.mK),["assets/index-b5c8f851.js","assets/index-86716609.css"]),n(()=>import("./executeRelationshipQuery-08f38fef.js"),["assets/executeRelationshipQuery-08f38fef.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/query-cd419ad0.js","assets/pbfQueryUtils-e46c5add.js","assets/pbf-eb90fa42.js","assets/OptimizedGeometry-d94e541f.js","assets/OptimizedFeatureSet-1d1ac4b9.js"])]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:o,processAttachmentQueryResult:s}=await d(n(()=>import("./queryAttachments-94d92981.js"),["assets/queryAttachments-94d92981.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/query-cd419ad0.js","assets/pbfQueryUtils-e46c5add.js","assets/pbf-eb90fa42.js","assets/OptimizedGeometry-d94e541f.js","assets/OptimizedFeatureSet-1d1ac4b9.js","assets/AttachmentInfo-36750a43.js"]),t),l=y(this.url);return s(l,await(this.queryAttachmentsSupported?r(l,e,t):o(l,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await d(n(()=>import("./executeTopFeaturesQuery-68811e0e.js"),["assets/executeTopFeaturesQuery-68811e0e.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/queryTopFeatures-96823f9a.js","assets/query-cd419ad0.js","assets/pbfQueryUtils-e46c5add.js","assets/pbf-eb90fa42.js","assets/OptimizedGeometry-d94e541f.js","assets/OptimizedFeatureSet-1d1ac4b9.js"]),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await d(n(()=>import("./executeForTopIds-240abdf8.js"),["assets/executeForTopIds-240abdf8.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/queryTopFeatures-96823f9a.js","assets/query-cd419ad0.js","assets/pbfQueryUtils-e46c5add.js","assets/pbf-eb90fa42.js","assets/OptimizedGeometry-d94e541f.js","assets/OptimizedFeatureSet-1d1ac4b9.js"]),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await d(n(()=>import("./executeForTopExtents-cdeb9acb.js"),["assets/executeForTopExtents-cdeb9acb.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/queryTopFeatures-96823f9a.js","assets/query-cd419ad0.js","assets/pbfQueryUtils-e46c5add.js","assets/pbf-eb90fa42.js","assets/OptimizedGeometry-d94e541f.js","assets/OptimizedFeatureSet-1d1ac4b9.js"]),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await d(n(()=>import("./executeForTopCount-95aff482.js"),["assets/executeForTopCount-95aff482.js","assets/index-b5c8f851.js","assets/index-86716609.css","assets/queryTopFeatures-96823f9a.js","assets/query-cd419ad0.js","assets/pbfQueryUtils-e46c5add.js","assets/pbf-eb90fa42.js","assets/OptimizedGeometry-d94e541f.js","assets/OptimizedFeatureSet-1d1ac4b9.js"]),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?D.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:o,queryFormats:s}=r,l=h("model/gltf-binary",o)??f("glb",o),p=h("model/gltf+json",o)??f("gtlf",o);for(const u of s){if(u===l){t.formatOf3DObjects=u;break}u!==p||t.formatOf3DObjects||(t.formatOf3DObjects=u)}if(!t.formatOf3DObjects)throw new q("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:u,originY:m,originZ:S,translationX:b,translationY:F,translationZ:O,scaleX:x,scaleY:g,scaleZ:V,rotationX:E,rotationY:R,rotationZ:I,rotationDeg:v}=r.transformFieldRoles;t.outFields.push(u,m,S,b,F,O,x,g,V,E,R,I,v)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};a([c({type:D})],i.prototype,"dynamicDataSource",void 0),a([c()],i.prototype,"fieldsIndex",void 0),a([c()],i.prototype,"gdbVersion",void 0),a([c()],i.prototype,"infoFor3D",void 0),a([c({readOnly:!0})],i.prototype,"parsedUrl",null),a([c()],i.prototype,"pbfSupported",void 0),a([c()],i.prototype,"queryAttachmentsSupported",void 0),a([c()],i.prototype,"sourceSpatialReference",void 0),a([c({type:String})],i.prototype,"url",void 0),i=a([A("esri.tasks.QueryTask")],i);const K=i;export{K as x};