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.
 
 

14 lines
5.6 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 ../request ../core/Error ../core/Logger ../core/mathUtils ../core/MultiOriginJSONSupport ../core/promiseUtils ../core/accessorSupport/decorators/property ../core/has ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../chunks/vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ../geometry/ellipsoidUtils ../geometry/Extent ../geometry/SpatialReference ../geometry/projection/projectBuffer ./Layer ./mixins/APIKeyMixin ./mixins/ArcGISService ./mixins/CustomParametersMixin ./mixins/OperationalLayer ./mixins/PortalLayer ./mixins/ScaleRangeLayer ./support/commonProperties ../support/elevationInfoUtils".split(" "),
function(l,z,A,v,q,h,w,m,J,K,B,d,g,t,n,p,u,C,D,E,F,G,H,I,x,r){h=class extends E.ArcGISService(G.OperationalLayer(H.PortalLayer(I.ScaleRangeLayer(h.MultiOriginJSONMixin(F.CustomParametersMixin(D.APIKeyMixin(C))))))){constructor(c){super(c);this.operationalLayerType="IntegratedMesh3DTilesLayer";this.spatialReference=new p({wkid:4326,vcsWkid:115700});this.fullExtent=new n(-180,-90,180,90,this.spatialReference);this.url=null;this.type="integrated-mesh-3dtiles";this.path=null;this.maxScale=this.minScale=
0}set elevationInfo(c){this._set("elevationInfo",c);this._validateElevationInfo()}_verifyArray(c,b){if(!Array.isArray(c)||c.length<b)return!1;for(const a of c)if("number"!==typeof a)return!1;return!0}_initFullExtent(c){var b=c.root?.boundingVolume;if(b){if(b.box){var a=b?.box;if(7972671<a[3]&&7972671<a[7]&&7945940<a[11])return}c=c.root?.transform;a=g.create();if(b.region&&this._verifyArray(b.region,6)){c=b.region;a=q.rad2deg(c[0]);b=q.rad2deg(c[1]);var e=c[4],k=q.rad2deg(c[2]),f=q.rad2deg(c[3]);this.fullExtent=
new n({xmin:a,ymin:b,zmin:e,xmax:k,ymax:f,zmax:c[5],spatialReference:this.spatialReference})}else if(b.sphere&&this._verifyArray(b.sphere,4))b=b.sphere,k=g.fromValues(b[0],b[1],b[2]),f=b[3]/Math.sqrt(3),b=g.create(),d.subtract(b,k,g.fromValues(f,f,f)),e=g.create(),d.add(e,k,g.fromValues(f,f,f)),c&&this._verifyArray(c,16)&&(d.transformMat4(a,b,c),d.copy(b,a),d.transformMat4(a,e,c),d.copy(e,a)),u.projectBuffer(b,t.WGS84ECEFSpatialReferenceLike,0,b,p.WGS84,0,1),u.projectBuffer(e,t.WGS84ECEFSpatialReferenceLike,
0,e,p.WGS84,0,1),c=g.create(),a=g.create(),d.min(c,b,e),d.max(a,b,e),this.fullExtent=new n({xmin:c[0],ymin:c[1],zmin:c[2],xmax:a[0],ymax:a[1],zmax:a[2],spatialReference:this.spatialReference});else if(b.box&&this._verifyArray(b.box,12)){a=b.box;b=g.fromValues(a[0],a[1],a[2]);e=g.fromValues(a[3],a[4],a[5]);k=g.fromValues(a[6],a[7],a[8]);f=g.fromValues(a[9],a[10],a[11]);a=[];for(let y=0;8>y;++y)a.push(g.create());d.add(a[0],b,e);d.add(a[0],a[0],k);d.add(a[0],a[0],f);d.sub(a[1],b,e);d.add(a[1],a[1],
k);d.add(a[1],a[1],f);d.add(a[2],b,e);d.sub(a[2],a[2],k);d.add(a[2],a[2],f);d.sub(a[3],b,e);d.sub(a[3],a[3],k);d.add(a[3],a[3],f);d.add(a[4],b,e);d.add(a[4],a[4],k);d.sub(a[4],a[4],f);d.sub(a[5],b,e);d.add(a[5],a[5],k);d.sub(a[5],a[5],f);d.add(a[6],b,e);d.sub(a[6],a[6],k);d.sub(a[6],a[6],f);d.sub(a[7],b,e);d.sub(a[7],a[7],k);d.sub(a[7],a[7],f);if(c&&this._verifyArray(c,16))for(b=0;8>b;++b)d.transformMat4(a[b],a[b],c);c=g.fromValues(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);b=g.fromValues(Number.MAX_VALUE,
Number.MAX_VALUE,Number.MAX_VALUE);for(e=0;8>e;++e)u.projectBuffer(a[e],t.WGS84ECEFSpatialReferenceLike,0,a[e],p.WGS84,0,1),d.min(b,b,a[e]),d.max(c,c,a[e]);this.fullExtent=new n({xmin:b[0],ymin:b[1],zmin:b[2],xmax:c[0],ymax:c[1],zmax:c[2],spatialReference:this.spatialReference})}}}async load(c){this.addResolvingPromise(this._doLoad(c));return this}async _doLoad(c){const b=null!=c?c.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:a=>{if(a.typeKeywords?.includes("IntegratedMesh"))return!0;
throw new A("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"});}},c)}catch(a){w.throwIfAbortError(a)}this.url&&await z(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:b}).then(a=>{this._initFullExtent(a.data)},a=>{w.throwIfAbortError(a)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const c=this.elevationInfo;r.logInvalidElevationInfoWarning(v.getLogger(this),
r.elevationModeRequiredMessage("Integrated mesh 3d tiles layers","absolute-height",c));r.logInvalidElevationInfoWarning(v.getLogger(this),r.featureExpressionUnsupportedMessage("Integrated mesh 3d tiles layers",c))}};l.__decorate([m.property({type:["IntegratedMesh3DTilesLayer"]})],h.prototype,"operationalLayerType",void 0);l.__decorate([m.property({type:p})],h.prototype,"spatialReference",void 0);l.__decorate([m.property({type:n})],h.prototype,"fullExtent",void 0);l.__decorate([m.property(x.elevationInfo)],
h.prototype,"elevationInfo",null);l.__decorate([m.property({type:["show","hide"]})],h.prototype,"listMode",void 0);l.__decorate([m.property(x.url)],h.prototype,"url",void 0);l.__decorate([m.property({readOnly:!0})],h.prototype,"type",void 0);l.__decorate([m.property({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],h.prototype,"path",void 0);l.__decorate([m.property({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,
write:!1}}}})],h.prototype,"minScale",void 0);l.__decorate([m.property({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],h.prototype,"maxScale",void 0);return h=l.__decorate([B.subclass("esri.layers.IntegratedMesh3DTilesLayer")],h)});