@arcgis/core 5.1.0-next.117 → 5.1.0-next.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.d.ts +2 -1
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -9
- package/analysis/ShadowCastAnalysis.d.ts +6 -5
- package/arcgisGlobal.d.ts +2 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{86a767c2b0b1e37ff493.js → 06ab868cced9c607840c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f231548c8ac7ecb59927.js → 0fbf9bf52ecb4cd8293b.js} +1 -1
- package/assets/esri/core/workers/chunks/{e6e15e9e890b864fb395.js → 107550695896806c2306.js} +1 -1
- package/assets/esri/core/workers/chunks/1a527c0740d9f4fa0791.js +1 -0
- package/assets/esri/core/workers/chunks/{a814069325125466506b.js → 1a95370ddc22729ab3c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{c88fd4f69cb2b53b48ec.js → 1b0765403b06294b3e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf3036711bbe6095eaed.js → 1dd1af5978e40295fb62.js} +1 -1
- package/assets/esri/core/workers/chunks/{425c04b26a6ec6d04b08.js → 201007cf1a91e2b126fc.js} +1 -1
- package/assets/esri/core/workers/chunks/20e2d11f6de438ee883e.js +1 -0
- package/assets/esri/core/workers/chunks/{db012650fb34c10cecd0.js → 24acf3dd541347c2b297.js} +1 -1
- package/assets/esri/core/workers/chunks/{94a5a834e32fc6cc6ed4.js → 2e11b4e9d66474a60064.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e7ce4835b3106349684.js → 2ee9514396d22638870c.js} +1 -1
- package/assets/esri/core/workers/chunks/{62b5972d0ef9bf173308.js → 2f2cb40378399d7f5575.js} +1 -1
- package/assets/esri/core/workers/chunks/{102ff3710db4ba5f083d.js → 3bf6d55511cd7722eb93.js} +1 -1
- package/assets/esri/core/workers/chunks/40df6ffeb61fea80aae3.js +1 -0
- package/assets/esri/core/workers/chunks/{7df05c3c82cd27b77300.js → 423a9882abd4a6dadf86.js} +1 -1
- package/assets/esri/core/workers/chunks/{ba693317ed3939587f30.js → 46ca0d8573450095fcca.js} +1 -1
- package/assets/esri/core/workers/chunks/46d3ddf62fa7a76dd57d.js +1 -0
- package/assets/esri/core/workers/chunks/{51816d79c6be15e4bfcf.js → 46fbd519cc1a37923bfc.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0c242c4f5412e4cce73.js → 47d49777a3b3cd8e18bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{22d4521637806a8b828f.js → 4bfffdfbe6d467f143a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{7c2d7df4ef4d775cd648.js → 4d09ef7c57ab7f9782fe.js} +1 -1
- package/assets/esri/core/workers/chunks/{dce37324a2382d2eef0d.js → 552945a73a95cd2a9f54.js} +1 -1
- package/assets/esri/core/workers/chunks/5784ddd18395f4d76016.js +640 -0
- package/assets/esri/core/workers/chunks/{0a530fbbb4486c670ea2.js → 5c7aff9604b4576a0e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0954e82f739d25001bcb.js → 603177137eb680afe371.js} +1 -1
- package/assets/esri/core/workers/chunks/62206d5d497b95fc4caf.js +1 -0
- package/assets/esri/core/workers/chunks/{4cecc582513b8a83f194.js → 65621650a53f69f7b05a.js} +1 -1
- package/assets/esri/core/workers/chunks/{24b43fb12fc3009fdc30.js → 66eea3f203c3ce98ec67.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e97c01698ef36cc5e0e.js → 74bdf678a4fb6befdac7.js} +1 -1
- package/assets/esri/core/workers/chunks/{92a7735973b2f82a66ce.js → 74fd31d5404a061bfaed.js} +1 -1
- package/assets/esri/core/workers/chunks/7623778e065bc78ccbba.js +1 -0
- package/assets/esri/core/workers/chunks/{f69c44479ee3fd8c831d.js → 7d220f574ebf2740c208.js} +1 -1
- package/assets/esri/core/workers/chunks/{6af88bb722bbb37db198.js → 7e4571162b86dad86d23.js} +2 -2
- package/assets/esri/core/workers/chunks/{e95ce76b5b816256a519.js → 7f54d3835c0ce573a942.js} +1 -1
- package/assets/esri/core/workers/chunks/804ab5f614efa12a131b.js +1 -0
- package/assets/esri/core/workers/chunks/823789261ca3338f0fa8.js +1 -0
- package/assets/esri/core/workers/chunks/{5cdf87e7a59ace38df87.js → 84b0b6e099d949e0fea5.js} +1 -1
- package/assets/esri/core/workers/chunks/{702a3ef9e1b3442cbee7.js → 8b8b63be961eb73250a0.js} +1 -1
- package/assets/esri/core/workers/chunks/8e1865392681d390ab2e.js +1 -0
- package/assets/esri/core/workers/chunks/93826180cfd66a6d2596.js +1 -0
- package/assets/esri/core/workers/chunks/{90b0fe5584fb6fc99766.js → 9d27cc631bab8aa7479e.js} +1 -1
- package/assets/esri/core/workers/chunks/{55d168c13491fcdfb284.js → 9dd3ecee6c1c9c06edc4.js} +1 -1
- package/assets/esri/core/workers/chunks/a730235da6ba2b2d9f47.js +30 -0
- package/assets/esri/core/workers/chunks/{762e23466308f22d7076.js → aea384f4d88121da8f54.js} +1 -1
- package/assets/esri/core/workers/chunks/be70809bc6c718ade7df.js +1 -0
- package/assets/esri/core/workers/chunks/bfc988edc63ca28e5397.js +2 -0
- package/assets/esri/core/workers/chunks/c44be4aaba829e6d149d.js +1 -0
- package/assets/esri/core/workers/chunks/{d21bf107698fef03125e.js → ce77a0e074c17dfd02bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{b44f1d08784f2e50c853.js → d3af51a6d9014ff46170.js} +1 -1
- package/assets/esri/core/workers/chunks/{6a53c8db554be55c5885.js → d5e6ae5fd004bed33578.js} +1 -1
- package/assets/esri/core/workers/chunks/{544174c33628846284a1.js → e078ff1f79d82d27497e.js} +1 -1
- package/assets/esri/core/workers/chunks/e178cd0e9178d6716410.js +1 -0
- package/assets/esri/core/workers/chunks/{185c670eb99474906836.js → edb55329305becdb204f.js} +1 -1
- package/assets/esri/core/workers/chunks/{fc9fbc8e4e459edf4e37.js → f3f685c937e9d7f5d4db.js} +1 -1
- package/assets/esri/core/workers/chunks/f58ddf37dee066a5c0d8.js +1 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +27 -4
- package/assets/esri/themes/base/widgets/_Grid.scss +3 -3
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/ShadowCastVisualize.glsl.js +20 -23
- package/config.js +1 -1
- package/editing/templates/{TemplateListing.d.ts → TemplateListItem.d.ts} +35 -6
- package/editing/templates/{TemplateListing.js → TemplateListItem.js} +1 -1
- package/interfaces.d.ts +7 -0
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +28 -2
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/mixins/TiledImagery.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/RasterFactory.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/SymbolLayerDrawing.d.ts +10 -0
- package/layers/support/rasterJobHelper.js +2 -0
- package/layers/types.d.ts +2 -3
- package/package.json +2 -2
- package/rest/support/AttributeBinsQuery.d.ts +5 -5
- package/rest/support/OutDistance.d.ts +50 -0
- package/rest/support/OutDistance.js +1 -1
- package/rest/support/Query.d.ts +46 -5
- package/rest/support/TopFeaturesQuery.d.ts +5 -5
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/layers/ImageryLayerView.d.ts +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm.d.ts +26 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/assets/esri/core/workers/chunks/074f5e6aaeafca13bf72.js +0 -1
- package/assets/esri/core/workers/chunks/0e9804ece1fd2d59751b.js +0 -1
- package/assets/esri/core/workers/chunks/1da2c34743897d1b6a24.js +0 -1
- package/assets/esri/core/workers/chunks/32f24a66f684de3c243d.js +0 -1
- package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +0 -1
- package/assets/esri/core/workers/chunks/4325fa92dafca465ae26.js +0 -1
- package/assets/esri/core/workers/chunks/438f35d41c6851736818.js +0 -30
- package/assets/esri/core/workers/chunks/708bd77e6d723e3f0aa8.js +0 -1
- package/assets/esri/core/workers/chunks/75a7de23c05435ec7649.js +0 -1
- package/assets/esri/core/workers/chunks/87a40e7f79f97ca637a9.js +0 -1
- package/assets/esri/core/workers/chunks/8a68884d40f6f6de1d12.js +0 -1
- package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +0 -640
- package/assets/esri/core/workers/chunks/978b7d10054e17161145.js +0 -1
- package/assets/esri/core/workers/chunks/a0fce639319d59becd01.js +0 -2
- package/assets/esri/core/workers/chunks/aa03f770178693167aa0.js +0 -1
- package/assets/esri/core/workers/chunks/b78fb24b47d9f31f18c6.js +0 -1
- package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +0 -1
- /package/assets/esri/core/workers/chunks/{6af88bb722bbb37db198.js.LICENSE.txt → 7e4571162b86dad86d23.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{a0fce639319d59becd01.js.LICENSE.txt → bfc988edc63ca28e5397.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../config.js";import{id as r}from"../../kernel.js";import s from"../../request.js";import{result as i}from"../../core/asyncUtils.js";import a from"../../core/Error.js";import{abortHandle as o}from"../../core/handleUtils.js";import l from"../../core/Logger.js";import{destroyMaybe as p}from"../../core/maybe.js";import{throwIfAborted as n,isAbortError as u,throwIfAbortError as d}from"../../core/promiseUtils.js";import{hasSameCanonicalPortal as m,hasSamePortal as c,normalize as h}from"../../core/urlUtils.js";import{property as f,subclass as g}from"../../core/accessorSupport/decorators.js";import{getOwningPortalUrl as y}from"../support/layerUtils.js";import I from"../../portal/Portal.js";import v from"../../portal/PortalItem.js";import P from"../../portal/PortalUser.js";import{getUserPrivileges as w}from"../../portal/support/portalItemUtils.js";import{reader as U}from"../../core/accessorSupport/decorators/reader.js";import{writer as j}from"../../core/accessorSupport/decorators/writer.js";const _=_=>{const H=_;let b=class extends H{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=p(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new v({id:e.itemId,portal:r?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:r}=await import("../../portal/support/layersLoader.js");return n(e),await r({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},e)}catch(r){throw u(r)||l.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${r}`),r}}async reloadFromPortal(t){if(!this.loaded||!this.portalItem?.id)return!1;try{const{reload:e}=await import("../../portal/support/layersLoader.js"),r=new AbortController,s=o(r);return this.addHandles(s,"reloadFromPortal"),await e({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},{signal:r.signal})}catch(e){throw u(e)||l.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{this.removeHandles("reloadFromPortal")}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch(t=>(d(t),!0)))}async setUserPrivileges(t,r){if(!e.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:e,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(t,r);this._set("userHasEditingPrivileges",e),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(s){d(s)}}async _fetchUserPrivileges(t,e){let s=this.portalItem;if(!t||!s||!s.loaded||s.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=!r?.findCredential(this.url),a=t===s.id;if(a&&s.portal.user)return this._getUserPrivileges(s,i);let o,l;if(a)o=s.portal.url;else try{o=await y(this.url,e)}catch(c){d(c)}if(!o||!m(o,s.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;l=await(r?.getCredential(`${o}/sharing`,{prompt:!1,signal:t}))}catch(c){d(c)}const p=!0,n=!1,u=!1;if(!l)return{features:{edit:p,fullEdit:n},content:{updateItem:u}};try{if(a?await s.reload():(s=new v({id:t,portal:{url:o}}),await s.load(e)),s.portal.user)return this._getUserPrivileges(s,i)}catch(c){d(c)}return{features:{edit:p,fullEdit:n},content:{updateItem:u}}}_getUserPrivileges(t,e){const r=w(t);return e&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(r){d(r)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?r?.findCredential(this.url):null;if(!e)return!0;const s=E.credential===e?E.user:await this._fetchEditingUser(t);return E.credential=e,E.user=s,null==s?.privileges||s.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const a=r?.findServerInfo(this.url??"");if(!a?.owningSystemUrl)return null;const o=`${a.owningSystemUrl}/sharing/rest`,l=I.getDefault();if(l&&l.loaded&&h(l.restUrl)===h(o))return l.user;const p=`${o}/community/self`,n=null!=t?t.signal:null,u=await i(s(p,{authMode:"no-prompt",query:{f:"json"},signal:n}));return u.ok?P.fromJSON(u.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e?.portal,s=this.portalItem?.id&&(this.portalItem.portal||I.getDefault());return r&&s&&!c(s.restUrl,r.restUrl)?(e.messages&&e.messages.push(new a("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return t([f({type:v})],b.prototype,"portalItem",null),t([U("web-document","portalItem",["itemId"])],b.prototype,"readPortalItem",null),t([j("web-document","portalItem",{itemId:{type:String}})],b.prototype,"writePortalItem",null),t([f({clonable:!1})],b.prototype,"resourceReferences",void 0),t([f({type:Boolean,readOnly:!0})],b.prototype,"userHasEditingPrivileges",void 0),t([f({type:Boolean,readOnly:!0})],b.prototype,"userHasFullEditingPrivileges",void 0),t([f({type:Boolean,readOnly:!0})],b.prototype,"userHasUpdateItemPrivileges",void 0),b=t([g("esri.layers.mixins.PortalLayer")],b),b},E={credential:null,user:null};export{_ as PortalLayer};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../config.js";import{id as r}from"../../kernel.js";import s from"../../request.js";import{result as i}from"../../core/asyncUtils.js";import a from"../../core/Error.js";import{abortHandle as o}from"../../core/handleUtils.js";import l from"../../core/Logger.js";import{destroyMaybe as p}from"../../core/maybe.js";import{throwIfAborted as n,isAbortError as u,throwIfAbortError as d}from"../../core/promiseUtils.js";import{hasSameCanonicalPortal as m,hasSamePortal as c,normalize as h}from"../../core/urlUtils.js";import{property as f,subclass as g}from"../../core/accessorSupport/decorators.js";import{getOwningPortalUrl as y}from"../support/layerUtils.js";import I from"../../portal/Portal.js";import v from"../../portal/PortalItem.js";import P from"../../portal/PortalUser.js";import{getUserPrivileges as w}from"../../portal/support/portalItemUtils.js";import{reader as U}from"../../core/accessorSupport/decorators/reader.js";import{writer as j}from"../../core/accessorSupport/decorators/writer.js";const _=_=>{const H=_;let b=class extends H{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){super.destroy(),this.portalItem=p(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}get portalItem(){return this._get("portalItem")}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new v({id:e.itemId,portal:r?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:r}=await import("../../portal/support/layersLoader.js");return n(e),await r({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},e)}catch(r){throw u(r)||l.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${r}`),r}}async reloadFromPortal(t){if(!this.loaded||!this.portalItem?.id)return!1;try{const{reload:e}=await import("../../portal/support/layersLoader.js"),r=new AbortController,s=o(r);return this.addHandles(s,"reloadFromPortal"),await e({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},{signal:r.signal})}catch(e){throw u(e)||l.getLogger(this).warn(`Failed to reload layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}finally{this.removeHandles("reloadFromPortal")}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch(t=>(d(t),!0)))}async setUserPrivileges(t,r){if(!e.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:e,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(t,r);this._set("userHasEditingPrivileges",e),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(s){d(s)}}async _fetchUserPrivileges(t,e){let s=this.portalItem;if(!t||!s||!s.loaded||s.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=!r?.findCredential(this.url),a=t===s.id;if(a&&s.portal.user)return this._getUserPrivileges(s,i);let o,l;if(a)o=s.portal.url;else try{o=await y(this.url,e)}catch(c){d(c)}if(!o||!m(o,s.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;l=await(r?.getCredential(`${o}/sharing`,{prompt:!1,signal:t}))}catch(c){d(c)}const p=!0,n=!1,u=!1;if(!l)return{features:{edit:p,fullEdit:n},content:{updateItem:u}};try{if(a?await s.reload():(s=new v({id:t,portal:{url:o}}),await s.load(e)),s.portal.user)return this._getUserPrivileges(s,i)}catch(c){d(c)}return{features:{edit:p,fullEdit:n},content:{updateItem:u}}}_getUserPrivileges(t,e){const r=w(t);return e&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(r){d(r)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?r?.findCredential(this.url):null;if(!e)return!0;const s=E.credential===e?E.user:await this._fetchEditingUser(t);return E.credential=e,E.user=s,null==s?.privileges||s.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const a=r?.findServerInfo(this.url??"");if(!a?.owningSystemUrl)return null;const o=`${a.owningSystemUrl}/sharing/rest`,l=I.getDefault();if(l&&l.loaded&&h(l.restUrl)===h(o))return l.user;const p=`${o}/community/self`,n=null!=t?t.signal:null,u=await i(s(p,{authMode:"no-prompt",query:{f:"json"},signal:n}));return u.ok?P.fromJSON(u.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e?.portal,s=this.portalItem?.id&&(this.portalItem.portal||I.getDefault());return r&&s&&!c(s.restUrl,r.restUrl)?(e.messages&&e.messages.push(new a("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return t([f({type:v})],b.prototype,"portalItem",null),t([U("web-document","portalItem",["itemId"])],b.prototype,"readPortalItem",null),t([j("web-document","portalItem",{itemId:{type:String}})],b.prototype,"writePortalItem",null),t([f({clonable:!1})],b.prototype,"resourceReferences",void 0),t([f({type:Boolean,readOnly:!0})],b.prototype,"userHasEditingPrivileges",void 0),t([f({type:Boolean,readOnly:!0})],b.prototype,"userHasFullEditingPrivileges",void 0),t([f({type:Boolean,readOnly:!0})],b.prototype,"userHasUpdateItemPrivileges",void 0),b=t([g("esri.layers.mixins.PortalLayer")],b),b},E={credential:null,user:null};export{_ as PortalLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{Integer as o,ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{getInfo as m}from"../../geometry/support/spatialReferenceUtils.js";import{isFunctionRaster as c}from"../raster/datasets/datasetUtils.js";import d from"../raster/datasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as p,getDefaultVariableInfo as h,isMultiSliceOrRangeDefinition as f,convertOleDateTimeToEpoch as y,getSubsetVariablesFromMdInfo as g,getDefaultMultidimensionalDefinition as R}from"../raster/datasets/multidimensionalUtils.js";import{snapToRaster as b,clip as I}from"../raster/functions/clipUtils.js";import{create as w}from"../raster/functions/rasterFunctionHelper.js";import{load as x,projectExtent as S,projectPolygon as F}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as _}from"../raster/functions/stretchUtils.js";import{sanitizeUrl as v}from"../support/arcgisLayerUrl.js";import{url as J}from"../support/commonProperties.js";import j from"../support/DimensionalDefinition.js";import{createTileBitmap as D}from"../support/imageBitmapUtils.js";import N from"../support/MultidimensionalSubset.js";import{interpolationKebab as T}from"../support/rasterEnums.js";import H from"../support/RasterFunction.js";import C from"../support/RasterJobHandler.js";import O from"../support/TileInfo.js";import{getVariableRasterInfo as P,getDefaultInterpolation as z,matchPresetRenderer as E,getDefaultBandCombination as B,getFunctionColorRamp as U,createDefaultRenderer as M,normalizeRendererJSON as A}from"../../renderers/support/rasterRendererHelper.js";import q from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as k,websceneRasterRendererTypes as L,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";import{enumeration as Q}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as X}from"../../core/accessorSupport/decorators/reader.js";const Y=1e3,Z=Z=>{const ee=Z;let te=class extends ee{constructor(...e){super(...e),this._draRasterConfig=null,this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=c(e[0]?.raster)}destroy(){this._draRasterConfig?.rasterJobHandler?.destroy(),this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",v(e,i.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const r=t?.find(({name:t})=>t===e);return r?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;return V(i,r)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=a($,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await x();const e="extent"===s.type?S(s,o):F(s,o);if(null==e)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const u=e.pixelSize??new l({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:m,width:c,height:d}=b(i,n,u),p=await this.fetchPixels(m,c,d,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new r("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await I(p.pixelBlock,m,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):_(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const r=p({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:r,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:r}=this;if(!e||!t||!r)return;const{rasterInfo:i}=this.raster,s=h(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(i,n);return this._updateSymbolizer(t,r,n,o)}async applyRenderer(e,t,r){const i=e?.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},r);return n}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&c(t)){const r=t.rasterFunction.rawInputBandIds;e=e?.length&&r?.length&&1!==t.rasterInfo.bandCount?e.map(e=>r[Math.min(e,r.length-1)]):r}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||null==t)return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=m(e);return O.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,r,i,s={}){if(re(this),s.requestAsImageElement){const n=this.getTileUrl(e,r,i),{data:o}=await t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal});return o}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,r,i,t);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),s={...s,refreshParameters:this.refreshParameters},this.raster.fetchTile(e,r,i,s)}async fetchImageBitmapTile(e,r,i,s={}){re(this);const n=this.getTileUrl(e,r,i),{data:o}=await t(n,{responseType:"blob",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s?.signal});return D(o,e,r,i,s)}async fetchPixels(e,t,r,i={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),r=Math.round(r);const s=await this.raster.fetchPixels(e,t,r,i);return i.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(s.pixelBlock=s.pixelBlock?.extractBands(i.bandIds)),s}async getSamples(e,t){await this.load();const i=a(W,e).clone();if(i.interpolation&&"nearest"!==i.interpolation)throw new r("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const s=i.mosaicRule?.multidimensionalDefinition,n={...t,multidimensionalDefinition:s},o=(await this._getSampleLocations(i)).map(e=>this.identify(e,n).then(t=>(t.location=e,t))),l=(await Promise.all(o)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new K({samples:l})}async identify(e,t={}){await this.load();const i=a(l,e).clone().normalize(),{raster:s,serviceRasterInfo:n}=this;if(null!=n?.multidimensionalInfo){if(!(n.hasMultidimensionalTranspose&&!(!f(t.multidimensionalDefinition)&&!t.transposedVariableName))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:i,value:null}}const o=this.multidimensionalSubset?.areaOfInterest;if(o&&!o.contains(i))throw new r("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let u;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=c(s)?this.getRawDisplayBandIds():this.bandIds;u=e?.length?e:void 0}return s.identify(i,{...t,bandIds:u})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,r=t?.[0]?.variableName;return e.variables.some(e=>e.name===r&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date(y(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return g(this.multidimensionalSubset,t)}async getDynamicRangeInputRaster(){if(!this.rasterFunction||!c(this.raster)||!this._cachedRasterFunctionJson)return null;const e=JSON.stringify(this._cachedRasterFunctionJson);if(this._draRasterConfig?.functionJson===e)return this._draRasterConfig;const t=this.raster.rasterFunction.queryRasterFunction(e=>"Stretch"===e.functionName&&e.functionArguments.dynamicRangeAdjustment);if(!t)return null;const r=t.toJSON(),i=this.raster.primaryRasters.rasters,s=t.functionArguments.raster,n=r.rasterFunctionArguments;if(!s||"object"!=typeof s||!("functionName"in s))return this._draRasterConfig={functionJson:e,raster:i[0],functionArguments:n,rasterJobHandler:this._draRasterConfig?.rasterJobHandler},this._draRasterConfig;const o={raster:i[0]};i.length>1&&i.forEach(e=>o[e.url]=e);const a=w(s.toJSON(),o),l=new d({rasterFunction:a});await l.open();let u=this._draRasterConfig?.rasterJobHandler;try{u||(u=new C,await u.initialize()),l.rasterJobHandler=u,await l.syncJobHandler()}catch{}return this._draRasterConfig={functionJson:e,raster:l,functionArguments:n,rasterJobHandler:u},this._draRasterConfig}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=R(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&c(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;re(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,c(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:r,type:i}=t;if("multipoint"===i)return t.points.map(e=>new l({x:e[0],y:e[1],spatialReference:r}));if("polyline"===i){let i=t;if(e.sampleCount||e.sampleDistance){const r=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Y);let o=e.sampleDistance;if(!o){o=s/(n+(2===i.paths[0].length?1:0))}i=r.execute(t,o,{unit:"meters"})}return i.paths.flatMap(e=>e.map(e=>new l({x:e[0],y:e[1],spatialReference:r})))}const s=Math.min(e.sampleCount||100,Y),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),u=o.height/a,m=o.width/a,{xmin:c,ymax:d}=o,p=[];for(let h=0;h<u;h++)for(let e=0;e<m;e++){const i=new l({x:c+(e+.5)*a,y:d-(h+.5)*a,spatialReference:r});(n||t.contains(i))&&p.push(i)}return p}_configDefaultInterpolation(){if(null==this.interpolation){re(this);const{raster:e}=this,t=z(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){re(this);const{rasterInfo:t}=this.raster,r=h(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=r?.name,n=E({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??B(t)),!this.renderer||"override"===e){const e=U(this.raster),r=n?.renderer??M(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),i=t.statistics,o=i&&i.length>0?i[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===r.type&&(a>1e24||l<-1e24)&&(r.dynamicRangeAdjustment=!0,r.customStatistics=null,"none"===r.stretchType&&(r.stretchType="min-max")),this.renderer=r}const o=A({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new q({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=M(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,r=t.customStatistics?.length;!t.dynamicRangeAdjustment&&r&&e&&r!==e&&this._configDefaultRenderer("override")}}}else i.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&c(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",H.fromJSON(e)))}let e,t=this.raster,r=!1;c(t)?(e=t.primaryRasters.rasters,t=e[0],r=!0):e=[t];const{rasterFunction:i}=this;if(i){const r={raster:t};e.length>1&&e.forEach(e=>r[e.url]=e);const s=w(i.functionDefinition?.toJSON()??i.toJSON(),r),n=new d({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!r&&!i)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some(e=>e>=n):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:r}=this.raster,i=r.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(r.pixelSize.x+r.pixelSize.y)/2*i;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach(({value:r,multidimensionalDefinition:i},o)=>{const a={Variables:i[0].variableName,Dimensions:i.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of i){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const r=t[t.length-1];a[`${e}_Max`]=Array.isArray(r)?r[r.length-1]:r}const l=new G({location:e.location,pixelValue:r,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)}),n}};function re(e){if(!e.raster||!e.serviceRasterInfo)throw new r("imagery-tile","no raster")}return e([s({clonable:!1})],te.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],te.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],te.prototype,"_draRasterConfig",void 0),e([s({clonable:!1})],te.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],te.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[o],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],te.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],te.prototype,"copyright",void 0),e([s({json:{read:!1}})],te.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),Q(T)],te.prototype,"interpolation",void 0),e([s()],te.prototype,"ioConfig",void 0),e([s({type:[j],json:{write:!0}})],te.prototype,"multidimensionalDefinition",null),e([s({type:N,json:{write:!0}})],te.prototype,"multidimensionalSubset",void 0),e([s()],te.prototype,"raster",void 0),e([s({type:H})],te.prototype,"rasterFunction",null),e([s()],te.prototype,"serviceRasterInfo",void 0),e([s()],te.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:u,json:{read:!1}})],te.prototype,"spatialReference",void 0),e([s({type:O})],te.prototype,"tileInfo",void 0),e([s(J)],te.prototype,"url",null),e([s({types:k})],te.prototype,"renderer",null),e([s({types:k,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:L,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],te.prototype,"internalRenderer",null),e([X("internalRenderer")],te.prototype,"readRenderer",null),e([s({clonable:!1})],te.prototype,"symbolizer",void 0),te=e([n("esri.layers.mixins.TiledImagery")],te),te};export{Z as TiledImagery};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{Integer as o,ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{getInfo as m}from"../../geometry/support/spatialReferenceUtils.js";import{isFunctionRaster as c}from"../raster/datasets/datasetUtils.js";import d from"../raster/datasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as p,getDefaultVariableInfo as h,isMultiSliceOrRangeDefinition as f,convertOleDateTimeToEpoch as y,getSubsetVariablesFromMdInfo as g,getDefaultMultidimensionalDefinition as R}from"../raster/datasets/multidimensionalUtils.js";import{snapToRaster as b,clip as I}from"../raster/functions/clipUtils.js";import{create as w}from"../raster/functions/rasterFunctionHelper.js";import{load as x,projectExtent as S,projectPolygon as _}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as F}from"../raster/functions/stretchUtils.js";import{sanitizeUrl as v}from"../support/arcgisLayerUrl.js";import{url as J}from"../support/commonProperties.js";import j from"../support/DimensionalDefinition.js";import{createTileBitmap as D}from"../support/imageBitmapUtils.js";import N from"../support/MultidimensionalSubset.js";import{interpolationKebab as T}from"../support/rasterEnums.js";import H from"../support/RasterFunction.js";import C from"../support/RasterJobHandler.js";import O from"../support/TileInfo.js";import{getVariableRasterInfo as P,getDefaultInterpolation as z,matchPresetRenderer as E,getDefaultBandCombination as B,getFunctionColorRamp as U,createDefaultRenderer as M,normalizeRendererJSON as A}from"../../renderers/support/rasterRendererHelper.js";import q from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as k,websceneRasterRendererTypes as L,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";import{enumeration as Q}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as X}from"../../core/accessorSupport/decorators/reader.js";const Y=1e3,Z=Z=>{const ee=Z;let te=class extends ee{constructor(...e){super(...e),this._draRasterConfig=null,this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=c(e[0]?.raster)}destroy(){this._draRasterConfig?.rasterJobHandler?.destroy(),this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",v(e,i.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const r=t?.find(({name:t})=>t===e);return r?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;return V(i,r)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=a($,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await x();const e="extent"===s.type?S(s,o):_(s,o);if(null==e)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const u=e.pixelSize??new l({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:m,width:c,height:d}=b(i,n,u),p=await this.fetchPixels(m,c,d,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new r("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await I(p.pixelBlock,m,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):F(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const r=p({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:r,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:r}=this;if(!e||!t||!r)return;const{rasterInfo:i}=this.raster,s=h(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(i,n);return this._updateSymbolizer(t,r,n,o)}async applyRenderer(e,t,r){const i=e?.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},r);return n}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&c(t)){const r=t.rasterFunction.rawInputBandIds;e=e?.length&&r?.length&&1!==t.rasterInfo.bandCount?e.map(e=>r[Math.min(e,r.length-1)]):r}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||null==t)return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=m(e);return O.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,r,i,s={}){if(re(this),s.requestAsImageElement){const n=this.getTileUrl(e,r,i),{data:o}=await t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal});return o}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,r,i,t);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),s={...s,refreshParameters:this.refreshParameters},this.raster.fetchTile(e,r,i,s)}async fetchImageBitmapTile(e,r,i,s={}){re(this);const n=this.getTileUrl(e,r,i),{data:o}=await t(n,{responseType:"blob",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s?.signal});return D(o,e,r,i,s)}async fetchPixels(e,t,r,i={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),r=Math.round(r);const s=await this.raster.fetchPixels(e,t,r,i);return i.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(s.pixelBlock=s.pixelBlock?.extractBands(i.bandIds)),s}async getSamples(e,t){await this.load();const i=a(W,e).clone();if(i.interpolation&&"nearest"!==i.interpolation)throw new r("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const s=i.mosaicRule?.multidimensionalDefinition,n={...t,multidimensionalDefinition:s},o=(await this._getSampleLocations(i)).map(e=>this.identify(e,n).then(t=>(t.location=e,t))),l=(await Promise.all(o)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new K({samples:l})}async identify(e,t={}){await this.load();const i=a(l,e).clone().normalize(),{raster:s,serviceRasterInfo:n}=this;if(null!=n?.multidimensionalInfo){if(!(n.hasMultidimensionalTranspose&&!(!f(t.multidimensionalDefinition)&&!t.transposedVariableName))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:i,value:null}}const o=this.multidimensionalSubset?.areaOfInterest;if(o&&!o.contains(i))throw new r("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let u;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=c(s)?this.getRawDisplayBandIds():this.bandIds;u=e?.length?e:void 0}return s.identify(i,{...t,bandIds:u})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,r=t?.[0]?.variableName;return e.variables.some(e=>e.name===r&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date(y(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return g(this.multidimensionalSubset,t)}async getDynamicRangeInputRaster(){if(!this.rasterFunction||!c(this.raster)||!this._cachedRasterFunctionJson)return null;const e=JSON.stringify(this._cachedRasterFunctionJson);if(this._draRasterConfig?.functionJson===e)return this._draRasterConfig;const t=this.raster.rasterFunction.queryRasterFunction(e=>"Stretch"===e.functionName&&e.functionArguments.dynamicRangeAdjustment);if(!t)return null;const r=t.toJSON(),i=this.raster.primaryRasters.rasters,s=t.functionArguments.raster,n=r.rasterFunctionArguments;if(!s||"object"!=typeof s||!("functionName"in s))return this._draRasterConfig={functionJson:e,raster:i[0],functionArguments:n,rasterJobHandler:this._draRasterConfig?.rasterJobHandler},this._draRasterConfig;const o={raster:i[0]};i.length>1&&i.forEach(e=>o[e.url]=e);const a=w(s.toJSON(),o),l=new d({rasterFunction:a});await l.open();let u=this._draRasterConfig?.rasterJobHandler;try{u||(u=new C,await u.initialize()),l.rasterJobHandler=u,await l.syncJobHandler()}catch{}return this._draRasterConfig={functionJson:e,raster:l,functionArguments:n,rasterJobHandler:u},this._draRasterConfig}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=R(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&c(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;re(this);const{raster:e}=this;e.rasterJobHandler!==this._rasterJobHandler&&(e.rasterJobHandler=this._rasterJobHandler,c(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer())}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:r,type:i}=t;if("multipoint"===i)return t.points.map(e=>new l({x:e[0],y:e[1],spatialReference:r}));if("polyline"===i){let i=t;if(e.sampleCount||e.sampleDistance){const r=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Y);let o=e.sampleDistance;if(!o){o=s/(n+(2===i.paths[0].length?1:0))}i=r.execute(t,o,{unit:"meters"})}return i.paths.flatMap(e=>e.map(e=>new l({x:e[0],y:e[1],spatialReference:r})))}const s=Math.min(e.sampleCount||100,Y),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),u=o.height/a,m=o.width/a,{xmin:c,ymax:d}=o,p=[];for(let h=0;h<u;h++)for(let e=0;e<m;e++){const i=new l({x:c+(e+.5)*a,y:d-(h+.5)*a,spatialReference:r});(n||t.contains(i))&&p.push(i)}return p}_configDefaultInterpolation(){if(null==this.interpolation){re(this);const{raster:e}=this,t=z(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){re(this);const{rasterInfo:t}=this.raster,r=h(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=r?.name,n=E({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??B(t)),!this.renderer||"override"===e){const e=U(this.raster),r=n?.renderer??M(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),i=t.statistics,o=i&&i.length>0?i[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===r.type&&(a>1e24||l<-1e24)&&(r.dynamicRangeAdjustment=!0,r.customStatistics=null,"none"===r.stretchType&&(r.stretchType="min-max")),this.renderer=r}const o=A({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new q({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=M(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,r=t.customStatistics?.length;!t.dynamicRangeAdjustment&&r&&e&&r!==e&&this._configDefaultRenderer("override")}}}else i.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&c(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",H.fromJSON(e)))}let e,t=this.raster,r=!1;c(t)?(e=t.primaryRasters.rasters,t=e[0],r=!0):e=[t];const{rasterFunction:i}=this;if(i){const r={raster:t};e.length>1&&e.forEach(e=>r[e.url]=e);const s=w(i.functionDefinition?.toJSON()??i.toJSON(),r),n=new d({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!r&&!i)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some(e=>e>=n):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:r}=this.raster,i=r.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(r.pixelSize.x+r.pixelSize.y)/2*i;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach(({value:r,multidimensionalDefinition:i},o)=>{const a={Variables:i[0].variableName,Dimensions:i.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of i){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const r=t[t.length-1];a[`${e}_Max`]=Array.isArray(r)?r[r.length-1]:r}const l=new G({location:e.location,pixelValue:r,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)}),n}};function re(e){if(!e.raster||!e.serviceRasterInfo)throw new r("imagery-tile","no raster")}return e([s({clonable:!1})],te.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],te.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],te.prototype,"_draRasterConfig",void 0),e([s({clonable:!1})],te.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],te.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[o],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],te.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],te.prototype,"copyright",void 0),e([s({json:{read:!1}})],te.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),Q(T)],te.prototype,"interpolation",void 0),e([s()],te.prototype,"ioConfig",void 0),e([s({type:[j],json:{write:!0}})],te.prototype,"multidimensionalDefinition",null),e([s({type:N,json:{write:!0}})],te.prototype,"multidimensionalSubset",void 0),e([s()],te.prototype,"raster",void 0),e([s({type:H})],te.prototype,"rasterFunction",null),e([s()],te.prototype,"serviceRasterInfo",void 0),e([s()],te.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:u,json:{read:!1}})],te.prototype,"spatialReference",void 0),e([s({type:O})],te.prototype,"tileInfo",void 0),e([s(J)],te.prototype,"url",null),e([s({types:k})],te.prototype,"renderer",null),e([s({types:k,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:L,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],te.prototype,"internalRenderer",null),e([X("internalRenderer")],te.prototype,"readRenderer",null),e([s({clonable:!1})],te.prototype,"symbolizer",void 0),te=e([n("esri.layers.mixins.TiledImagery")],te),te};export{Z as TiledImagery};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s,createAbortError as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s,createAbortError as r}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import l from"./BaseRaster.js";import c from"./InMemoryRaster.js";import{parsePAMInfo as m}from"./pamParser.js";import{getFormat as f}from"../formats/RasterCodec.js";import{estimateStatisticsFromHistograms as p}from"../functions/stretchUtils.js";import h from"../transforms/PolynomialTransform.js";let u=class extends l{set rasterJobHandler(t){this._set("rasterJobHandler",t),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=t)}fetchRawTile(t,e,s,r={}){if(this._imageBlob){const{blockWidth:r,blockHeight:a}=this.rasterInfo.storageInfo;return this.decodePixelBlock(this._imageBlob,{tileSize:[r,a],tileIndex:[t,e,s],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0})}return this._inMemoryRaster.fetchRawTile(t,e,s,r)}async _open(t){const s=await this._fetchData(t);if(null==s)throw new e("image-aux-raster:open","the data cannot be decoded");let{spatialReference:r,statistics:a,histograms:o,transform:l}=await this._fetchAuxiliaryData(t);const m=!r;m&&(r=new n({wkid:3857})),o?.length&&null==a&&(a=p(o));const{width:f,height:h}=s;let u=new i({xmin:-.5,ymin:.5-h,xmax:f-.5,ymax:.5,spatialReference:r});const d=l?l.forwardTransform(u):u;let g=!0;if(l){const t=l.forwardCoefficients;g=t&&0===t[1]&&0===t[2],g&&(l=null,u=d)}const{rasterJobHandler:y,ioConfig:w}=this,x=new c({preGenerateTiles:!1,rasterJobHandler:y,source:{extent:d,nativeExtent:u,transform:l,pixelBlocks:[s],statistics:a,histograms:o,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:m},ioConfig:{...w,sampling:"closest",skipStatistics:!0}});await x.open(),x.source=null,this._set("rasterInfo",x.rasterInfo),this._inMemoryRaster=x}async _fetchData(t){const{data:s}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=f(s);if("jpg"!==r&&"png"!==r&&"gif"!==r&&"bmp"!==r)throw new e("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r.toUpperCase());const a=r.toLowerCase();try{const t=await this.decodePixelBlock(s,{format:a,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0});return this._imageBlob=s,t}catch{return this.decodePixelBlock(s,{format:a,canvasUsage:"no-canvas",skipStatistics:!0})}}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:a=[],skipMapInfo:o}=this.ioConfig,i=o||a.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),n=this.datasetFormat,l="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,c=l&&a.includes(l)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+l,{responseType:"text",signal:e}),f=await s([i,c]);if(e?.aborted)throw r();const p=m(f[0].value?.data);if(!p.transform){const t=f[1].value?f[1].value.data.split("\n").slice(0,6).map(t=>Number(t)):null;p.transform=6===t?.length?new h({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return p}};t([a({type:String,json:{write:!0}})],u.prototype,"datasetFormat",void 0),t([a()],u.prototype,"rasterJobHandler",null),u=t([o("esri.layers.raster.datasets.ImageAuxRaster")],u);const d=u;export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import r from"../../../core/Error.js";import e from"./CovJSONRaster.js";import t from"./ImageAuxRaster.js";import s from"./ImageServerRaster.js";import o from"./InMemoryRaster.js";import a from"./MRFRaster.js";import n from"./TIFFRaster.js";const c=new Map;c.set("MRF",{desc:"Meta Raster Format",constructor:a}),c.set("TIFF",{desc:"GeoTIFF",constructor:n}),c.set("RasterTileServer",{desc:"Raster Tile Server",constructor:s}),c.set("JPG",{desc:"JPG Raster Format",constructor:t}),c.set("PNG",{desc:"PNG Raster Format",constructor:t}),c.set("GIF",{desc:"GIF Raster Format",constructor:t}),c.set("BMP",{desc:"BMP Raster Format",constructor:t}),c.set("CovJSON",{desc:"COVJSON Raster Format",constructor:e}),c.set("MEMORY",{desc:"In Memory Raster Format",constructor:o});class l{static get supportedFormats(){const r=new Set;return c.forEach((e,t)=>r.add(t)),r}static async open(e){const{url:t,ioConfig:s,source:o,sourceJSON:a}=e;let n=e.datasetFormat??s?.datasetFormat;null==n&&(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===o?.type?.toLowerCase()?n="CovJSON":o?.extent&&o.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:t,source:o,sourceJSON:a,datasetFormat:n,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(r=>{null==l[r]&&delete l[r]}),n){if(!this.supportedFormats.has(n))throw new r("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new r("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,c.get(n).constructor)(l);return s.rasterJobHandler=e.rasterJobHandler,await s.open({signal:e.signal}),s}const u=Array.from(c.keys()).filter(r=>"CovJSON"!==r&&"Memory"!==r);let i=0;const m=()=>{if(n=u[i++],!n)return null;if("CRF"===n)return null;const r=new(0,c.get(n).constructor)(l);return r.rasterJobHandler=e.rasterJobHandler,r.open({signal:e.signal}).then(()=>r).catch(()=>m())};return m()}static register(r,e,t){c.has(r.toUpperCase())||c.set(r.toUpperCase(),{desc:e,constructor:t})}}export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{throwIfNotAbortError as t}from"../../core/promiseUtils.js";import{open as i}from"../../core/workers.js";import a from"./PixelBlock.js";class s{constructor(){this._workerThread=null,this._destroyed=!1,this._onClientConnectedHandle=null,this._symbolizerState=null,this._rasterFunctionState=null}async initialize(){const e=await i("RasterWorker");this._destroyed?e.close():(this._onClientConnectedHandle=r(this._onClientConnectedHandle),this._workerThread=e,this._onClientConnectedHandle=e.onClientConnected(e=>{this._symbolizerState&&e.invoke("updateSymbolizer",this._symbolizerState).catch(e=>t(e)),this._rasterFunctionState&&e.invoke("updateRasterFunction",this._rasterFunctionState).catch(e=>t(e))}))}destroy(){this._destroyed=!0,this._onClientConnectedHandle=r(this._onClientConnectedHandle),this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,r){o(this._workerThread);const t=e.pixelBlock.getTransferableObject().pixelBlock,i=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t,type:e.dataType},r);return i?new a(i):null}async convertPixelBlockToFeatures(e,r){o(this._workerThread);const t=await this._workerThread.invoke("convertPixelBlockToFeatures",{pixelBlock:e.pixelBlock.toJSON(),extent:e.extent.toJSON(),fieldNames:e.fieldNames,skipFactor:e.skipFactor,pixelIdOffset:e.pixelIdOffset,imageRowSize:e.imageRowSize},r),i=e.extent.spatialReference?.toJSON();return t.forEach(e=>e.geometry.spatialReference=i),t}computeStatisticsHistograms(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("computeStatisticsHistograms",{...e,pixelBlock:i},r)}sampleVectorFieldData(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("sampleVectorFieldData",{...e,pixelBlock:i},r)}async transformPixels(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();r?.transferPixelsToWorker&&(r={...r,transferList:t});const s=await this._workerThread.invoke("transformPixels",{...e,pixelBlock:i},r);return a.fromJSON(s)}async compositeBands(e,r){o(this._workerThread);const t=e.pixelBlocks.map(e=>e?.getTransferableObject()),i={pixelBlocks:t.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=t.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const s=await this._workerThread.invoke("compositeBands",i,r);return s?a.fromJSON(s):null}async decode(e,r){o(this._workerThread);const t=await this._workerThread.invoke("decode",e,{...r,transferList:e.options?.cloneSource?void 0:[e.data]});return t?new a(t):null}async symbolize(e,r){o(this._workerThread);const t=e.pixelBlock?.getTransferableObject().pixelBlock,i={extent:e.extent?.toJSON(),pixelBlock:t,simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},s=await this._workerThread.invoke("symbolize",i,r);return s?new a(s):null}async highlightPixels(e,r){o(this._workerThread);const t={pixelBlock:e.pixelBlock?.toJSON(),renderedPixelBlock:e.renderedPixelBlock?.toJSON(),highlightOptions:e.highlightOptions},i=await this._workerThread.invoke("highlightPixels",t,r);e.renderedPixelBlock.pixels=i.pixels,e.renderedPixelBlock.mask=i.mask,e.renderedPixelBlock.maskIsAlpha=i.maskIsAlpha}async updateSymbolizer(e,r){o(this._workerThread);const t=e?.rendererJSON?.histograms;this._symbolizerState={symbolizerJSON:e.toJSON(),histograms:t},await Promise.all(this._workerThread.broadcast("updateSymbolizer",this._symbolizerState,r))}async updateRasterFunction(e,r){o(this._workerThread),this._rasterFunctionState={rasterFunctionJSON:e.toJSON()},await Promise.all(this._workerThread.broadcast("updateRasterFunction",this._rasterFunctionState,r))}async process(e,r){o(this._workerThread);const t=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelSizes:e.primaryPixelSizes?.map(e=>null!=e?e.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(e=>e?.getTransferableObject().pixelBlock),primaryRasterIds:e.primaryRasterIds,parameters:e.parameters},r);return t?new a(t):null}async stretch(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,stretchParams:e.stretchParams},i=await this._workerThread.invoke("stretch",t,r);return i?new a(i):null}async split(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},i=await this._workerThread.invoke("split",t,r);return i&&i.forEach((e,r)=>{i.set(r,e?a.fromJSON(e):null)}),i}async clipTile(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t=e.pixelBlock.getTransferableObject().pixelBlock,i={...e,pixelBlock:t},s=await this._workerThread.invoke("clipTile",i,r);return s?a.fromJSON(s):null}async estimateStatisticsHistograms(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock};return await this._workerThread.invoke("estimateStatisticsHistograms",t,r)}async mosaicAndTransform(e,r){if(o(this._workerThread),!e?.srcPixelBlocks?.length)return{pixelBlock:null};const t=e.srcPixelBlocks.map(e=>e?.getTransferableObject()),i={...e,srcPixelBlocks:t.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=t.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const s=await this._workerThread.invoke("mosaicAndTransform",i,r);return{pixelBlock:s.pixelBlock?new a(s.pixelBlock):null,localNorthDirections:s.localNorthDirections}}async createFlowMesh(e,r){o(this._workerThread);const t={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:i,simulationSettings:a,startInfo:s}=e,l=await this._workerThread.invoke("createFlowMesh",{meshType:i,flowData:t,simulationSettings:a,startInfo:s},{...r,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer),pathData:new Float32Array(l.pathBuffer)}}getProjectionOffsetGrid(e,r){o(this._workerThread);const t=null!=e.datumTransformation?e.datumTransformation.steps.map(e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse})):null,i=null!=e.rasterTransform?e.rasterTransform.toJSON():null,a={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:t,rasterTransform:i,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",a,r)}}function o(r){if(null==r)throw new e("raster-jobhandler:no-connection","no available worker connection")}export{s as default};
|
|
2
|
+
import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{throwIfNotAbortError as t}from"../../core/promiseUtils.js";import{open as i}from"../../core/workers.js";import a from"./PixelBlock.js";class s{constructor(){this._workerThread=null,this._destroyed=!1,this._onClientConnectedHandle=null,this._symbolizerState=null,this._rasterFunctionState=null}async initialize(){const e=await i("RasterWorker");this._destroyed?e.close():(this._onClientConnectedHandle=r(this._onClientConnectedHandle),this._workerThread=e,this._onClientConnectedHandle=e.onClientConnected(e=>{this._symbolizerState&&e.invoke("updateSymbolizer",this._symbolizerState).catch(e=>t(e)),this._rasterFunctionState&&e.invoke("updateRasterFunction",this._rasterFunctionState).catch(e=>t(e))}))}destroy(){this._destroyed=!0,this._onClientConnectedHandle=r(this._onClientConnectedHandle),this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,r){o(this._workerThread);const t=e.pixelBlock.getTransferableObject().pixelBlock,i=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t,type:e.dataType},r);return i?new a(i):null}async convertPixelBlockToFeatures(e,r){o(this._workerThread);const t=await this._workerThread.invoke("convertPixelBlockToFeatures",{pixelBlock:e.pixelBlock.toJSON(),extent:e.extent.toJSON(),fieldNames:e.fieldNames,skipFactor:e.skipFactor,pixelIdOffset:e.pixelIdOffset,imageRowSize:e.imageRowSize},r),i=e.extent.spatialReference?.toJSON();return t.forEach(e=>e.geometry.spatialReference=i),t}computeStatisticsHistograms(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("computeStatisticsHistograms",{...e,pixelBlock:i},r)}sampleVectorFieldData(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("sampleVectorFieldData",{...e,pixelBlock:i},r)}async transformPixels(e,r){o(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();r?.transferPixelsToWorker&&(r={...r,transferList:t});const s=await this._workerThread.invoke("transformPixels",{...e,pixelBlock:i},r);return a.fromJSON(s)}async compositeBands(e,r){o(this._workerThread);const t=e.pixelBlocks.map(e=>e?.getTransferableObject()),i={pixelBlocks:t.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=t.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const s=await this._workerThread.invoke("compositeBands",i,r);return s?a.fromJSON(s):null}async decode(e,r){o(this._workerThread);const t=await this._workerThread.invoke("decode",e,{...r,transferList:e.options?.cloneSource?void 0:[e.data]});return t?new a(t):null}async symbolize(e,r){o(this._workerThread);const t=e.pixelBlock?.getTransferableObject().pixelBlock,i={extent:e.extent?.toJSON(),pixelBlock:t,simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},s=await this._workerThread.invoke("symbolize",i,r);return s?new a(s):null}async highlightPixels(e,r){o(this._workerThread);const t={pixelBlock:e.pixelBlock?.toJSON(),renderedPixelBlock:e.renderedPixelBlock?.toJSON(),highlightOptions:e.highlightOptions},i=await this._workerThread.invoke("highlightPixels",t,r);e.renderedPixelBlock.pixels=i.pixels,e.renderedPixelBlock.mask=i.mask,e.renderedPixelBlock.maskIsAlpha=i.maskIsAlpha}async updateSymbolizer(e,r){o(this._workerThread);const t=e?.rendererJSON?.histograms;this._symbolizerState={symbolizerJSON:e.toJSON(),histograms:t},await Promise.all(this._workerThread.broadcast("updateSymbolizer",this._symbolizerState,r))}async updateRasterFunction(e,r){o(this._workerThread),this._rasterFunctionState={rasterFunctionJSON:e.toJSON()},await Promise.all(this._workerThread.broadcast("updateRasterFunction",this._rasterFunctionState,r))}async process(e,r){o(this._workerThread);const t=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelSizes:e.primaryPixelSizes?.map(e=>null!=e?e.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(e=>e?.getTransferableObject().pixelBlock),primaryRasterIds:e.primaryRasterIds,parameters:e.parameters},r);return t?new a(t):null}async stretch(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,stretchParams:e.stretchParams},i=await this._workerThread.invoke("stretch",t,r);return i?new a(i):null}async split(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},i=await this._workerThread.invoke("split",t,r);return i&&i.forEach((e,r)=>{i.set(r,e?a.fromJSON(e):null)}),i}async clipTile(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t=e.pixelBlock.getTransferableObject().pixelBlock,i={...e,pixelBlock:t},s=await this._workerThread.invoke("clipTile",i,r);return s?a.fromJSON(s):null}async estimateStatisticsHistograms(e,r){if(o(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock};return await this._workerThread.invoke("estimateStatisticsHistograms",t,r)}async mosaicPixelData(e,r){if(o(this._workerThread),!e?.pixelBlocks?.length)return null;const t=e.pixelBlocks.map(({extent:e,pixelBlock:r})=>{const t=r?.getTransferableObject();return{extent:e.toJSON(),pixelBlock:t?.pixelBlock??null,transferList:t?.transferList??[]}});if(r?.transferPixelsToWorker){const e=t.flatMap(e=>e.transferList).filter(e=>null!=e);r={...r,transferList:e}}const i=await this._workerThread.invoke("mosaicPixelData",{pixelData:t.map(({extent:e,pixelBlock:r})=>({extent:e,pixelBlock:r})),destExtent:e.destExtent.toJSON()},r);return i?a.fromJSON(i):null}async mosaicAndTransform(e,r){if(o(this._workerThread),!e?.srcPixelBlocks?.length)return{pixelBlock:null};const t=e.srcPixelBlocks.map(e=>e?.getTransferableObject()),i={...e,srcPixelBlocks:t.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=t.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const s=await this._workerThread.invoke("mosaicAndTransform",i,r);return{pixelBlock:s.pixelBlock?new a(s.pixelBlock):null,localNorthDirections:s.localNorthDirections}}async createFlowMesh(e,r){o(this._workerThread);const t={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:i,simulationSettings:a,startInfo:s}=e,l=await this._workerThread.invoke("createFlowMesh",{meshType:i,flowData:t,simulationSettings:a,startInfo:s},{...r,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer),pathData:new Float32Array(l.pathBuffer)}}getProjectionOffsetGrid(e,r){o(this._workerThread);const t=null!=e.datumTransformation?e.datumTransformation.steps.map(e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse})):null,i=null!=e.rasterTransform?e.rasterTransform.toJSON():null,a={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:t,rasterTransform:i,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",a,r)}}function o(r){if(null==r)throw new e("raster-jobhandler:no-connection","no available worker connection")}export{s as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../geometry/Extent.js";import r from"../../geometry/Point.js";import t from"../../geometry/operators/support/GeographicTransformation.js";import{decode as s}from"../raster/formats/RasterCodec.js";import{transformPixels as o}from"../raster/functions/pixelTransformUtils.js";import{convertPixelBlockToFeatures as i,compositeBands as
|
|
2
|
+
import e from"../../geometry/Extent.js";import r from"../../geometry/Point.js";import t from"../../geometry/operators/support/GeographicTransformation.js";import{decode as s}from"../raster/formats/RasterCodec.js";import{transformPixels as o}from"../raster/functions/pixelTransformUtils.js";import{convertPixelBlockToFeatures as i,compositeBands as l,highlightPixels as n,split as a,clipTile as m,mosaicPixelData as c,mosaic as f,approximateTransform as p,getLocalArithmeticNorthRotations as u}from"../raster/functions/pixelUtils.js";import{create as x}from"../raster/functions/rasterFunctionHelper.js";import{load as S,getProjectionOffsetGrid as d}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as h,estimateStatisticsHistograms as k}from"../raster/functions/stretchUtils.js";import{convertVectorFieldData as B,sampleVectorField as O,convertToLocalDirections as g}from"../raster/functions/vectorFieldUtils.js";import{readTransform as P}from"../raster/transforms/utils.js";import y from"./PixelBlock.js";import N from"../../renderers/support/RasterSymbolizer.js";import{createFlowMesh as J}from"../../views/2d/engine/flow/dataUtils.js";function v(e){if(!e)return{result:null,transferList:[]};const{pixelBlock:r,transferList:t}=e.getTransferableObject();return{result:r,transferList:t}}class b{convertVectorFieldData(e){const r=y.fromJSON(e.pixelBlock),t=v(B(r,e.type));return Promise.resolve(t)}convertPixelBlockToFeatures(r){const t=i({pixelBlock:y.fromJSON(r.pixelBlock),extent:e.fromJSON(r.extent),fieldNames:r.fieldNames,skipFactor:r.skipFactor,skipSpatialReference:!0,pixelIdOffset:r.pixelIdOffset,imageRowSize:r.imageRowSize});return Promise.resolve(t)}sampleVectorFieldData(e){const r=y.fromJSON(e.pixelBlock),t=v(O(r,e.srcDataType,e.tileSize,e.offset,e.maximumVoidPercentage));return Promise.resolve(t)}transformPixels(e){const r=y.fromJSON(e.pixelBlock),t=o(r,e.transformType,e.transformParameters);return Promise.resolve(v(t))}computeStatisticsHistograms(e){const r=y.fromJSON(e.pixelBlock),t=h(r,{histogramSize:e.histogramSize,includeSkewnessKurtosis:e.includeSkewnessKurtosis});return Promise.resolve(t)}compositeBands(e){const r=e.pixelBlocks.map(e=>e&&y.fromJSON(e)),t=v(l(r));return Promise.resolve(t)}async decode(e){return v(await s(e.data,e.options))}symbolize(r){const t=r.pixelBlock?y.fromJSON(r.pixelBlock):null,s=r.extent?e.fromJSON(r.extent):null,o=v(this.symbolizer.symbolize({...r,pixelBlock:t,extent:s}));return Promise.resolve(o)}highlightPixels(e){const r=y.fromJSON(e.pixelBlock),t=y.fromJSON(e.renderedPixelBlock);return n({pixelBlock:r,renderedPixelBlock:t,highlightOptions:e.highlightOptions}),Promise.resolve(t.toJSON())}async updateSymbolizer(e){this.symbolizer=N.fromJSON(e.symbolizerJSON),e.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=x(e.rasterFunctionJSON)}async process(t){return v(this.rasterFunction.process({extent:e.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(e=>null!=e?y.fromJSON(e):null),primaryPixelSizes:t.primaryPixelSizes?.map(e=>null!=e?r.fromJSON(e):null),primaryRasterIds:t.primaryRasterIds},t.parameters))}stretch(e){const r=v(this.symbolizer.simpleStretch(y.fromJSON(e.srcPixelBlock),e.stretchParams));return Promise.resolve(r)}estimateStatisticsHistograms(e){const r=k(y.fromJSON(e.srcPixelBlock));return Promise.resolve(r)}split(e){const r=a(y.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,!1===e.useBilinear),t=[];let s;return r&&(s=new Map,r.forEach((e,r)=>{if(e){const{pixelBlock:o,transferList:i}=e.getTransferableObject();s.set(r,o),i.forEach(e=>{t.includes(e)||t.push(e)})}})),Promise.resolve({result:s,transferList:t})}clipTile(e){const r=y.fromJSON(e.pixelBlock),t=v(m({...e,pixelBlock:r}));return Promise.resolve(t)}mosaicPixelData(r){const t=r.pixelData.map(r=>({extent:e.fromJSON(r.extent),pixelBlock:r.pixelBlock?y.fromJSON(r.pixelBlock):null})),s=e.fromJSON(r.destExtent),o=c(t,s),i=v(o?.pixelBlock);return Promise.resolve(i)}async mosaicAndTransform(e){const r=e.srcPixelBlocks.map(e=>e?new y(e):null),t=f(r,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let s,o=t;e.coefs&&(o=p(t,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(s=u(e.destDimension,e.gcsGrid),o=g(o,e.isUV?"vector-uv":"vector-magdir",s));const{result:i,transferList:l}=v(o);return{result:{pixelBlock:i,localNorthDirections:s},transferList:l}}async createFlowMesh(e,r){const t={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:s,indexData:o,pathData:i}=await J(e.meshType,e.simulationSettings,t,e.startInfo,r.signal);return{result:{vertexBuffer:s.buffer,indexBuffer:o.buffer,pathBuffer:i.buffer},transferList:[s.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const s=e.fromJSON(r.projectedExtent),o=e.fromJSON(r.srcBufferExtent);let i=null;r.datumTransformationSteps?.length&&(i=new t({steps:r.datumTransformationSteps})),await S();const l=r.rasterTransform?P(r.rasterTransform):null;return d({...r,projectedExtent:s,srcBufferExtent:o,datumTransformation:i,rasterTransform:l})}}export{b as default};
|
|
@@ -6,8 +6,18 @@ export interface SymbolLayerDrawingProperties extends Partial<Pick<SymbolLayerDr
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Defines the symbol layer drawing options for [FeatureLayer.symbolLayerDrawing](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#symbolLayerDrawing).
|
|
9
|
+
* Use symbol layer drawing to override the default drawing order of [CIMSymbol](https://developers.arcgis.com/javascript/latest/references/core/symbols/CIMSymbol/)s on maps.
|
|
10
|
+
* When symbols have more than one symbol layer (such as a cased road symbol), symbol layer drawing can also control how those individual symbol layers are ordered across symbol classes.
|
|
11
|
+
*
|
|
12
|
+
* Default draw order | Symbol layer drawing enabled
|
|
13
|
+
* -------------------|----------------------
|
|
14
|
+
*  | 
|
|
15
|
+
*
|
|
16
|
+
* > [!WARNING]
|
|
17
|
+
* > Symbol layer drawing is not supported in 3D scenes.
|
|
9
18
|
*
|
|
10
19
|
* @since 5.1
|
|
20
|
+
* @see [ArcGIS Pro - Symbol Layer Drawing](https://doc.esri.com/en/arcgis-pro/latest/help/mapping/layer-properties/symbol-layer-drawing.html)
|
|
11
21
|
*/
|
|
12
22
|
export default class SymbolLayerDrawing extends SymbolLayerDrawingSuperclass {
|
|
13
23
|
constructor(properties?: SymbolLayerDrawingProperties);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import n from"./RasterJobHandler.js";const t={instance:null,refCount:0,connectionPromise:null};async function e(){if(t.refCount++,t.instance)return t.instance;if(!t.connectionPromise){const e=new n;t.connectionPromise=e.initialize().then(()=>{t.instance=e})}return await t.connectionPromise,t.instance}function o(){t.refCount--,t.refCount>0||c()}function i(){return t.refCount}function c(){t.instance?.destroy(),t.instance=null,t.connectionPromise=null,t.refCount=0}export{e as getRasterJobHandler,i as getRefCount,o as releaseRasterJobHandler};
|
package/layers/types.d.ts
CHANGED
|
@@ -398,7 +398,6 @@ export interface QueryCapabilities {
|
|
|
398
398
|
* for the individual features contributing to each [aggregated](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
|
|
399
399
|
* statistics query result.
|
|
400
400
|
*
|
|
401
|
-
* @internal
|
|
402
401
|
* @since 5.1
|
|
403
402
|
* @see [Query.returnStatisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
|
|
404
403
|
* @see [Graphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#statisticsAggregatedIds)
|
|
@@ -432,8 +431,8 @@ export interface QueryCapabilities {
|
|
|
432
431
|
*/
|
|
433
432
|
supportsDistance: boolean;
|
|
434
433
|
/**
|
|
435
|
-
* Indicates if the layer's query operation supports returning distance
|
|
436
|
-
*
|
|
434
|
+
* Indicates if the layer's query operation supports returning distance values of each feature in the query result using
|
|
435
|
+
* the [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) property.
|
|
437
436
|
*
|
|
438
437
|
* @since 5.1
|
|
439
438
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.118",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.17.2",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.123",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.1.0-next.60",
|
|
25
25
|
"@vaadin/grid": "~25.1.3",
|
|
@@ -153,12 +153,12 @@ export default class AttributeBinsQuery extends AttributeBinsQuerySuperclass {
|
|
|
153
153
|
accessor datumTransformation: DatumTransformation | null | undefined;
|
|
154
154
|
/**
|
|
155
155
|
* Specifies a search distance from a given [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry) in a spatial query.
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
156
|
+
* The [units property](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#units) indicates the unit of measurement. In essence, setting this property
|
|
157
|
+
* creates a buffer at the specified size around the input [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry). The query will use that
|
|
158
|
+
* buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#spatialRelationship).
|
|
159
159
|
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
160
|
+
* If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/)
|
|
161
|
+
* capability must be `true`.
|
|
162
162
|
*/
|
|
163
163
|
accessor distance: number | null | undefined;
|
|
164
164
|
/**
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ClonableMixin } from "../../core/Clonable.js";
|
|
2
|
+
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
3
|
+
|
|
4
|
+
/** @since 5.1 */
|
|
5
|
+
export interface OutDistanceProperties extends Partial<Pick<OutDistance, "ascendingOrder" | "outDistanceUnit" | "returnDistance">> {}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Defines the [outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) parameter on a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) and specifies whether to return the distance
|
|
9
|
+
* of each feature from the input geometry's buffer in a query result. It also optionally controls the sort order of results based on distances of features
|
|
10
|
+
* from the input geometry's buffer.
|
|
11
|
+
* Distance values are returned only when the following conditions are met:
|
|
12
|
+
* - The [Query.distance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#distance) is greater than 0
|
|
13
|
+
* - [Query.units](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#units) is specified
|
|
14
|
+
* - [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) is specified and its [OutDistance.returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) property is `true`
|
|
15
|
+
*
|
|
16
|
+
* > [!WARNING]
|
|
17
|
+
* >
|
|
18
|
+
* > **Known Limitations**
|
|
19
|
+
* >
|
|
20
|
+
* > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
|
|
21
|
+
* > is `true`.
|
|
22
|
+
*
|
|
23
|
+
* @since 5.1
|
|
24
|
+
*/
|
|
25
|
+
export default class OutDistance extends OutDistanceSuperclass {
|
|
26
|
+
constructor(properties?: OutDistanceProperties);
|
|
27
|
+
/**
|
|
28
|
+
* Indicates whether to return the distance values in ascending order. This property is only applicable when [returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) is `true`.
|
|
29
|
+
*
|
|
30
|
+
* @default true
|
|
31
|
+
* @since 5.1
|
|
32
|
+
*/
|
|
33
|
+
accessor ascendingOrder: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The distance unit of the returned distance values. This property is only applicable when
|
|
36
|
+
* [returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) is `true`.
|
|
37
|
+
*
|
|
38
|
+
* @since 5.1
|
|
39
|
+
*/
|
|
40
|
+
accessor outDistanceUnit: "feet" | "miles" | "nautical-miles" | "us-nautical-miles" | "meters" | "kilometers" | null | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Indicates whether to return the calculated distance value for each feature in a distance query result.
|
|
43
|
+
* Distance values returned in each feature's [distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance) property.
|
|
44
|
+
*
|
|
45
|
+
* @default true
|
|
46
|
+
* @since 5.1
|
|
47
|
+
*/
|
|
48
|
+
accessor returnDistance: boolean;
|
|
49
|
+
}
|
|
50
|
+
declare const OutDistanceSuperclass: typeof JSONSupport & typeof ClonableMixin
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONMap as r}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{enumeration as n}from"../../core/accessorSupport/decorators/enumeration.js";const c=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let a=class extends(e(o)){constructor(){super(
|
|
2
|
+
import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONMap as r}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{enumeration as n}from"../../core/accessorSupport/decorators/enumeration.js";const c=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let a=class extends(e(o)){constructor(t){super(t),this.returnDistance=!0,this.ascendingOrder=!0,this.outDistanceUnit=null}};t([i({json:{write:!0}})],a.prototype,"returnDistance",void 0),t([i({json:{write:!0}})],a.prototype,"ascendingOrder",void 0),t([n(c,{ignoreUnknown:!1}),i({})],a.prototype,"outDistanceUnit",void 0),a=t([s("esri.rest.support.OutDistance")],a);const p=a;export{p as default};
|
package/rest/support/Query.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type Point from "../../geometry/Point.js";
|
|
2
2
|
import type SpatialReference from "../../geometry/SpatialReference.js";
|
|
3
3
|
import type GeographicTransformation from "../../geometry/operators/support/GeographicTransformation.js";
|
|
4
|
+
import type OutDistance from "./OutDistance.js";
|
|
4
5
|
import type QuantizationParameters from "./QuantizationParameters.js";
|
|
5
6
|
import type StatisticDefinition from "./StatisticDefinition.js";
|
|
6
7
|
import type TimeExtent from "../../time/TimeExtent.js";
|
|
@@ -18,6 +19,7 @@ import type { SpatialReferenceProperties } from "../../geometry/SpatialReference
|
|
|
18
19
|
import type { StatisticDefinitionProperties } from "./StatisticDefinition.js";
|
|
19
20
|
import type { QuantizationParametersProperties } from "./QuantizationParameters.js";
|
|
20
21
|
import type { TimeExtentProperties } from "../../time/TimeExtent.js";
|
|
22
|
+
import type { OutDistanceProperties } from "./OutDistance.js";
|
|
21
23
|
|
|
22
24
|
export interface QueryProperties extends Partial<Pick<Query, "aggregateIds" | "cacheHint" | "datumTransformation" | "distance" | "gdbVersion" | "geometryPrecision" | "groupByFieldsForStatistics" | "having" | "maxAllowableOffset" | "maxRecordCountFactor" | "multipatchOption" | "num" | "objectIds" | "orderByFields" | "outFields" | "parameterValues" | "rangeValues" | "relationParameter" | "returnCentroid" | "returnDistinctValues" | "returnExceededLimitFeatures" | "returnGeometry" | "returnM" | "returnQueryGeometry" | "returnStatisticsAggregatedIds" | "returnTrueCurves" | "returnZ" | "spatialRelationship" | "sqlFormat" | "start" | "text" | "units" | "where">> {
|
|
23
25
|
/**
|
|
@@ -36,6 +38,24 @@ export interface QueryProperties extends Partial<Pick<Query, "aggregateIds" | "c
|
|
|
36
38
|
* capability of the service being queried is `true`. This setting is provided in the layer resource.
|
|
37
39
|
*/
|
|
38
40
|
historicMoment?: (Date | number | string) | null;
|
|
41
|
+
/**
|
|
42
|
+
* Specifies whether to return the distance of each feature from the input geometry's buffer in a query result. It also optionally controls the sort
|
|
43
|
+
* order of results based on distances of features from the input geometry's buffer.
|
|
44
|
+
* Distance values are returned only when the following conditions are met:
|
|
45
|
+
* - The [Query.distance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#distance) is greater than 0
|
|
46
|
+
* - [Query.units](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#units) is specified
|
|
47
|
+
* - The `outDistance` is specified and its [OutDistance.returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) property is `true`
|
|
48
|
+
*
|
|
49
|
+
* > [!WARNING]
|
|
50
|
+
* >
|
|
51
|
+
* > **Known Limitations**
|
|
52
|
+
* >
|
|
53
|
+
* > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
|
|
54
|
+
* > is `true`.
|
|
55
|
+
*
|
|
56
|
+
* @since 5.1
|
|
57
|
+
*/
|
|
58
|
+
outDistance?: OutDistanceProperties | null;
|
|
39
59
|
/**
|
|
40
60
|
* The spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial
|
|
41
61
|
* reference of the queried layer.
|
|
@@ -411,12 +431,14 @@ export default class Query extends JSONSupport {
|
|
|
411
431
|
accessor datumTransformation: DatumTransformation | GeographicTransformation | null | undefined;
|
|
412
432
|
/**
|
|
413
433
|
* Specifies a search distance from a given [geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry) in a spatial query.
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
434
|
+
* The [units property](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#units) indicates the unit of measurement. In essence, setting this property
|
|
435
|
+
* creates a buffer at the specified size around the input [geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry). The query will use that
|
|
436
|
+
* buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#spatialRelationship).
|
|
437
|
+
*
|
|
438
|
+
* If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/)
|
|
439
|
+
* capability must be `true`.
|
|
417
440
|
*
|
|
418
|
-
*
|
|
419
|
-
* capability must be `true`.
|
|
441
|
+
* @see [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance)
|
|
420
442
|
*/
|
|
421
443
|
accessor distance: number | null | undefined;
|
|
422
444
|
/** Specifies the geodatabase version to display for feature service queries. */
|
|
@@ -584,6 +606,25 @@ export default class Query extends JSONSupport {
|
|
|
584
606
|
* @example query.orderByFields = ["STATE_NAME DESC"];
|
|
585
607
|
*/
|
|
586
608
|
accessor orderByFields: string[] | null | undefined;
|
|
609
|
+
/**
|
|
610
|
+
* Specifies whether to return the distance of each feature from the input geometry's buffer in a query result. It also optionally controls the sort
|
|
611
|
+
* order of results based on distances of features from the input geometry's buffer.
|
|
612
|
+
* Distance values are returned only when the following conditions are met:
|
|
613
|
+
* - The [Query.distance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#distance) is greater than 0
|
|
614
|
+
* - [Query.units](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#units) is specified
|
|
615
|
+
* - The `outDistance` is specified and its [OutDistance.returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) property is `true`
|
|
616
|
+
*
|
|
617
|
+
* > [!WARNING]
|
|
618
|
+
* >
|
|
619
|
+
* > **Known Limitations**
|
|
620
|
+
* >
|
|
621
|
+
* > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
|
|
622
|
+
* > is `true`.
|
|
623
|
+
*
|
|
624
|
+
* @since 5.1
|
|
625
|
+
*/
|
|
626
|
+
get outDistance(): OutDistance | null | undefined;
|
|
627
|
+
set outDistance(value: OutDistanceProperties | null | undefined);
|
|
587
628
|
/**
|
|
588
629
|
* Attribute fields to include in the [FeatureSet](https://developers.arcgis.com/javascript/latest/references/core/rest/support/FeatureSet/). Fields must exist in the service layer. You must list actual
|
|
589
630
|
* field names rather than field aliases. You may, however, use field aliases when you display
|
|
@@ -227,12 +227,12 @@ export default class TopFeaturesQuery extends JSONSupport {
|
|
|
227
227
|
accessor cacheHint: boolean | null | undefined;
|
|
228
228
|
/**
|
|
229
229
|
* Specifies a search distance from a given [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry) in a spatial query.
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
230
|
+
* The [units property](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#units) indicates the unit of measurement. In essence, setting this property
|
|
231
|
+
* creates a buffer at the specified size around the input [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry). The query will use that
|
|
232
|
+
* buffer to return features in the layer or layer view that adhere to the to the indicated [spatial relationship](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#spatialRelationship).
|
|
233
233
|
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
234
|
+
* If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/)
|
|
235
|
+
* capability must be `true`.
|
|
236
236
|
*/
|
|
237
237
|
accessor distance: number | null | undefined;
|
|
238
238
|
/**
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const c="
|
|
2
|
+
const c="20260602",e="5beede90a18ca6540601038f7231bcdc44b9f37a";export{c as buildDate,e as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as
|
|
2
|
+
import{VTLMaterial as t}from"./VTLMaterial.js";import{DataType as s}from"../../../../webgl/enums.js";import{VertexElementDescriptor as e}from"../../../../webgl/VertexElementDescriptor.js";class r extends t{static{this.ATTRIBUTES=[]}static{this.GEOMETRY_LAYOUT=[new e("position",2,s.SHORT,0,4)]}static{this.ATTRIBUTES_INFO={}}constructor(t){super(t),this.baseGeometryLayout=r.GEOMETRY_LAYOUT,this.properties=r.ATTRIBUTES,this.propertyInfos=r.ATTRIBUTES_INFO}}export{r as VTLBackgroundMaterial};
|
package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as o,__param as t}from"tslib";import{GraphShaderModule as e,FragmentOutput as
|
|
2
|
+
import{__decorate as o,__param as t}from"tslib";import{GraphShaderModule as e,FragmentOutput as r,location as i,uniform as s,option as p,input as l,VertexInput as a,UniformGroup as d,FragmentInput as y}from"../../../GraphShaderModule.js";import{max as u,mod as v,Vec2 as c,Float as n,Vec3 as h,Vec4 as k,length as x,smoothstep as g,negate as M,cond as T,lessThan as w,mix as C,Mat3 as b}from"../../../graph/glsl.js";class m extends a{}o([i(0,c)],m.prototype,"position",void 0),o([i(1,n)],m.prototype,"radius",void 0),o([i(2,k)],m.prototype,"color",void 0),o([i(3,n)],m.prototype,"opacity",void 0),o([i(4,n)],m.prototype,"strokeWidth",void 0),o([i(5,k)],m.prototype,"strokeColor",void 0),o([i(6,n)],m.prototype,"strokeOpacity",void 0),o([i(7,n)],m.prototype,"blur",void 0),o([i(8,n)],m.prototype,"radiusTo",void 0),o([i(9,k)],m.prototype,"colorTo",void 0),o([i(10,n)],m.prototype,"opacityTo",void 0),o([i(11,n)],m.prototype,"strokeWidthTo",void 0),o([i(12,k)],m.prototype,"strokeColorTo",void 0),o([i(13,n)],m.prototype,"strokeOpacityTo",void 0),o([i(14,n)],m.prototype,"blurTo",void 0);class W extends y{}class O extends d{}o([s(b)],O.prototype,"dvsMat",void 0),o([s(b)],O.prototype,"displayMat",void 0);class f extends d{}o([s(c)],f.prototype,"circleTranslation",void 0),o([s(n)],f.prototype,"depth",void 0),o([s(n)],f.prototype,"antialiasingWidth",void 0),o([s(n)],f.prototype,"tileOpacity",void 0);class S extends d{}o([s(n)],S.prototype,"value",void 0);class j extends d{}o([s(n)],j.prototype,"value",void 0);class B extends d{}o([s(n)],B.prototype,"value",void 0);class R extends d{}o([s(n)],R.prototype,"value",void 0);class G extends d{}o([s(n)],G.prototype,"value",void 0);class L extends d{}o([s(n)],L.prototype,"value",void 0);class P extends d{}o([s(n)],P.prototype,"value",void 0);class V extends d{}o([s(n)],V.prototype,"value",void 0);class q extends d{}o([s(n)],q.prototype,"value",void 0);class z extends d{}o([s(n)],z.prototype,"value",void 0);class A extends d{}o([s(k)],A.prototype,"value",void 0);class D extends d{}o([s(n)],D.prototype,"value",void 0);class E extends d{}o([s(k)],E.prototype,"value",void 0);class F extends d{}o([s(n)],F.prototype,"value",void 0);class H extends e{constructor(){super(...arguments),this.type="VTLShaderCircle"}vertex(o){const t=this.getColor(o).multiply(this.getOpacity(o)),e=this.getStrokeColor(o).multiply(this.getStrokeOpacity(o)),r=this.getStrokeWidth(o),i=this.getRadius(o),s=this.getBlur(o),p=i.add(r),l=u(s,this.config.antialiasingWidth.divide(p)),a=v(o.position,new c(2)).multiply(new n(2)).subtract(new n(1)),d=this.transform.dvsMat.multiply(new h(o.position.multiply(.5),new n(1))).add(this.transform.displayMat.multiply(new h(a.multiply(p).add(this.config.circleTranslation),new n(0))));return{glPosition:new k(d.xy,this.config.depth,1),strokeWidth:r,radius:i,blur:l,color:t,offset:a,strokeColor:e}}fragment(o){const t=new r,e=x(o.offset),i=g(new n(0),M(o.blur),e.subtract(new n(1))),s=T([w(o.strokeWidth,new n(.01)),()=>new n(0)],[!0,g(M(o.blur),new n(0),e.subtract(o.radius.divide(o.radius.add(o.strokeWidth))))]);return t.fragColor=C(o.color,o.strokeColor,s).multiply(i).multiply(this.config.tileOpacity),t}getRadius(o){return this.radiusMix?.value&&o.radius&&o.radiusTo?C(o.radius,o.radiusTo,this.radiusMix.value):o.radius?o.radius:this.radius?.value||new n(0)}getBlur(o){return this.blurMix?.value&&o.blur&&o.blurTo?C(o.blur,o.blurTo,this.blurMix.value):o.blur?o.blur:this.blur?.value||new n(0)}getOpacity(o){return this.opacityMix?.value&&o.opacity&&o.opacityTo?C(o.opacity,o.opacityTo,this.opacityMix.value):o.opacity?o.opacity:this.opacity?.value||new n(1)}getStrokeWidth(o){return this.strokeWidthMix?.value&&o.strokeWidth&&o.strokeWidthTo?C(o.strokeWidth,o.strokeWidthTo,this.strokeWidthMix.value):o.strokeWidth?o.strokeWidth:this.strokeWidth?.value||new n(0)}getColor(o){return this.colorMix?.value&&o.color&&o.colorTo?C(o.color,o.colorTo,this.colorMix.value):o.color?o.color:this.color?.value||new k(0)}getStrokeColor(o){return this.strokeColorMix?.value&&o.strokeColor&&o.strokeColorTo?C(o.strokeColor,o.strokeColorTo,this.strokeColorMix.value):o.strokeColor?o.strokeColor:this.strokeColor?.value||new k(0)}getStrokeOpacity(o){return this.strokeOpacityMix?.value&&o.strokeOpacity&&o.strokeOpacityTo?C(o.strokeOpacity,o.strokeOpacityTo,this.strokeOpacityMix.value):o.strokeOpacity?o.strokeOpacity:this.strokeOpacity?.value||new n(0)}}o([s(O)],H.prototype,"transform",void 0),o([s(f)],H.prototype,"config",void 0),o([p(S)],H.prototype,"radius",void 0),o([p(j)],H.prototype,"radiusMix",void 0),o([p(B)],H.prototype,"blur",void 0),o([p(R)],H.prototype,"blurMix",void 0),o([p(G)],H.prototype,"opacity",void 0),o([p(L)],H.prototype,"opacityMix",void 0),o([p(P)],H.prototype,"strokeOpacity",void 0),o([p(V)],H.prototype,"strokeOpacityMix",void 0),o([p(q)],H.prototype,"strokeWidth",void 0),o([p(z)],H.prototype,"strokeWidthMix",void 0),o([p(A)],H.prototype,"color",void 0),o([p(D)],H.prototype,"colorMix",void 0),o([p(E)],H.prototype,"strokeColor",void 0),o([p(F)],H.prototype,"strokeColorMix",void 0),o([t(0,l(m))],H.prototype,"vertex",null),o([t(0,l(W))],H.prototype,"fragment",null);export{H as VTLShaderCircle};
|