@arcgis/core 5.1.0-next.136 → 5.1.0-next.137
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 +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/144f103b789e1657bad6.js +2 -0
- package/assets/esri/core/workers/chunks/1a4bec464daa9662ab2a.js +1 -0
- package/assets/esri/core/workers/chunks/1b4e64cb23212229f982.js +1 -0
- package/assets/esri/core/workers/chunks/1eef5e0b4c621af0261d.js +2 -0
- package/assets/esri/core/workers/chunks/22fc6de248290e7dd005.js +2 -0
- package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +1 -0
- package/assets/esri/core/workers/chunks/{98f64d9ca6f2a76cf916.js → 35c4037b8eea067d9638.js} +7 -7
- package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +1 -0
- package/assets/esri/core/workers/chunks/4d8388370fe66307dcf2.js +1 -0
- package/assets/esri/core/workers/chunks/{6649acaceab00ad30e7f.js → 50345dfc00380b158c96.js} +1 -1
- package/assets/esri/core/workers/chunks/53251094c0926d10f4e7.js +1 -0
- package/assets/esri/core/workers/chunks/{d7acbc2ddff4cee8a465.js → 5ee887fc6e1e0e70e02f.js} +1 -1
- package/assets/esri/core/workers/chunks/5ff6170f43119395b5f2.js +1 -0
- package/assets/esri/core/workers/chunks/{7c787cd27af3cec75027.js → 634d3f7f3e1c7bc35045.js} +1 -1
- package/assets/esri/core/workers/chunks/69da36b217688d46b3d8.js +1 -0
- package/assets/esri/core/workers/chunks/6c0fc20a62f8f1921423.js +1 -0
- package/assets/esri/core/workers/chunks/{a2247f4c3116efb16c4f.js → 7e23de8d9b2d938808f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d43619c73721946441b.js → 8810bac7b4a98472268a.js} +1 -1
- package/assets/esri/core/workers/chunks/{67ea60aef8fde61420da.js → 89c072b5e28d65093ca2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f64241d613f56fbcd981.js → 8d23ea08912813916b9d.js} +1 -1
- package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +1 -0
- package/assets/esri/core/workers/chunks/936cabf20c526f72d781.js +1 -0
- package/assets/esri/core/workers/chunks/9535036f5f75b2cf0bba.js +1 -0
- package/assets/esri/core/workers/chunks/{feacdcf0ba9ea58f1616.js → a3870723a71513e002ae.js} +1 -1
- package/assets/esri/core/workers/chunks/a55275f861289f7a1d77.js +1 -0
- package/assets/esri/core/workers/chunks/a60700012465b22e7515.js +2 -0
- package/assets/esri/core/workers/chunks/{c9b212fe844ab918127f.js → aca13a98ca4a900d2d5b.js} +1 -1
- package/assets/esri/core/workers/chunks/{ac16016964be3b684e98.js → aded4e704e09a28edc8f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e006d1c26ae234f5b086.js → ae105c2dd49494eed011.js} +1 -1
- package/assets/esri/core/workers/chunks/b32d181df0959d68ca9a.js +1 -0
- package/assets/esri/core/workers/chunks/b7a276b028f192ab7459.js +1 -0
- package/assets/esri/core/workers/chunks/{0b522e05668bef729b1b.js → ceb5bd9f2afaa2ea0808.js} +1 -1
- package/assets/esri/core/workers/chunks/d07068c44d560e4ce02e.js +1 -0
- package/assets/esri/core/workers/chunks/ecd51cb0a428155ea680.js +2 -0
- package/assets/esri/core/workers/chunks/{f1ff33584680d8718400.js → fb9f8b6cc2b4ae5b60df.js} +1 -1
- package/assets/esri/core/workers/chunks/{ecbf84a1f42e6188faab.js → fd629872b5c07853f695.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
- 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/config.js +1 -1
- package/core/date.js +1 -1
- package/form/FormTemplate.d.ts +15 -20
- package/form/elements/AttachmentElement.d.ts +38 -11
- package/form/elements/Element.d.ts +9 -6
- package/form/elements/FieldElement.d.ts +0 -1
- package/form/elements/GroupElement.d.ts +4 -6
- package/form/elements/RelationshipElement.d.ts +8 -8
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +34 -18
- package/form/elements/inputs/attachments/AudioInput.d.ts +4 -3
- package/form/elements/inputs/attachments/DocumentInput.d.ts +2 -6
- package/form/elements/inputs/attachments/ImageInput.d.ts +4 -3
- package/form/elements/inputs/attachments/Input.d.ts +6 -3
- package/form/elements/inputs/attachments/SignatureInput.d.ts +3 -3
- package/form/elements/inputs/attachments/VideoInput.d.ts +4 -3
- package/form/elements.d.ts +6 -12
- package/form/types.d.ts +0 -4
- package/kernel.js +1 -1
- package/layers/AnnotationFeatureLayer.d.ts +2 -1
- package/layers/DimensionFeatureLayer.d.ts +2 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +1 -1
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
- package/layers/graphics/sources/parquet/fileProviderChangedError.js +2 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/support/RasterBandInfo.js +1 -1
- package/layers/types.d.ts +1 -0
- package/package.json +2 -2
- package/rest/support/AttachmentQuery.d.ts +13 -1
- package/rest/support/AttachmentQuery.js +1 -1
- package/rest/support/OutDistance.d.ts +5 -1
- package/rest/support/PrintParameters.d.ts +2 -1
- package/rest/support/Query.d.ts +2 -0
- package/support/basemapUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/AFeatureContainer.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +6 -6
- package/views/PopupView.d.ts +3 -0
- package/views/layers/AnnotationFeatureLayerView.d.ts +9 -1
- package/views/layers/DimensionFeatureLayerView.d.ts +9 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/types.d.ts +12 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.d.ts +16 -12
- package/widgets/FeatureForm.d.ts +14 -16
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/types.d.ts +20 -0
- package/widgets/FeatureTable.d.ts +14 -2
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +0 -1
- package/assets/esri/core/workers/chunks/283934255564d33031de.js +0 -1
- package/assets/esri/core/workers/chunks/312676c9027684a08107.js +0 -1
- package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +0 -1
- package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +0 -1
- package/assets/esri/core/workers/chunks/45922ec95c7fb704bae1.js +0 -1
- package/assets/esri/core/workers/chunks/5b83893a58529ef5f08b.js +0 -1
- package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +0 -1
- package/assets/esri/core/workers/chunks/7197972041f5700c235d.js +0 -1
- package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +0 -1
- package/assets/esri/core/workers/chunks/786905f34da9cdad53f0.js +0 -2
- package/assets/esri/core/workers/chunks/897a856c00b2b828efe9.js +0 -2
- package/assets/esri/core/workers/chunks/8a88146de5b12fd4dcd8.js +0 -1
- package/assets/esri/core/workers/chunks/9133c1b7cc1c9da27deb.js +0 -1
- package/assets/esri/core/workers/chunks/934cd06318b69f37d72b.js +0 -1
- package/assets/esri/core/workers/chunks/98d0180d2e5d9c73a04a.js +0 -1
- package/assets/esri/core/workers/chunks/9bcebaf0d0e43db0b07f.js +0 -2
- package/assets/esri/core/workers/chunks/b3be96d5f3f6b4342907.js +0 -1
- package/assets/esri/core/workers/chunks/c0528b4590e083e2c1ff.js +0 -1
- package/assets/esri/core/workers/chunks/f170d80c5930db1d630e.js +0 -2
- package/assets/esri/core/workers/chunks/f6987cacbc55a68ec7ef.js +0 -2
- /package/assets/esri/core/workers/chunks/{f170d80c5930db1d630e.js.LICENSE.txt → 144f103b789e1657bad6.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f6987cacbc55a68ec7ef.js.LICENSE.txt → 1eef5e0b4c621af0261d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9bcebaf0d0e43db0b07f.js.LICENSE.txt → 22fc6de248290e7dd005.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{786905f34da9cdad53f0.js.LICENSE.txt → a60700012465b22e7515.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{897a856c00b2b828efe9.js.LICENSE.txt → ecd51cb0a428155ea680.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{EventEmitter as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{property as s,subclass as d}from"../../core/accessorSupport/decorators.js";import{isVersionInEditSession as n,defaultVersionNameLookup as r}from"../../versionManagement/support/versionManagementUtils.js";const o=new e;function
|
|
2
|
+
import{__decorate as t}from"tslib";import{EventEmitter as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{property as s,subclass as d}from"../../core/accessorSupport/decorators.js";import{isVersionInEditSession as n,defaultVersionNameLookup as r}from"../../versionManagement/support/versionManagementUtils.js";const o=new e;function l(t){return o.on("apply-edits",new WeakRef(t))}function a(t){return o.on("update-moment",new WeakRef(t))}function h(t,e,i=null,s=!1){const d=Promise.withResolvers();return s=null==e||s,o.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:s,result:d.promise}),d}function c(t,e,i=null,s){o.emit("update-moment",{serviceUrl:t,layerId:e,gdbVersion:i,moment:s})}const u=Symbol();function m(t){return null!=t&&"object"==typeof t&&u in t}function p(t){return null!=t&&"object"==typeof t&&"gdbVersion"in t}function b(t){return null!=t&&"object"==typeof t&&"historicMoment"in t}function g(t,e,i){const s=new URL(t).host,d=r.get(s),n=t=>!t||t===d;return n(e)&&n(i)||e===i}const F=e=>{var r;const o=e;let h=class extends o{static{r=u}constructor(...t){super(...t),this[r]=!0,this._applyEditsHandler=t=>{const{serviceUrl:e,layerId:s,gdbVersion:d,mayReceiveServiceEdits:n,result:r}=t,o=e===this.url,l=null!=s&&null!=this.layerId&&s===this.layerId,a=p(this),h=p(this)&&g(e,d,this.gdbVersion);if(!o||a&&!h||!l&&!n)return;const c=r.then(t=>{if(this.lastEditsEventDate=new Date,l&&(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length))return this.emit("edits",i(t)),t;const s=t.editedFeatures?.find(({layerId:t})=>t===this.layerId);if(s){const{adds:e,updates:d,deletes:n}=s.editedFeatures,r={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],deletedFeatures:n?n.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],updatedFeatures:d?d.map(({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return this.emit("edits",r),r}const n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,n.historicMoment)&&this.emit("edits",n),n}).then(t=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,t.historicMoment)&&(this.historicMoment=t.historicMoment),t));this.emit("apply-edits",{result:c})},this._updateMomentHandler=t=>{const{serviceUrl:e,gdbVersion:i,moment:s}=t,d=e===this.url,n=p(this),r=p(this)&&g(e,i,this.gdbVersion),o=p(this)&&!g(e,this.gdbVersion,null);d&&n&&r&&o&&"historicMoment"in this&&this.historicMoment!==s&&(this.historicMoment=s)},this.when().then(()=>{this.addHandles(l(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(a(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(t,e,i){return"historicMoment"in this&&this.historicMoment!==i&&n(t,e)}};return t([s()],h.prototype,"lastEditsEventDate",void 0),h=t([d("esri.layers.mixins.EditBusLayer")],h),h};export{F as EditBusLayer,h as emitApplyEditsEvent,c as emitUpdateMomentEvent,m as isEditBusLayer,p as isLayerWithGDBVersion,b as isLayerWithHistoricMoment,l as onApplyEditsEvent,a as onUpdateMomentEvent,g as versionMatches};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as
|
|
2
|
+
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as o,ConstantElevation as i,ElevationSource as s}from"./ElevationSourceDefinitions.js";function l(e,t,r){return t&&(e=`${t}${e}`),r&&(e+=`${r}`),e}function a(e,t,r){let{url:n}=e;return n?(n=l(n,t,r),new s({...e,url:n})):null}function c(e,t,r){return e?o(e)?new i(e):a(e,t,r):e}const u=new e({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),f=new e({Feet:"feet",Meter:"meter"}),m=new e({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique",Terrestrial360Video:"terrestrial-360-video",TerrestrialFrameVideo:"terrestrial-frame-video",Aerial360Video:"aerial-360-video",AerialFrameVideo:"aerial-frame-video","":null}),d=new Map;function p(e){const[t,r,n,o,i,s,l,a,c,u,f,m,d,p,h,w,y,v,D,L,C,z]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:o,z:i,omega:s,phi:l,kappa:a,...g([c,u,f,m,d,p],[w,y],[v,D,L],[C,z],h)}}d.set("1",w),d.set("3",y),d.set("2",p),d.set("4",v);const h=e=>{const t=e.map(e=>parseFloat(e)).filter(e=>!isNaN(e));if(t.length===e.length)return t};function g(e,t,r,n,o){const i=h(e),s=h(t),l=h(r),a=h(n);return{affineTransformations:6===i?.length?i:void 0,focalLength:6===i?.length?parseFloat(o):void 0,principalOffsetPoint:2!==s?.length?[0,0]:s,radialDistortionCoefficients:3!==l?.length?[0,0,0]:l,tangentialDistortionCoefficients:2!==a?.length?[0,0]:a}}function w(e){const[t,r,n,o,i,s,l,a,c,u,f,m,d,p,h,w,y,v,D,L,C,z]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:o,z:i,heading:s,pitch:l,roll:a,...g([c,u,f,m,d,p],[w,y],[v,D,L],[C,z],h)}}function y(e){const[t,r,n,o,i,s,l,a,c,u,f,m,d,p,h,w,y,v,D,L,C,z]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:o,z:i,yaw:s,pitch:l,roll:a,...g([c,u,f,m,d,p],[w,y],[v,D,L],[C,z],h)}}function v(e){const[t,r,o,i,s,...l]=e.slice(1),a=d.get(s),c=n.get(s)?.constructor;if(!a||!c)return null;return{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:i,properties:new c(a([s,"",...l]))}}function D(e){if(!e)return null;const t=`${e}`.split("|");if(0===t.length)return null;const r=n.get(t[0]);if(!r)return null;const o=d.get(t[0]);if(!o)return null;return new(0,r.constructor)(o(t))}function L(e){return Array.isArray(e)&&e?.length>5&&!e.some(isNaN)}function C(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function z(e){return e.spatialReference.isGeographic?r(e):e.clone()}function N(e){return e.isGeographic?1:t(e)}function I(e){const t=e.match(/^(.*)\/rest\/services\/(.*)$/);return t?t[1]:null}const W="sequenceorder";function j(e,t){if(!e?.length)return null;return e.map(({field:e,order:r})=>{const n=t.find(t=>t.name.toLowerCase()===e.toLowerCase());return n?{fieldName:n.name,sortOrder:"desc"===r?.toLowerCase()?"desc":"asc"}:null}).filter(e=>null!=e)}function K(e,t,r){const n=j(r,t);if(n?.length)return n;if(!e){const e=t.find(e=>e.name.toLocaleLowerCase()===W.toLocaleLowerCase());return e?[{fieldName:e.name,sortOrder:"asc"}]:null}const o=t.find(t=>t.name.toLowerCase()===e.trim().toLowerCase());return o?[{fieldName:o.name,sortOrder:"asc"}]:null}export{l as appendPrefixAndSuffix,z as convertGeographicToWebMercator,D as createCameraOrientation,W as defaultSequenceOrderField,I as getArcGISServerUrl,c as getEffectiveElevationSource,N as getMetersPerUnitOfSR,L as isOrientationAccuracy,m as orientedImageryTypeMap,C as padAccuracyArray,K as parseSequenceOrderFields,a as processElevationSource,u as timeIntervalUnitTypeMap,d as transformersRegistry,f as verticalMeasurementTypeMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";var n;function t(e){return e=Number(e),isNaN(e)?void 0:e}let o=class extends a{static{n=this}constructor(e){super(e),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new n({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};e([r({json:{name:"BandName",write:!0}})],o.prototype,"name",void 0),e([r({json:{read:{source:["WavelengthMin","Wavelength"],reader:(e,a)=>t(a.WavelengthMin??a.Wavelength)},write:{target:"WavelengthMin"}}})],o.prototype,"minWavelength",void 0),e([r({json:{name:"WavelengthMax",read:{reader:t},write:!0}})],o.prototype,"maxWavelength",void 0),e([r({json:{name:"RadianceBias",read:{reader:t},write:!0}})],o.prototype,"radianceBias",void 0),e([r({json:{name:"RadianceGain",read:{reader:t},write:!0}})],o.prototype,"radianceGain",void 0),e([r({json:{name:"ReflectanceBias",read:{reader:t},write:!0}})],o.prototype,"reflectanceBias",void 0),e([r({json:{name:"ReflectanceGain",read:{reader:t},write:!0}})],o.prototype,"reflectanceGain",void 0),e([r({json:{name:"SolarIrradiance",read:{reader:t},write:!0}})],o.prototype,"solarIrradiance",void 0),o=n=e([i("esri.layers.support.RasterBandInfo")],o);export{o as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONSupport as a}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";var n;function t(e){return e=Number(e),isNaN(e)?void 0:e}let o=class extends a{static{n=this}constructor(e){super(e),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new n({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};e([r({json:{name:"BandName",write:!0}})],o.prototype,"name",void 0),e([r({json:{read:{source:["WavelengthMin","Wavelength","WAVELENGTH"],reader:(e,a)=>t(a.WavelengthMin??a.Wavelength??a.WAVELENGTH)},write:{target:"WavelengthMin"}}})],o.prototype,"minWavelength",void 0),e([r({json:{name:"WavelengthMax",read:{reader:t},write:!0}})],o.prototype,"maxWavelength",void 0),e([r({json:{name:"RadianceBias",read:{reader:t},write:!0}})],o.prototype,"radianceBias",void 0),e([r({json:{name:"RadianceGain",read:{reader:t},write:!0}})],o.prototype,"radianceGain",void 0),e([r({json:{name:"ReflectanceBias",read:{reader:t},write:!0}})],o.prototype,"reflectanceBias",void 0),e([r({json:{name:"ReflectanceGain",read:{reader:t},write:!0}})],o.prototype,"reflectanceGain",void 0),e([r({json:{name:"SolarIrradiance",read:{reader:t},write:!0}})],o.prototype,"solarIrradiance",void 0),o=n=e([i("esri.layers.support.RasterBandInfo")],o);export{o as default};
|
package/layers/types.d.ts
CHANGED
|
@@ -434,6 +434,7 @@ export interface QueryCapabilities {
|
|
|
434
434
|
* Indicates if the layer's query operation supports returning distance values of each feature in the query result using
|
|
435
435
|
* the [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) property.
|
|
436
436
|
*
|
|
437
|
+
* @internal
|
|
437
438
|
* @since 5.1
|
|
438
439
|
*/
|
|
439
440
|
supportsOutDistance: boolean;
|
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.137",
|
|
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.18.0",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.138",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.1.1",
|
|
25
25
|
"@vaadin/grid": "~25.1.4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
2
2
|
|
|
3
|
-
export interface AttachmentQueryProperties extends Partial<Pick<AttachmentQuery, "attachmentsWhere" | "attachmentTypes" | "cacheHint" | "globalIds" | "keywords" | "name" | "num" | "objectIds" | "orderByFields" | "returnMetadata" | "size" | "start" | "where">> {}
|
|
3
|
+
export interface AttachmentQueryProperties extends Partial<Pick<AttachmentQuery, "attachmentsWhere" | "attachmentTypes" | "cacheHint" | "globalIds" | "historicMoment" | "keywords" | "name" | "num" | "objectIds" | "orderByFields" | "returnMetadata" | "size" | "start" | "where">> {}
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* This class defines parameters for executing queries for feature attachments from a
|
|
@@ -69,6 +69,18 @@ export default class AttachmentQuery extends JSONSupport {
|
|
|
69
69
|
* to be `true`.
|
|
70
70
|
*/
|
|
71
71
|
accessor globalIds: string[] | null | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Retrieve attachments from a specific historic moment.
|
|
74
|
+
*
|
|
75
|
+
* This parameter only applies if
|
|
76
|
+
* the `supportsQueryWithHistoricMoment` capability of the service being queried is `true`.
|
|
77
|
+
*
|
|
78
|
+
* Used by BatchAttributeForm to support versioned data
|
|
79
|
+
* See also: [Query.historicMoment](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#historicMoment)
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
accessor historicMoment: Date | null | undefined;
|
|
72
84
|
/**
|
|
73
85
|
* Used to query for attachments that match the provided `keywords`.
|
|
74
86
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureType as i}from"../../core/accessorSupport/ensureType.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=class extends e{static{a=this}constructor(t){super(t),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.orderByFields=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new a(r({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([o({type:[String],json:{write:!0}})],p.prototype,"attachmentTypes",void 0),t([o({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],p.prototype,"attachmentsWhere",void 0),t([o({type:Boolean,json:{write:!0}})],p.prototype,"cacheHint",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"keywords",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"globalIds",void 0),t([o({json:{write:!0}})],p.prototype,"name",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],p.prototype,"num",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"orderByFields",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],p.prototype,"returnMetadata",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"size",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],p.prototype,"start",void 0),t([n("start"),n("num")],p.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],p.prototype,"where",void 0),p=a=t([s("esri.rest.support.AttachmentQuery")],p),p.from=i(p);export{p as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{ensureType as i}from"../../core/accessorSupport/ensureType.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";var a;let p=class extends e{static{a=this}constructor(t){super(t),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.orderByFields=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}clone(){return new a(r({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,historicMoment:this.historicMoment,name:this.name,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};t([o({type:[String],json:{write:!0}})],p.prototype,"attachmentTypes",void 0),t([o({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],p.prototype,"attachmentsWhere",void 0),t([o({type:Boolean,json:{write:!0}})],p.prototype,"cacheHint",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"keywords",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"globalIds",void 0),t([o({json:{write:!0}})],p.prototype,"name",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],p.prototype,"num",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],p.prototype,"orderByFields",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],p.prototype,"returnMetadata",void 0),t([o({type:[Number],json:{write:!0}})],p.prototype,"size",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],p.prototype,"start",void 0),t([n("start"),n("num")],p.prototype,"writeStart",null),t([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],p.prototype,"where",void 0),t([o()],p.prototype,"historicMoment",void 0),t([n("historicMoment")],p.prototype,"writeHistoricMoment",null),p=a=t([s("esri.rest.support.AttachmentQuery")],p),p.from=i(p);export{p as default};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ClonableMixin } from "../../core/Clonable.js";
|
|
2
2
|
import type { JSONSupport } from "../../core/JSONSupport.js";
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* @since 5.1
|
|
7
|
+
*/
|
|
5
8
|
export interface OutDistanceProperties extends Partial<Pick<OutDistance, "ascendingOrder" | "outDistanceUnit" | "returnDistance">> {}
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -20,6 +23,7 @@ export interface OutDistanceProperties extends Partial<Pick<OutDistance, "ascend
|
|
|
20
23
|
* > 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
24
|
* > is `true`.
|
|
22
25
|
*
|
|
26
|
+
* @internal
|
|
23
27
|
* @since 5.1
|
|
24
28
|
*/
|
|
25
29
|
export default class OutDistance extends OutDistanceSuperclass {
|
|
@@ -18,7 +18,8 @@ export interface PrintParametersProperties extends Partial<Pick<PrintParameters,
|
|
|
18
18
|
export default class PrintParameters extends Accessor {
|
|
19
19
|
constructor(properties?: PrintParametersProperties);
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* An array of [geographic transformations](https://developers.arcgis.com/javascript/latest/references/core/geometry/operators/support/GeographicTransformation/) to be used by the print service when
|
|
22
|
+
* projecting geometries for the printout.
|
|
22
23
|
*
|
|
23
24
|
* @since 5.1
|
|
24
25
|
*/
|
package/rest/support/Query.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export interface QueryProperties extends Partial<Pick<Query, "aggregateIds" | "c
|
|
|
53
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
54
|
* > is `true`.
|
|
55
55
|
*
|
|
56
|
+
* @internal
|
|
56
57
|
* @since 5.1
|
|
57
58
|
*/
|
|
58
59
|
outDistance?: OutDistanceProperties | null;
|
|
@@ -623,6 +624,7 @@ export default class Query extends JSONSupport {
|
|
|
623
624
|
* > 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
|
|
624
625
|
* > is `true`.
|
|
625
626
|
*
|
|
627
|
+
* @internal
|
|
626
628
|
* @since 5.1
|
|
627
629
|
*/
|
|
628
630
|
get outDistance(): OutDistance | null | undefined;
|
package/support/basemapUtils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../core/Collection.js";import{mappedFind as r}from"../core/maybe.js";import{Url as t,makeAbsolute as a,normalize as n}from"../core/urlUtils.js";import{effectEquals as l}from"../layers/effects/utils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";function s(e){return"Web Scene"===e.portalItem?.type||e.referenceLayers.some(e=>"scene"===e.type)}function u(e){return!!e?.portalItem?.tags?.some(e=>"beta"===e.toLowerCase())||!!e?.portalItem?.categories?.includes("/Categories/Status/Beta")}function c(e,r){const t=e.allLayerViews.find(e=>e.uid===r);return t?.layer.parent===e.map?.basemap}let
|
|
2
|
+
import e from"../core/Collection.js";import{mappedFind as r}from"../core/maybe.js";import{Url as t,makeAbsolute as a,normalize as n}from"../core/urlUtils.js";import{effectEquals as l}from"../layers/effects/utils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";function s(e){return"Web Scene"===e.portalItem?.type||e.referenceLayers.some(e=>"scene"===e.type)}function u(e){return!!e?.portalItem?.tags?.some(e=>"beta"===e.toLowerCase())||!!e?.portalItem?.categories?.includes("/Categories/Status/Beta")}function c(e){return!!e?.portalItem?.tags?.some(e=>"preview"===e.toLowerCase())||!!e?.portalItem?.categories?.includes("/Categories/Status/Preview")}function o(e,r){const t=e.allLayerViews.find(e=>e.uid===r);return t?.layer.parent===e.map?.basemap}let f;function y(e){if(f)return f(e);let r=null;const t=g(e),a=!t?.baseLayers.length;for(const n in i){const e=x(t,w(i[n]),{mustMatchReferences:a});if("equal"===e){r=n;break}"base-layers-equal"===e&&(r=n)}return r}function p(e){f=e}function m(e,r){if(e===r)return!0;if(null!=e?.portalItem?.id&&e.portalItem.id===r?.portalItem?.id)return!0;return"equal"===x(g(e),g(r),{mustMatchReferences:!0})}function d(e){return!!e?.baseLayers.concat(e.referenceLayers).some(b)}function b(e){if(v(e.url))return!0;if("vector-tile"===e.type)for(const r in e.sourceNameToSource){const t=e.sourceNameToSource[r];if(v(t?.sourceUrl))return!0}return!1}function L(e,r){if(null==r||null==e)return{spatialReference:null,updating:!1};if("not-loaded"===r.loadStatus)return r.load(),{spatialReference:null,updating:!0};if(r.spatialReference)return{spatialReference:r.spatialReference,updating:!1};if(0===r.baseLayers.length)return{spatialReference:null,updating:!1};const t=r.baseLayers.at(0);switch(t.loadStatus){case"not-loaded":t.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const a=(("supportedSpatialReferences"in t?t.supportedSpatialReferences:null)||["tileInfo"in t?t.tileInfo?.spatialReference:t.spatialReference]).filter(Boolean),n=e.spatialReference;return n?{spatialReference:a.find(e=>n.equals(e))??a[0]??null,updating:!1}:{spatialReference:a[0],updating:!1}}const S=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function v(e){if(!e)return!1;const r=new t(a(e));return!!r.authority&&S.test(r.authority)}function g(e){return e?!e.loaded&&e.resourceInfo?w(e.resourceInfo.data):{baseLayers:I(e.baseLayers),referenceLayers:I(e.referenceLayers),groundLayers:I(e.groundLayers)}:null}function I(r){return(e.isCollection(r)?r.toArray():r).map(h)}function h(e){return{type:e.type,effect:"effect"in e?e.effect:void 0,url:C("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl||""),minScale:"minScale"in e&&null!=e.minScale?e.minScale:0,maxScale:"maxScale"in e&&null!=e.maxScale?e.maxScale:0,opacity:null!=e.opacity?e.opacity:1,visible:null==e.visible||!!e.visible,sublayers:"map-image"!==e.type&&"wms"!==e.type||null==e.sublayers?void 0:e.sublayers?.map(e=>({id:e.id,visible:e.visible})),activeLayerId:"wmts"===e.type?e.activeLayer?.id:void 0}}function R(e){return e.isReference||"ArcGISSceneServiceLayer"===e.layerType}function w(e){return e?{baseLayers:T((e.baseMapLayers??[]).filter(e=>!R(e))),referenceLayers:T((e.baseMapLayers??[]).filter(e=>R(e))),groundLayers:T(e.groundLayers??[])}:null}function T(e){return e.map(e=>q(e))}function q(e){let r;switch(e.layerType){case"VectorTileLayer":r="vector-tile";break;case"ArcGISTiledMapServiceLayer":r="tile";break;case"ArcGISSceneServiceLayer":r="scene";break;case"IntegratedMesh3DTilesLayer":r="IntegratedMesh3DTilesLayer";break;default:r="unknown"}return{type:r,effect:e.effect,url:C(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale??0,maxScale:e.maxScale??0,opacity:e.opacity??1,visible:null==e.visibility||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function x(e,r,t){if(null!=e!=(null!=r))return"not-equal";if(!e||!r)return"equal";if(!U(e.baseLayers,r.baseLayers))return"not-equal";return U(e.referenceLayers,r.referenceLayers)?"equal":t.mustMatchReferences?"not-equal":"base-layers-equal"}function U(e,r){if(e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!M(e[t],r[t]))return!1;return!0}function M(e,r){if(e.type!==r.type||e.url!==r.url||e.minScale!==r.minScale||e.maxScale!==r.maxScale||e.visible!==r.visible||e.opacity!==r.opacity)return!1;if(!l(e.effect,r.effect))return!1;if(null!=e.activeLayerId||null!=r.activeLayerId)return e.activeLayerId===r.activeLayerId;if(null!=e.sublayers||null!=r.sublayers){if(null==e.sublayers||null==r.sublayers||e.sublayers.length!==r.sublayers.length)return!1;for(let t=0;t<e.sublayers.length;t++){const a=e.sublayers.at(t),n=r.sublayers.at(t);if(a?.id!==n?.id||a?.visible!==n?.visible)return!1}}return!0}function C(e){return e?n(e).replace(/^\s*https?:/i,"").toLowerCase():""}function k(e){if(!e)return null;const{thumbnailUrl:t}=e;if(t)return t;const a=y(e);return a?i[a].thumbnailUrl:r(e.baseLayers,j)}function j(e){return"portalItem"in e?e.portalItem?.thumbnailUrl:void 0}export{m as contentEquals,L as findSpatialReference,k as getBasemapThumbnailUrl,y as getWellKnownBasemapId,d as hasDeveloperBasemapLayer,s as isBasemap3D,u as isBasemapInBeta,c as isBasemapInPreview,o as isBasemapLayerView,b as isDeveloperBasemapLayer,M as layerDefinitionEquals,h as layerToDefinition,p as overrideGetWellKnownBasemapId};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const b="20260618",f="96b2158c579fff18932c64fa8ba41310a5b3d28b";export{b as buildDate,f as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{AttributeStoreView as e}from"./webgl/AttributeStoreView.js";import t from"./webgl/TileContainer.js";const i=60;class s extends t{constructor(t){super(t),this._statisticsByLevel=new Map,this._entityIndex=new Map,this.attributeView=new e}destroy(){super.destroy(),this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(e){e.context.capabilities.enable("textureFloatLinear"),super.doRender(e)}get hasAnimations(){for(const e of this.children)if(e.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),0!==this.attributeView.size))for(const e of this._entityIndex.values())e.dirty&&(this.attributeView.setData(e.displayId,7,0,e.firstIndexed),e.dirty=!1)}restartAnimation(e){const t=this._entityIndex.get(e);if(!t)return;const i=performance.now()/1e3;t.firstIndexed=i,t.dirty=!0}restartAllAnimations(){const e=performance.now()/1e3;for(const[t,i]of this._entityIndex)i.firstIndexed=e,i.dirty=!0}_reindexFeatures(){const e=performance.now()/1e3;for(const t of this.children)for(const i of t.entityIds){const{objectId:t}=i;let s=this._entityIndex.get(t);s||(s={objectId:t,displayId:0,firstIndexed:e,lastIndexed:0,dirty:!0},this._entityIndex.set(t,s)),s.lastIndexed=e,s.displayId=i.displayId}for(const[t,s]of this._entityIndex)e-s.lastIndexed>i&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update()&&this.requestRender(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(e){const t=super.createRenderParams(e);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}}export{s as AFeatureContainer};
|
|
2
|
+
import{AttributeStoreView as e}from"./webgl/AttributeStoreView.js";import t from"./webgl/TileContainer.js";const i=60;class s extends t{constructor(t){super(t),this._statisticsByLevel=new Map,this._entityIndex=new Map,this.attributeView=new e}destroy(){super.destroy(),this.children.forEach(e=>e.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(e){e.context.capabilities.enable("textureFloatLinear"),super.doRender(e)}get hasAnimations(){for(const e of this.children)if(e.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),0!==this.attributeView.size))for(const e of this._entityIndex.values())e.dirty&&(this.attributeView.setData(e.displayId,7,0,e.firstIndexed),e.dirty=!1)}restartAnimation(e){const t=this._entityIndex.get(e);if(!t)return;const i=performance.now()/1e3;t.firstIndexed=i,t.dirty=!0}restartAllAnimations(){const e=performance.now()/1e3;for(const[t,i]of this._entityIndex)i.firstIndexed=e,i.dirty=!0}_reindexFeatures(){const e=performance.now()/1e3;for(const t of this.children)for(const i of t.entityIds){const{objectId:t}=i;let s=this._entityIndex.get(t);s||(s={objectId:t,displayId:0,firstIndexed:e,lastIndexed:0,dirty:!0},this._entityIndex.set(t,s)),s.lastIndexed=e,s.displayId=i.displayId}for(const[t,s]of this._entityIndex)e-s.lastIndexed>i&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update()&&(this.requestRender(),this.hasLabels&&this.requestDeclutter()),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(e){const t=super.createRenderParams(e);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}}export{s as AFeatureContainer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as
|
|
2
|
+
import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{estimateNumberArrayMemory as i}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{dataDrivenUnit2 as r,dataDrivenUnit1 as n,dataDrivenUnit0 as a,visualVariableUnit as u,localTimeOriginUnit as h,gpgpuUnit as o,animationUnit as d,filterFlagsUnit as l}from"./definitions.js";import{getDisplayIdTexel as g}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as _}from"./Utils.js";import{SizedPixelFormat as c}from"../../../webgl/enums.js";import{DisposableFramebufferObject as x}from"../../../webgl/FramebufferObject.js";import f from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const m=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class T{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b(this.size);if(t.wrapMode=33071,t.samplingMode=9728,t.dataType=this.pixelType,2===this.blockIndex)t.pixelFormat=6403,t.internalFormat=c.R8;return t}get usedMemory(){return null!=this.data?i(this.data):0}setData(t,e,i){const s=g(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=g(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),u=4,h=(s-s%this.size)/this.size,o=(r-r%this.size)/this.size,d=h,l=this.size,g=o,_=h*this.size*u,c=(l+g*this.size)*u-_,x=p(this.pixelType),f=new x(n,_*x.BYTES_PER_ELEMENT,c),b=this.size,T=g-d+1;if(T>this.size)return void m().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,T,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),u=_(r),h=new(p(r))(new ArrayBuffer(i*s*u*this.texelSize)),o=t.boundFramebuffer,{x:d,y:l,width:g,height:c}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,h),e.updateData(0,0,0,2*i,s/2,h),t.setViewport(d,l,g,c),t.bindFramebuffer(o)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._hasPendingUpdate=s(!1),this._locked=!1}get updating(){return this._hasPendingUpdate.value}get locked(){return this._locked}get usedMemory(){let t=0;for(const e of this._data??[])null!=e&&(t+=e.usedMemory);return t}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map((t,e)=>null!=t?new T(t,this.size,e):null);else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new T(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose(),this._defaultTexture=null,this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}setLocalTimeOrigin(t,e){this.setData(t,7,0,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVisualVariableData(t,e){return this.getData(t,3,e,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){return this._locked=!1,this.update()}requestUpdate(t){this._version=t.version,this._pendingAttributeUpdates.push(t),this._hasPendingUpdate.value=!0,has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}get hasPendingUpdates(){return this._pendingAttributeUpdates.length>0}update(){if(this._locked)return!1;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];const e=!!t.length;for(const i of t){const{blockData:t,initArgs:e,sendUpdateEpoch:s,version:r}=i;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${s}] AttributeStoreView.applyUpdate`),this._version=r,this._epoch=s,null!=e&&this._initialize(e);const n=this._data;for(let i=0;i<t.length;i++){const e=t[i],s=n[i];null!=s&&null!=e&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${i}] AttributeStoreView.update`,{block:e}),s.update(e))}}return this._hasPendingUpdate.value=!1,e}getUniforms(){return{size:this.size}}getTextures(t){return{filterFlags:{texture:this._getTexture(t,0),unit:l},animation:{texture:this._getTexture(t,1),unit:d},gpgpu:{texture:this._getTexture(t,2),unit:o},localTimeOrigin:{texture:this._getTexture(t,7),unit:h},visualVariableData:{texture:this._getTexture(t,3),unit:u},dataDriven0:{texture:this._getTexture(t,4),unit:a},dataDriven1:{texture:this._getTexture(t,5),unit:n},dataDriven2:{texture:this._getTexture(t,6),unit:r}}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b(1);e.wrapMode=33071,e.samplingMode=9728,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{fromRotation as t,multiply as e,translate as
|
|
2
|
+
import{fromRotation as t,multiply as e,translate as i,rotate as s}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as h}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as a,getYAnchorDirection as f}from"../../alignmentUtils.js";import c from"../../Rect.js";import d from"../../collisions/BoundingBox.js";const l=22,g=4,m=l+g,u=l-6,x=Math.PI/180,p=8,w=1.5;class _{constructor(t,e,i,s){this._rotationT=n(),this._transform=n(),this._angle=0,this._bounds=null;const{mosaicItem:o,rect:h,shaping:r,code:a}=i,f=o.rect;this.width=0===a?h.width:f.width*s,this.height=0===a?h.height:f.height*s,this.x=s*(t+r.xOffset+h.left),this.y=s*(e+r.yOffset-h.top),this.textureBinding=o.textureBinding,this.texcoords={topLeft:[f.x,f.y],topRight:[f.x+f.width,f.y],bottomLeft:[f.x,f.y+f.height],bottomRight:[f.x+f.width,f.y+f.height]}}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:i,y:s,width:h,height:r}=this,a=t(n(),-this.angle),f=e(n(),a,this._transform);this._offsets={topLeft:o([0,0],[i,s],f),topRight:o([0,0],[i+h,s],f),bottomLeft:o([0,0],[i,s+r],f),bottomRight:o([0,0],[i+h,s+r],f)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,i=1/0,s=-1/0,n=-1/0;for(const[f,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,f),i=Math.min(i,c),s=Math.max(s,f),n=Math.max(n,c);const o=s-e,h=n-i,r=e+o/2,a=i+h/2;this._bounds=new d(r,a,o,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const y=(t,e)=>({code:0,mosaicItem:{rect:new c(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function b(t,e){return t.forEach(t=>o(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class M{constructor(t,e,i,s){this._rotation=0,this._decorate(t,e,i,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==i.angle,this._transform=this._createGlyphTransform(this.bounds,i),this._borderLineSizePx=i.borderLineSizePx,(i.borderLineSizePx||i.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of t)n.setTransform(this._transform)}setRotation(i){if(0===i&&0===this._rotation)return;this._rotation=i;const s=this._transform,o=t(n(),i);e(s,o,s);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,i,s){if(!i.decoration||"none"===i.decoration||!t.length)return;const n=i.scale,o="underline"===i.decoration?s?.baseline??m:s?.midline??u,h=t[0].textureBinding;for(const r of e){const e=r.startX*n,i=r.startY*n,s=(r.width+r.glyphWidthEnd)*n;t.push(new _(e,i+o*n,y(s,h),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,i=(w+e)/2,s=this._borderLineSizePx?i:0,{xmin:n,ymin:o,xmax:h,ymax:r,x:a,y:f,width:c,height:l}=this.bounds,g=[n-p,o-p],m=[h+p,o-p],u=[n-p,r+p],x=[h+p,r+p],_=b([[g[0]-i,g[1]-i],[m[0]+i,m[1]-i],[g[0]+s,g[1]+s],[m[0]-s,m[1]+s]],t),y=b([[u[0]+s,u[1]-s],[x[0]-s,x[1]-s],[u[0]-i,u[1]+i],[x[0]+i,x[1]+i]],t),M=b([[g[0]-i,g[1]-i],[g[0]+s,g[1]+s],[u[0]-i,u[1]+i],[u[0]+s,u[1]-s]],t),L=b([[m[0]-s,m[1]+s],[m[0]+i,m[1]-i],[x[0]-s,x[1]-s],[x[0]+i,x[1]+i]],t),A={main:b([g,m,u,x],t),top:_,bot:y,left:M,right:L};return[new d(a,f,c+2*i,l+2*i),A]}get boundsT(){const t=this.bounds,e=h(r(),t.x,t.y);if(o(e,e,this._transform),this._hasRotation){const i=Math.max(t.width,t.height);return new d(e[0],e[1],i,i)}return new d(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,i=1/0,s=0,n=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),i=Math.min(i,r.offsets.topLeft[1]),s=Math.max(s,r.offsets.bottomRight[0]),n=Math.max(n,r.offsets.bottomRight[1]);const o=s-e,h=n-i;return new d(e+o/2,i+h/2,o,h)}_createGlyphTransform(t,e){const o=x*e.angle,a=n(),f=r();return i(a,a,h(f,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?s(a,a,o):(i(a,a,h(f,t.x,t.y)),s(a,a,o),i(a,a,h(f,-t.x,-t.y))),a}}class L{constructor(t,e,i,s,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,i)),this.end=Math.max(0,Math.max(e,i)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=s,this.yMin=n,this.yMax=o}}const A=t=>10===t,R=t=>32===t;function v(t,e,i){const s=new Array,n=1/i.scale,o=i.maxLineWidth*n,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let f=h,c=0,d=0,l=f,g=l,m=0,u=1/0,x=0;for(;f!==r;){const{code:e,rect:i,shaping:n}=t[f],r=Math.abs(i.top);if(A(e)||R(e)||(u=Math.min(u,r),x=Math.max(x,r+i.height)),A(e))f!==h&&(s.push(new L(t,l,f-a,c,u===1/0?0:u,x)),u=1/0,x=0),c=0,l=f+a,g=f+a,d=0;else if(R(e))g=f+a,d=0,m=n.xAdvance,c+=n.xAdvance;else if(c>o){if(g!==l){const e=g-2*a;c-=m,s.push(new L(t,l,e,c-d,u,x)),u=1/0,x=0,l=g,c=d}else s.push(new L(t,l,f-a,c,u,x)),u=1/0,x=0,l=f,g=f,c=0;c+=n.xAdvance,d+=n.xAdvance}else c+=n.xAdvance,d+=n.xAdvance;f+=a}const p=new L(t,l,f-a,c,u,x);return p.start>=0&&p.end<t.length&&s.push(p),s}function B(t,e){let i=0;for(let o=0;o<t.length;o++){const{width:e}=t[o];i=Math.max(e,i)}const s="underline"===e.decoration?g:0,n=t[0].yMin;return{x:0,y:n,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+s-n,width:i}}function T(t,e,i){let s=0;for(let n=e;n<i;n++)R(t[n].code)&&!A(t[n+1].code)&&s++;return s}function j(t,e){const i=e.scale,s=new Array,n=t.sdfPadding,{faceInfo:o,glyphs:h,isRightToLeft:r}=t,c="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,d=v(h,r,e),g=d.length?B(d,e):{y:0,height:0,width:0},m=c?r?1:-1:a(e.horizontalAlignment),u=f(e.verticalAlignment),x=2===u?1:0,p=x?0:u-1,w=o?.baseline??l,y=d.length>1,b=x?y?-g.y-g.height:-w:-g.y+p*(g.height/2);for(let a=0;a<d.length;a++){const{start:o,end:r,width:f}=d[a],l=c&&a<d.length-1?T(h,o,r):0,u=l>0?(g.width-f)/l:0;let x=-1*(m+1)*((u>0?g.width:f)/2)-n;const p=(t.isRightToLeft?d.length-1-a:a)*e.lineHeight+b-n;d[a].startX=x,d[a].startY=p;for(let t=o;t<=r;t++){const e=h[t];if(A(e.code))continue;const n=new _(x,p,e,i);x+=e.shaping.xAdvance,u>0&&R(e.code)&&(x+=u),s.push(n)}}return new M(s,d,e,o)}function z(t,e){const i=e.scale,{faceInfo:s,glyphs:n}=t,o=n.reduce((t,e)=>Math.max(t,e.rect.height),0),h=n.map(t=>new _(-t.rect.width/2,-o,t,i));return new M(h,[],e,s)}export{_ as ShapedGlyph,M as ShapingInfo,j as shapeGlyphs,z as shapeGlyphsForMultipoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t,__param as e}from"tslib";import{labelPlacementOffsetPadding as i}from"../../../definitions.js";import{location as o,option as s,uniform as l,texture as a,define as r,input as n,ComputeVertexInput as p}from"../../GraphShaderModule.js";import{Vec4 as d,Vec2 as u,Float as y,Sampler2D as
|
|
2
|
+
import{__decorate as t,__param as e}from"tslib";import{labelPlacementOffsetPadding as i}from"../../../definitions.js";import{location as o,option as s,uniform as l,texture as a,define as r,input as n,ComputeVertexInput as p}from"../../GraphShaderModule.js";import{Vec4 as d,Vec2 as u,Float as y,Sampler2D as m,mod as c,step as h,and as v,lessThan as f,greaterThanEqual as w,Vec3 as b,Mat3 as x,ifElse as V,equal as S,greaterThan as g,Bool as z,texture2D as R,smoothstep as j,Int as A,bitRShift as M,bitAnd as C}from"../../graph/glsl.js";import{FeatureVertexInput as O,AFeatureShader as T,FeatureFragmentInput as H}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as L,bitsetTextIsMapAligned as P,noHit as F,trueHit as N}from"../shaders/constants.js";import{isRectHittest as U,distPointTriangle as _,hittestScreenRect as k}from"../shaders/hittestUtils.js";import{MosaicInfo as q}from"../shaders/MosaicInfo.js";import{getBit as D}from"../shaders/utils.js";import{VisualVariableColor as I}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as B}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as E}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as W}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as G}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as Z}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as J}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as K,getVisualVariableRotation as Q}from"../shaders/vvUtils.js";const X=360/254;class Y extends O{}t([o(3,d)],Y.prototype,"color",void 0),t([o(4,u)],Y.prototype,"offset",void 0),t([o(5,u)],Y.prototype,"textureUV",void 0),t([o(6,d)],Y.prototype,"fontAndReferenceSize",void 0),t([o(7,d)],Y.prototype,"outlineColor",void 0),t([o(8,d)],Y.prototype,"haloColor",void 0),t([o(9,u)],Y.prototype,"outlineAndHaloSize",void 0),t([o(10,u)],Y.prototype,"zoomRange",void 0),t([o(11,y)],Y.prototype,"clipAngle",void 0),t([o(12,d)],Y.prototype,"referenceSymbol",void 0),t([o(15,y)],Y.prototype,"visibility",void 0);class $ extends p{}t([o(13,u)],$.prototype,"offsetNextVertex1",void 0),t([o(14,u)],$.prototype,"offsetNextVertex2",void 0);class tt extends H{}class et extends T{constructor(){super(...arguments),this.type="TextShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(t,e){const{clipAngle:i,zoomRange:o,visibility:s}=t,l=i.multiply(X),a=c(l.subtract(this.view.rotation),new y(360));let r=new y(0);const n=this.view.currentZoom,p=o.x,d=o.y,u=new y(1).subtract(h(p,n)).multiply(2),m=new y(v(w(a,new y(90)),f(a,new y(270)))).multiply(2),b=new y(2).multiply(new y(1).subtract(h(n,d)));return r=r.add(e.multiply(u)),r=r.add(e.multiply(m)),r=r.add(b),s&&(r=r.add(s)),r}vertex(t,e){const o=D(t.bitset,L),s=new y(1).subtract(o);let l=t.fontAndReferenceSize[0];const a=t.fontAndReferenceSize[1],r=t.fontAndReferenceSize[2],n=t.fontAndReferenceSize[3];let p=l.divide(r);const m=1===this.textRenderPassType?t.outlineColor:2===this.textRenderPassType?t.haloColor:this._getVertexColor(t),c=this.view.displayViewScreenMat3.multiply(new b(t.pos,1));let h=t.offset,v=new y(1),f=x.identity(),w=new u(0);if(this.isLabel){if(!t.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const e=t.referenceSymbol,o=e.xy,s=e.z,l=this._unpackDirection(e.w),a=K(this,t.id,s).divide(2),r=l.multiply(a.add(i));w=o.add(r),h=h.add(w)}else{v=K(this,t.id,a).divide(a),l=l.multiply(v),p=p.multiply(v),h=h.multiply(v),f=Q(this,t.id),h=f.multiply(new b(h,0)).xy}const R=D(t.bitset,P),j=this._getViewRotationMatrix(R).multiply(new b(h,0)).multiply(this.view.scaleFactor);let A=this.isLabel?this.clipLabel(t,R):this.clip(t.id,t.zoomRange);A=this.isBackgroundPass?A.add(s.multiply(2)):A.add(o.multiply(2));let M=new y(0);if(1===this.textRenderPassType){A=A.add(V(S(t.outlineAndHaloSize.x,new y(0)),new y(2),new y(0)));M=new y(t.outlineAndHaloSize.x).divide(p).divide(n)}if(2===this.textRenderPassType){const e=t.outlineAndHaloSize.x,i=new y(t.outlineAndHaloSize.y);A=A.add(V(S(i,new y(0)),new y(2),new y(0)));M=i.add(e).divide(p).divide(n)}const C=this.isLabel?g(A,new y(1)):new z(!1);return{glPosition:new d(c.xy.add(j.xy),A,1),color:m,size:p,textureUV:t.textureUV.divide(this.mosaicInfo.size),antialiasingWidth:new y(.105).multiply(r).divide(l).divide(this.view.pixelRatio),outlineDistanceOffset:M,...this.maybeRunHittest(t,e,{vvSizeAdjustment:v,vvRotation:f,labelOffset:w,labelClipped:C,scaleFactor:this.view.scaleFactor})}}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new y(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getHittestAlignmentMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new y(1).subtract(t);return e.multiply(t).add(i.multiply(o))}fragment(t){const e=new y(2/8),i=new y(1).subtract(e),o=R(this.mosaicTexture,t.textureUV).a;let s=i.subtract(t.outlineDistanceOffset);this.highlight&&(s=s.divide(2));const l=t.antialiasingWidth,a=j(s.subtract(l),s.add(l),o);return this.getFragmentOutput(t.color.multiply(a),t)}computeHittestTriangle(t,e,{vvSizeAdjustment:i,vvRotation:o,labelOffset:s,scaleFactor:l}){let a,r,n;this.isLabel?(a=new b(t.offset.multiply(l).add(s),0),r=new b(e.offsetNextVertex1.multiply(l).add(s),0),n=new b(e.offsetNextVertex2.multiply(l).add(s),0)):(a=o.multiply(new b(t.offset.multiply(l).multiply(i),0)),r=o.multiply(new b(e.offsetNextVertex1.multiply(l).multiply(i),0)),n=o.multiply(new b(e.offsetNextVertex2.multiply(l).multiply(i),0)));const{viewMat3:p,tileMat3:d}=this.view,u=p.multiply(d).multiply(new b(t.pos,1)),y=D(t.bitset,P),m=this._getHittestAlignmentMatrix(y);return{pos0:u.add(m.multiply(a)).xy,pos1:u.add(m.multiply(r)).xy,pos2:u.add(m.multiply(n)).xy}}hittest(t,e,i){const{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,labelClipped:a,scaleFactor:r}=i,n=U(this.hittestRequest),{pos0:p,pos1:d,pos2:u}=this.computeHittestTriangle(t,e,{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,scaleFactor:r});return V(n,()=>{const{tlbr:t}=this.hittestRequest;return this.isLabel?V(a,new y(F),k(p,d,u,t)):k(p,d,u,t)},()=>{const t=_(this.hittestRequest.position,p,d,u),e=this.isLabel?a:new z(!1);return V(e,new y(F),V(g(t,this.hittestRequest.distance),new y(F),new y(N)))})}_unpackDirection(t){const e=new A(t),i=M(e,new A(2)),o=C(e,new A(3));return new u(new y(i).subtract(1),new y(o).subtract(1))}_getVertexColor(t){let e=t.color;if(this.visualVariableColor){const i=this.getColorValue(t.id);e=this.visualVariableColor.getColor(i,t.color,new z(!1))}if(this.visualVariableOpacity){const i=this.getOpacityValue(t.id),o=this.visualVariableOpacity.getOpacity(i);e=e.multiply(o)}return e}}t([s(I)],et.prototype,"visualVariableColor",void 0),t([s(B)],et.prototype,"visualVariableOpacity",void 0),t([s(E)],et.prototype,"visualVariableRotation",void 0),t([s(W)],et.prototype,"visualVariableSizeMinMaxValue",void 0),t([s(G)],et.prototype,"visualVariableSizeScaleStops",void 0),t([s(Z)],et.prototype,"visualVariableSizeStops",void 0),t([s(J)],et.prototype,"visualVariableSizeUnitValue",void 0),t([l(q)],et.prototype,"mosaicInfo",void 0),t([a(m)],et.prototype,"mosaicTexture",void 0),t([r],et.prototype,"textRenderPassType",void 0),t([r],et.prototype,"isBackgroundPass",void 0),t([r],et.prototype,"isLabel",void 0),t([e(0,n(Y)),e(1,n($))],et.prototype,"vertex",null),t([e(0,n(tt))],et.prototype,"fragment",null);export{tt as TextFragmentInput,et as TextShader,Y as TextVertexInput};
|