@arcgis/core 5.1.0-next.80 → 5.1.0-next.81

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.
Files changed (120) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{d5fd99ee40bba9b48a54.js → 1e2c0c6d724f7639d4c1.js} +27 -27
  3. package/assets/esri/core/workers/chunks/2bd69a7734d170e190ed.js +1 -0
  4. package/assets/esri/core/workers/chunks/{c1d4110aa494a1dba3c4.js → 455d08294e0f5c5509ff.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{5da2051f548c2942e01a.js → 4af39fa53bc0b79101ed.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{87d2021e91d025a2a142.js → 5c7ba4b8a9ec2e2e02b5.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{1f82a0f134ea912fc686.js → 66fe1634c6e8f72fc653.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{96b13b6042cdf5833d39.js → 67abbe81c16de26f61d8.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{8f6f5dad52747d252aac.js → 7cee7ffaf941a4fe23b0.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{fb9e3e7cd532ac4353f1.js → 84821dff3bcc51161802.js} +2 -2
  11. package/assets/esri/core/workers/chunks/{6a0352d20596ca3f4b64.js → 88eb1e4320c4ada01711.js} +1 -1
  12. package/assets/esri/core/workers/chunks/97719271a3e4c9f2b2c9.js +1 -0
  13. package/assets/esri/core/workers/chunks/9cac70164d8528c283af.js +1 -0
  14. package/assets/esri/core/workers/chunks/ac5999c88c27b49cd760.js +1 -0
  15. package/assets/esri/core/workers/chunks/b811d62284be95f4beb6.js +1 -0
  16. package/assets/esri/core/workers/chunks/{3b9100c59a8050f4834e.js → bbc27d9285162696d089.js} +1 -1
  17. package/assets/esri/core/workers/chunks/bd8cb64b6e08839398f3.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d7324a00ed576e7a37b1.js → c758e16b57c96ce88294.js} +1 -1
  19. package/assets/esri/core/workers/chunks/c8ef80a7c46d7d2c5172.js +1 -0
  20. package/assets/esri/core/workers/chunks/cbf1a03f54bd8d2a2b47.js +1 -0
  21. package/assets/esri/core/workers/chunks/d9c3f14eee4db7a7137b.js +1 -0
  22. package/assets/esri/core/workers/chunks/{3f242f8d092f601c3abf.js → f77d23ee60c876b01e4b.js} +1 -1
  23. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  24. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  25. package/config.js +1 -1
  26. package/form/elements/inputs.js +1 -1
  27. package/geometry/SpatialReference.js +1 -1
  28. package/geometry/support/coordsUtils.js +1 -1
  29. package/kernel.js +1 -1
  30. package/layers/FeatureLayer.d.ts +2 -2
  31. package/layers/FeatureLayer.js +1 -1
  32. package/layers/graphics/data/QueryEngine.js +1 -1
  33. package/layers/graphics/data/QueryEngineResult.js +1 -1
  34. package/layers/graphics/sources/MemorySource.js +1 -1
  35. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  36. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  37. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  38. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  39. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  40. package/layers/mixins/FeatureLayerBase.js +1 -1
  41. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  42. package/package.json +1 -1
  43. package/support/revision.js +1 -1
  44. package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
  45. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  46. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  47. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  48. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  50. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  52. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  53. package/views/2d/input/MapViewInputManager.js +1 -1
  54. package/views/2d/layers/MediaLayerView2D.js +1 -1
  55. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  56. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  57. package/views/3d/input/SceneInputManager.js +1 -1
  58. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  59. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  60. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  61. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  62. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  63. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  64. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialInitParameters.js +2 -0
  65. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  66. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  67. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  68. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  69. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  70. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  71. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  72. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  73. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  74. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  75. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  76. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  77. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  78. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  79. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  80. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  81. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  82. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  83. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  84. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  85. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  86. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  87. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  88. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  89. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  90. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  91. package/views/3d/webgl-engine/lib/StencilUtils.js +1 -1
  92. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  93. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  94. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechniqueConfiguration.js +1 -1
  95. package/views/3d/webgl-engine/shaders/ShadowCastMaskTechnique.js +2 -0
  96. package/views/VideoView.js +1 -1
  97. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  98. package/views/draw/support/createUtils.js +1 -1
  99. package/views/input/BrowserEventSource.js +1 -1
  100. package/views/input/InputManager.js +1 -1
  101. package/views/input/handlers/LatestPen.js +2 -0
  102. package/views/input/handlers/LatestPointer.js +1 -1
  103. package/views/input/types.d.ts +1 -1
  104. package/views/interactive/Tooltip.js +1 -1
  105. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  106. package/views/support/unnormalizationUtils.js +2 -0
  107. package/views/webgl/RenderingContext.js +1 -1
  108. package/views/webgl/renderState.js +1 -1
  109. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  110. package/widgets/FeatureTable.js +1 -1
  111. package/assets/esri/core/workers/chunks/2da62687ff678b690839.js +0 -1
  112. package/assets/esri/core/workers/chunks/4eed175277eb0df3c821.js +0 -1
  113. package/assets/esri/core/workers/chunks/4f9d027055f3a616173c.js +0 -1
  114. package/assets/esri/core/workers/chunks/63381d81adce0a0d2089.js +0 -1
  115. package/assets/esri/core/workers/chunks/6dbddf5ab1867ac2ac80.js +0 -1
  116. package/assets/esri/core/workers/chunks/99c189e1de2b1f14799b.js +0 -1
  117. package/assets/esri/core/workers/chunks/9aa6b32cb65fbaa93218.js +0 -1
  118. package/assets/esri/core/workers/chunks/9d434360dfce1e49b7b9.js +0 -1
  119. package/assets/esri/core/workers/chunks/fb5a2205f05afc396119.js +0 -1
  120. package/views/interactive/editGeometry/unnormalizationHelper.js +0 -2
@@ -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"../../core/Collection.js";import{clone as i}from"../../core/lang.js";import{hasSameOrigin as r,getHost as o,changeHost as s}from"../../core/urlUtils.js";import{property as n,subclass as p}from"../../core/accessorSupport/decorators.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import{idToName as d}from"../../core/accessorSupport/PropertyOrigin.js";import a from"../../geometry/Extent.js";import u from"../../geometry/HeightModelInfo.js";import c from"../../geometry/SpatialReference.js";import{elevationInfo as y,maxScale as f,minScale as m}from"../support/commonProperties.js";import h from"../support/EditFieldsInfo.js";import{FeatureIndex as v}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as g,hasCurrentUser as I,isLayerCacheStale as F,supportsQueryOnly as S,readGlobalIdField as b,readObjectIdField as j,readVersion as E}from"../support/featureLayerUtils.js";import U from"../support/GeometryFieldsInfo.js";import x from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as O,getPreferredUrl as M,applyPreferredHostToPortalItem as D,getPreferredHost as T}from"../support/layerUtils.js";import{urlProperty as w,normalizeParsedUrlObject as C}from"../support/multiLayerServiceUtils.js";import H from"../support/Relationship.js";import{getFeatureLayerCapabilities as R}from"../support/serviceCapabilitiesUtils.js";import B from"../support/Subtype.js";import{hasTypeKeyword as A,typeKeyword as Q}from"../../portal/support/portalItemUtils.js";import{timeZoneProperty as P}from"../../time/timeZoneUtils.js";import{reader as q}from"../../core/accessorSupport/decorators/reader.js";const G=G=>{const V=G;let Z=class extends V{constructor(){super(...arguments),this.cacheMaxAge=0,this.capabilities=null,this.copyright=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(v)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=c.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.uniqueIdFields=null,this.url=null,this.version=void 0,this._isUrlHostModified=!1,this._isUrlHostModificationEnabled=!1}getFieldDomain(e,t){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:i,editing:r}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(i.supportsEditing&&!(r.supportsUpdateByOthers&&r.supportsUpdateByAnonymous&&r.supportsDeleteByOthers&&r.supportsDeleteByAnonymous))return"load"}if(I(this.serviceDefinitionExpression)||I(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(F(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return R(t,this.url)}readEditingInfo(e,t){const{editingInfo:i}=t;return i?{lastEditDate:null!=i.lastEditDate?new Date(i.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=i(e),{operations:r,editing:o}=t;return S(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return b(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||S(this))return!1;const{operations:t,editing:i}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&i.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:i}=e;return S(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&i.supportsDeleteByOthers&&i.supportsGeometryUpdate&&i.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return j(t)}get parsedUrl(){return C(this)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}readVersion(e,t){return E(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:i}=this;if(i)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<7)return!1;const o=this.sourceJSON?.preferredHost;if(!o)return!1;if(!r(t,`https://${o}`,!0))return!1;for(let s=6;s>=3;s--){const e=this.getAtOrigin("url",d(s));if(e)return!r(t,e,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:i}=this;if(!t||!O(i))return;const r=M();r&&this._isUrlHostModificationEnabled&&(this._set("url",r),this._isUrlHostModified=!0,i&&D(i,T()))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||7===this.originIdOf("url")||!t?.url||!O(t)||!A(t,Q.HOSTED_SERVICE)||r(e,t.url,!0)||!this._isUrlHostModificationEnabled)return;const i=o(t.url);this._set("url",s(e,i)),this._isUrlHostModified=!0}};return e([n({readOnly:!0})],Z.prototype,"authenticationTriggerEvent",null),e([n({readOnly:!0,json:{read:e=>e/60}})],Z.prototype,"cacheMaxAge",void 0),e([n({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","standardMaxRecordCountNoGeometry","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],Z.prototype,"capabilities",void 0),e([q("service","capabilities")],Z.prototype,"readCapabilitiesFromService",null),e([n({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],Z.prototype,"copyright",void 0),e([n(P("dateFieldsTimeReference"))],Z.prototype,"dateFieldsTimeZone",void 0),e([n({type:Boolean})],Z.prototype,"datesInUnknownTimezone",void 0),e([n({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Z.prototype,"definitionExpression",void 0),e([n({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],Z.prototype,"displayField",void 0),e([n({readOnly:!0,type:h})],Z.prototype,"editFieldsInfo",void 0),e([n({readOnly:!0})],Z.prototype,"editingInfo",void 0),e([q("editingInfo")],Z.prototype,"readEditingInfo",null),e([n({readOnly:!0})],Z.prototype,"effectiveCapabilities",null),e([n()],Z.prototype,"effectiveEditingEnabled",null),e([n((()=>{const e=i(y),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],Z.prototype,"elevationInfo",void 0),e([n()],Z.prototype,"fieldsIndex",void 0),e([n({type:x,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:l}}})],Z.prototype,"floorInfo",void 0),e([n({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],Z.prototype,"fullExtent",void 0),e([n()],Z.prototype,"gdbVersion",void 0),e([n({readOnly:!0,type:U,json:{read:{source:"geometryProperties"}}})],Z.prototype,"geometryFieldsInfo",void 0),e([n({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:g.read}}}})],Z.prototype,"geometryType",void 0),e([n({type:String})],Z.prototype,"globalIdField",void 0),e([q("service","globalIdField",["globalIdField","fields"])],Z.prototype,"readGlobalIdFieldFromService",null),e([n({readOnly:!0})],Z.prototype,"hasFullEditingRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],Z.prototype,"hasM",void 0),e([n({readOnly:!0})],Z.prototype,"hasUpdateItemRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],Z.prototype,"hasZ",void 0),e([n({readOnly:!0,type:u})],Z.prototype,"heightModelInfo",void 0),e([n({type:Date})],Z.prototype,"historicMoment",void 0),e([n({type:t.ofType(v),readOnly:!0})],Z.prototype,"indexes",void 0),e([n({readOnly:!0})],Z.prototype,"isTable",void 0),e([q("service","isTable",["type"])],Z.prototype,"readIsTableFromService",null),e([n({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],Z.prototype,"layerId",void 0),e([n(f)],Z.prototype,"maxScale",void 0),e([q("service","maxScale",["maxScale","effectiveMaxScale"])],Z.prototype,"readMaxScale",null),e([n(m)],Z.prototype,"minScale",void 0),e([q("service","minScale",["minScale","effectiveMinScale"])],Z.prototype,"readMinScale",null),e([n({type:String})],Z.prototype,"objectIdField",void 0),e([q("service","objectIdField",["objectIdField","fields"])],Z.prototype,"readObjectIdFieldFromService",null),e([n({readOnly:!0})],Z.prototype,"parsedUrl",null),e([n(P("preferredTimeReference"))],Z.prototype,"preferredTimeZone",void 0),e([n({type:[H],readOnly:!0})],Z.prototype,"relationships",void 0),e([n({type:Boolean})],Z.prototype,"returnM",void 0),e([n({type:Boolean})],Z.prototype,"returnZ",void 0),e([n({readOnly:!0,json:{write:!1}})],Z.prototype,"serverGens",void 0),e([n({readOnly:!0})],Z.prototype,"serviceDefinitionExpression",void 0),e([q("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],Z.prototype,"readServiceDefinitionExpression",null),e([n({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Z.prototype,"serviceItemId",void 0),e([n()],Z.prototype,"sourceJSON",void 0),e([n({type:c,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],Z.prototype,"spatialReference",void 0),e([n({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],Z.prototype,"subtypeField",void 0),e([n({type:[B],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Z.prototype,"subtypes",void 0),e([n({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],Z.prototype,"trackIdField",void 0),e([n({type:[String],readOnly:!0})],Z.prototype,"uniqueIdFields",void 0),e([q("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],Z.prototype,"readUniqueIdFields",null),e([n(w({nonStandardUrlAllowed:!0}))],Z.prototype,"url",void 0),e([n({json:{origins:{service:{read:!0}},read:!1}})],Z.prototype,"version",void 0),e([q("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],Z.prototype,"readVersion",null),e([n({readOnly:!0})],Z.prototype,"isUrlHostModified",null),Z=e([p("esri.layers.mixins.FeatureLayerBase")],Z),Z};export{G as FeatureLayerBase};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{clone as i}from"../../core/lang.js";import{hasSameOrigin as r,getHost as o,changeHost as s}from"../../core/urlUtils.js";import{property as n,subclass as p}from"../../core/accessorSupport/decorators.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import{idToName as d}from"../../core/accessorSupport/PropertyOrigin.js";import a from"../../geometry/Extent.js";import u from"../../geometry/HeightModelInfo.js";import c from"../../geometry/SpatialReference.js";import{elevationInfo as y,maxScale as f,minScale as m}from"../support/commonProperties.js";import h from"../support/EditFieldsInfo.js";import{FeatureIndex as v}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as g,hasCurrentUser as I,isLayerCacheStale as F,supportsQueryOnly as S,readGlobalIdField as b,readObjectIdField as j,readVersion as E}from"../support/featureLayerUtils.js";import U from"../support/GeometryFieldsInfo.js";import x from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as O,getPreferredUrl as M,applyPreferredHostToPortalItem as D,getPreferredHost as T}from"../support/layerUtils.js";import{urlProperty as w,normalizeParsedUrlObject as C}from"../support/multiLayerServiceUtils.js";import H from"../support/Relationship.js";import{getFeatureLayerCapabilities as R}from"../support/serviceCapabilitiesUtils.js";import B from"../support/Subtype.js";import{hasTypeKeyword as A,typeKeyword as Q}from"../../portal/support/portalItemUtils.js";import{timeZoneProperty as P}from"../../time/timeZoneUtils.js";import{reader as q}from"../../core/accessorSupport/decorators/reader.js";const G=G=>{const V=G;let Z=class extends V{constructor(){super(...arguments),this.cacheMaxAge=0,this.capabilities=null,this.copyright=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(v)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=c.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.uniqueIdFields=null,this.url=null,this.version=void 0,this._isUrlHostModified=!1,this._isUrlHostModificationEnabled=!1}getFieldDomain(e,t){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:i,editing:r}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(i.supportsEditing&&!(r.supportsUpdateByOthers&&r.supportsUpdateByAnonymous&&r.supportsDeleteByOthers&&r.supportsDeleteByAnonymous))return"load"}if(I(this.serviceDefinitionExpression)||I(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(F(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return R(t,this.url)}readEditingInfo(e,t){const{editingInfo:i}=t;return i?{lastEditDate:null!=i.lastEditDate?new Date(i.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=i(e),{operations:r,editing:o}=t;return S(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return b(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||S(this))return!1;const{operations:t,editing:i}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&i.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:i}=e;return S(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&i.supportsDeleteByOthers&&i.supportsGeometryUpdate&&i.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return j(t)}get parsedUrl(){return C(this)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}readVersion(e,t){return E(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:i}=this;if(i)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<7)return!1;const o=this.sourceJSON?.preferredHost;if(!o)return!1;if(!r(t,`https://${o}`,!0))return!1;for(let s=6;s>=3;s--){const e=this.getAtOrigin("url",d(s));if(e)return!r(t,e,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:i}=this;if(!t||!O(i))return;const r=M();r&&this._isUrlHostModificationEnabled&&(this._set("url",r),this._isUrlHostModified=!0,i&&D(i,T()))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||7===this.originIdOf("url")||!t?.url||!O(t)||!A(t,Q.HOSTED_SERVICE)||r(e,t.url,!0)||!this._isUrlHostModificationEnabled)return;const i=o(t.url);this._set("url",s(e,i)),this._isUrlHostModified=!0}};return e([n({readOnly:!0})],Z.prototype,"authenticationTriggerEvent",null),e([n({readOnly:!0,json:{read:e=>e/60}})],Z.prototype,"cacheMaxAge",void 0),e([n({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","standardMaxRecordCountNoGeometry","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],Z.prototype,"capabilities",void 0),e([q("service","capabilities")],Z.prototype,"readCapabilitiesFromService",null),e([n({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],Z.prototype,"copyright",void 0),e([n(P("dateFieldsTimeReference"))],Z.prototype,"dateFieldsTimeZone",void 0),e([n({type:Boolean})],Z.prototype,"datesInUnknownTimezone",void 0),e([n({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Z.prototype,"definitionExpression",void 0),e([n({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],Z.prototype,"displayField",void 0),e([n({readOnly:!0,type:h})],Z.prototype,"editFieldsInfo",void 0),e([n({readOnly:!0})],Z.prototype,"editingInfo",void 0),e([q("editingInfo")],Z.prototype,"readEditingInfo",null),e([n({readOnly:!0})],Z.prototype,"effectiveCapabilities",null),e([n()],Z.prototype,"effectiveEditingEnabled",null),e([n((()=>{const e=i(y),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],Z.prototype,"elevationInfo",void 0),e([n()],Z.prototype,"fieldsIndex",void 0),e([n({type:x,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:l}}})],Z.prototype,"floorInfo",void 0),e([n({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],Z.prototype,"fullExtent",void 0),e([n()],Z.prototype,"gdbVersion",void 0),e([n({readOnly:!0,type:U,json:{read:{source:"geometryProperties"}}})],Z.prototype,"geometryFieldsInfo",void 0),e([n({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:g.read}}}})],Z.prototype,"geometryType",void 0),e([n({type:String})],Z.prototype,"globalIdField",void 0),e([q("service","globalIdField",["globalIdField","fields"])],Z.prototype,"readGlobalIdFieldFromService",null),e([n({readOnly:!0})],Z.prototype,"hasFullEditingRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],Z.prototype,"hasM",void 0),e([n({readOnly:!0})],Z.prototype,"hasUpdateItemRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],Z.prototype,"hasZ",void 0),e([n({readOnly:!0,type:u})],Z.prototype,"heightModelInfo",void 0),e([n({type:Date})],Z.prototype,"historicMoment",void 0),e([n({type:t.ofType(v),readOnly:!0})],Z.prototype,"indexes",void 0),e([n({readOnly:!0})],Z.prototype,"isTable",void 0),e([q("service","isTable",["type"])],Z.prototype,"readIsTableFromService",null),e([n({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],Z.prototype,"layerId",void 0),e([n(f)],Z.prototype,"maxScale",void 0),e([q("service","maxScale",["maxScale","effectiveMaxScale"])],Z.prototype,"readMaxScale",null),e([n(m)],Z.prototype,"minScale",void 0),e([q("service","minScale",["minScale","effectiveMinScale"])],Z.prototype,"readMinScale",null),e([n({type:String})],Z.prototype,"objectIdField",void 0),e([q("service","objectIdField",["objectIdField","fields"])],Z.prototype,"readObjectIdFieldFromService",null),e([n({readOnly:!0})],Z.prototype,"parsedUrl",null),e([n(P("preferredTimeReference"))],Z.prototype,"preferredTimeZone",void 0),e([n({type:[H],readOnly:!0})],Z.prototype,"relationships",void 0),e([n({type:Boolean})],Z.prototype,"returnM",void 0),e([n({type:Boolean})],Z.prototype,"returnZ",void 0),e([n({readOnly:!0,json:{write:!1}})],Z.prototype,"serverGens",void 0),e([n({readOnly:!0})],Z.prototype,"serviceDefinitionExpression",void 0),e([q("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],Z.prototype,"readServiceDefinitionExpression",null),e([n({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Z.prototype,"serviceItemId",void 0),e([n()],Z.prototype,"sourceJSON",void 0),e([n({type:c,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],Z.prototype,"spatialReference",void 0),e([n({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],Z.prototype,"subtypeField",void 0),e([n({type:[B],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Z.prototype,"subtypes",void 0),e([n({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],Z.prototype,"trackIdField",void 0),e([n({type:[String]})],Z.prototype,"uniqueIdFields",void 0),e([q("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],Z.prototype,"readUniqueIdFields",null),e([n(w({nonStandardUrlAllowed:!0}))],Z.prototype,"url",void 0),e([n({json:{origins:{service:{read:!0}},read:!1}})],Z.prototype,"version",void 0),e([q("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],Z.prototype,"readVersion",null),e([n({readOnly:!0})],Z.prototype,"isUrlHostModified",null),Z=e([p("esri.layers.mixins.FeatureLayerBase")],Z),Z};export{G as FeatureLayerBase};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isSome as t}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{curveTypeDict as e}from"../../geometry/support/typeUtils.js";import{isHostedAgolService as s,parse as r}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as p,modelFormatsFromFormatIds as o}from"./infoFor3D.js";import{getRelativeTimeQueryBinWindowSize as u}from"./relativeTimeQueryUtils.js";import{readNumber as i,readBoolean as a}from"../../rest/support/jsonUtils.js";const n={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},d=["cubic-bezier","circular-arc","elliptic-arc"];function c(t){const e=t?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function l(t,e){const s=t?.supportedOperationsWithCacheHint?.map(t=>t.toLowerCase());return!!s?.includes(e.toLowerCase())}function y(t){const e=t?.supportedStatisticTypes?.map(t=>t.toLowerCase());return{count:!!e?.includes("count"),sum:!!e?.includes("sum"),min:!!e?.includes("min"),max:!!e?.includes("max"),avg:!!e?.includes("avg"),var:!!e?.includes("var"),stddev:!!e?.includes("stddev"),percentileContinuous:!!e?.includes("percentile_cont"),percentileDiscrete:!!e?.includes("percentile_disc"),envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function m(t){const e=t?.supportedNormalizationTypes?.map(t=>t.toLowerCase());return{field:!!e?.includes("field"),log:!!e?.includes("log"),naturalLog:!!e?.includes("naturallog"),percentOfTotal:!!e?.includes("percentoftotal"),squareRoot:!!e?.includes("squareroot")}}function C(t){if(!has("featurelayer-pbf-true-curves"))return!1;return(t.supportedTrueCurvePbfFeatureEncodings??[]).includes("esriDefault")}function v(t,e){return{analytics:g(t),attachment:f(t),data:h(t),metadata:Q(t),operations:A(t.capabilities,t,e),query:F(t,e),queryAttributeBins:x(t),queryRelated:S(t),queryTopFeatures:T(t),editing:R(t)}}function g(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryAnalytics")}}function f(t){const e=t.attachmentProperties,s={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:l(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:a(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:a(t,"supportsAttachmentsResizing",!1),supportsTypeWildcard:a(t.advancedQueryCapabilities,"supportsQueryAttachmentWithTypeWildcard",!1),supportsCountOnly:a(t.advancedQueryCapabilities,"supportsQueryAttachmentsCountOnly",!1)};return e&&Array.isArray(e)&&e.forEach(t=>{const e=n[t.name];e&&(s[e]=!!t.isEnabled)}),s}function h(t){const e=a(t.advancedQueryCapabilities,"supportsTrueCurve",!1),s=t.infoFor3D,r=s?.supportedFormats??[];return{isVersioned:a(t,"isDataVersioned",!1),isBranchVersioned:a(t,"isDataBranchVersioned",!1),queryFormats:s?o(s.queryFormats,r):void 0,sourceFormats:s?o(s.editFormats,r):void 0,supportsAttachment:a(t,"hasAttachments",!1),supportsM:a(t,"hasM",!1),supportsTrueCurve:e,supportedCurveTypes:B(t,e),supportsZ:a(t,"hasZ",!1)}}function Q(t){return{supportsAdvancedFieldProperties:a(t,"supportsFieldDescriptionProperty",!1)}}function A(t,e,p){const o=s(p),u=t?.toLowerCase().split(",").map(t=>t.trim())??[],i=p?r(p):null,n=u.includes("MapServer"===i?.serverType?"data":"query"),d=u.includes("editing")&&!e.datesInUnknownTimezone&&!(!0===e.uniqueIdInfo?.OIDFieldContainsHashValue);let c=d&&u.includes("create"),l=d&&u.includes("delete"),y=d&&u.includes("update");const m=u.includes("changetracking"),C=e.advancedQueryCapabilities;let v=a(e,"supportsExceedsLimitStatistics",!1);if(!o){a(C,"supportsUseEstimateForExceedsLimit",!1)||(v=!1)}return d&&!(c||l||y)&&(c=l=y=!0),{supportsCalculate:a(e,"supportsCalculate",!1),supportsTruncate:a(e,"supportsTruncate",!1),supportsValidateSql:a(e,"supportsValidateSql",!1),supportsAdd:c,supportsDelete:l,supportsEditing:d,supportsChangeTracking:m,supportsQuery:n,supportsQueryAnalytics:a(C,"supportsQueryAnalytic",!1),supportsQueryAttachments:a(C,"supportsQueryAttachments",!1),supportsQueryBins:a(C,"supportsQueryBins",!1)||!!e.queryBinsCapabilities,supportsQueryPivot:a(C,"supportsQueryPivot",!1),supportsQueryTopFeatures:a(C,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:a(e,"supportsAttachmentsResizing",!1),supportsSync:u.includes("sync"),supportsUpdate:y,supportsExceedsLimitStatistics:v,supportsAsyncConvert3D:a(e,"supportsAsyncConvert3D",!1)}}function F(t,e){const r=t.advancedQueryCapabilities,o=t.ownershipBasedAccessControlForFeatures,n=t.archivingInfo,d=t.currentVersion,y=u(e,t.cacheMaxAge),m=e?.includes("MapServer"),v=!m||d>=has("mapserver-pbf-version-support"),g=s(e),f=new Set((t.supportedQueryFormats??"").split(",").map(t=>t.toLowerCase().trim())),h=v&&C(t);return{maxRecordCount:i(t,"maxRecordCount",void 0),maxRecordCountFactor:i(t,"maxRecordCountFactor",void 0),maxUniqueIDCount:i(t,"maxUniqueIDCount",void 0),relativeTimeBinWindow:y,standardMaxRecordCount:i(t,"standardMaxRecordCount",void 0),standardMaxRecordCountNoGeometry:i(t,"standardMaxRecordCountNoGeometry",void 0),supportedSpatialAggregationStatistics:c(r),supportsCacheHint:a(r,"supportsQueryWithCacheHint",!1)||l(r,"query"),supportsCentroid:a(r,"supportsReturningGeometryCentroid",!1),supportsCentroidOnDegeneratedQuantizedGeometry:g||null==e,supportsCompactGeometry:g,supportsCurrentUser:a(r,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:a(r,"supportsDefaultSR",!1),supportsDegeneratedQuantizedGeometry:a(r,"supportsDegeneratedQuantizedGeometry",!1),supportsDisjointSpatialRelationship:a(r,"supportsDisjointSpatialRel",!1),supportsDistance:a(r,"supportsQueryWithDistance",!1),supportsDistinct:a(r,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:a(r,"supportsReturningQueryExtent",!1),supportsFormatPBF:v&&f.has("pbf"),supportsFormatPBFWithCurves:h,supportsFullTextSearch:a(r,"supportsFullTextSearch",!1),supportsGeometryProperties:a(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:a(r,"supportsHavingClause",!1),supportsHistoricMoment:a(n,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:a(r,"supportsMaxRecordCountFactor",!1),supportsOrderBy:a(r,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:a(r,"supportsPagination",!1),supportsPaginationOnAggregatedQueries:a(r,"supportsPaginationOnAggregatedQueries",!1),supportsPercentileStatistics:a(r,"supportsPercentileStatistics",!1),supportsQuantization:a(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:a(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:a(o,"allowAnonymousToQuery",!0),supportsQueryByOthers:a(o,"allowOthersToQuery",!0),supportsQueryGeometry:a(t,"supportsReturningQueryGeometry",!1),supportsResultType:a(r,"supportsQueryWithResultType",!1),supportsReturnMesh:!!p(t.infoFor3D),supportsSpatialAggregationStatistics:a(r,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:a(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:a(t,"useStandardizedQueries",!1),supportsStatistics:a(r,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:a(r,"supportsTopFeaturesQuery",!1),supportsTrueCurve:a(r,"supportsTrueCurve",!1),tileMaxRecordCount:i(t,"tileMaxRecordCount",void 0)}}function S(t){const e=t.advancedQueryCapabilities,s=a(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:a(e,"supportsQueryRelatedPagination",!1),supportsCount:s,supportsOrderBy:s,supportsCacheHint:l(e,"queryRelated")}}function T(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryTopFilter")}}function x(t){const e=t?t.queryBinsCapabilities:void 0;return{supportsDate:a(e,"supportsDateBin",!1),supportsFixedInterval:a(e,"supportsFixedIntervalBin",!1),supportsAutoInterval:a(e,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:a(e,"supportsFixedBoundariesBin",!1),supportsStackBy:a(e,"supportsStackBy",!1),supportsSplitBy:a(e,"supportsSplitBy",!1),supportsSnapToData:a(e,"supportsSnapToData",!1),supportsReturnFullIntervalBin:a(e,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:a(e,"supportsFirstDayOfWeek",!1),supportsNormalization:a(e,"supportsNormalization",!1),supportedStatistics:y(e),supportedNormalizationTypes:m(e)}}function R(t){const e=t.ownershipBasedAccessControlForFeatures,s=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:a(t,"allowGeometryUpdates",!0),supportsGlobalId:a(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:a(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:a(t,"supportsRollbackOnFailureParameter",!1),supportsTrueCurveUpdate:a(t,"allowTrueCurvesUpdates",!0),supportsTrueCurveUpdateByTrueCurveClientsOnly:a(t,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0),supportsUpdateWithoutM:a(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:a(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:a(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:a(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:a(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:a(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:a(s,"supportsAsyncApplyEdits",!1),zDefault:i(t,"zDefault",void 0)}}function B(s,r){const p=s.supportedCurveTypes??s.advancedQueryCapabilities?.supportedCurveTypes;return Array.isArray(p)?p.map(t=>e.fromJSON(t)).filter(t):r?d:[]}function D(t){return{operations:{supportsAppend:a(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:a(t,"supportsExportClip",!1),supportsExportFrameset:a(t,"supportsExportFrameset",!1),supportsMensuration:a(t,"supportsMensuration",!1),supportsPreviews:a(t,"supportsPreviews",!1),supportsUpdate:a(t,"supportsUpdate",!1)}}}export{d as allCurveTypes,v as getFeatureLayerCapabilities,D as getVideoLayerCapabilities};
2
+ import{isSome as t}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{curveTypeDict as e}from"../../geometry/support/typeUtils.js";import{isHostedAgolService as s,parse as r}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as p,modelFormatsFromFormatIds as o}from"./infoFor3D.js";import{getRelativeTimeQueryBinWindowSize as u}from"./relativeTimeQueryUtils.js";import{readNumber as i,readBoolean as a}from"../../rest/support/jsonUtils.js";const n={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},d=["cubic-bezier","circular-arc","elliptic-arc"];function c(t){const e=t?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function l(t,e){const s=t?.supportedOperationsWithCacheHint?.map(t=>t.toLowerCase());return!!s?.includes(e.toLowerCase())}function y(t){const e=t?.supportedStatisticTypes?.map(t=>t.toLowerCase());return{count:!!e?.includes("count"),sum:!!e?.includes("sum"),min:!!e?.includes("min"),max:!!e?.includes("max"),avg:!!e?.includes("avg"),var:!!e?.includes("var"),stddev:!!e?.includes("stddev"),percentileContinuous:!!e?.includes("percentile_cont"),percentileDiscrete:!!e?.includes("percentile_disc"),envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function m(t){const e=t?.supportedNormalizationTypes?.map(t=>t.toLowerCase());return{field:!!e?.includes("field"),log:!!e?.includes("log"),naturalLog:!!e?.includes("naturallog"),percentOfTotal:!!e?.includes("percentoftotal"),squareRoot:!!e?.includes("squareroot")}}function C(t){if(!has("featurelayer-pbf-true-curves"))return!1;return(t.supportedTrueCurvePbfFeatureEncodings??[]).includes("esriDefault")}function v(t,e){return{analytics:g(t),attachment:f(t),data:h(t),metadata:Q(t),operations:A(t.capabilities,t,e),query:F(t,e),queryAttributeBins:x(t),queryRelated:S(t),queryTopFeatures:T(t),editing:R(t)}}function g(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryAnalytics")}}function f(t){const e=t.attachmentProperties,s={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:l(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:a(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:a(t,"supportsAttachmentsResizing",!1),supportsTypeWildcard:a(t.advancedQueryCapabilities,"supportsQueryAttachmentWithTypeWildcard",!1),supportsCountOnly:a(t.advancedQueryCapabilities,"supportsQueryAttachmentsCountOnly",!1)};return e&&Array.isArray(e)&&e.forEach(t=>{const e=n[t.name];e&&(s[e]=!!t.isEnabled)}),s}function h(t){const e=a(t.advancedQueryCapabilities,"supportsTrueCurve",!1),s=t.infoFor3D,r=s?.supportedFormats??[];return{isVersioned:a(t,"isDataVersioned",!1),isBranchVersioned:a(t,"isDataBranchVersioned",!1),queryFormats:s?o(s.queryFormats,r):void 0,sourceFormats:s?o(s.editFormats,r):void 0,supportsAttachment:a(t,"hasAttachments",!1),supportsM:a(t,"hasM",!1),supportsTrueCurve:e,supportedCurveTypes:B(t,e),supportsZ:a(t,"hasZ",!1)}}function Q(t){return{supportsAdvancedFieldProperties:a(t,"supportsFieldDescriptionProperty",!1)}}function A(t,e,p){const o=s(p),u=t?.toLowerCase().split(",").map(t=>t.trim())??[],i=p?r(p):null,n=u.includes("MapServer"===i?.serverType?"data":"query"),d=u.includes("editing")&&!e.datesInUnknownTimezone&&!(null!=p&&!0===e.uniqueIdInfo?.OIDFieldContainsHashValue);let c=d&&u.includes("create"),l=d&&u.includes("delete"),y=d&&u.includes("update");const m=u.includes("changetracking"),C=e.advancedQueryCapabilities;let v=a(e,"supportsExceedsLimitStatistics",!1);if(!o){a(C,"supportsUseEstimateForExceedsLimit",!1)||(v=!1)}return d&&!(c||l||y)&&(c=l=y=!0),{supportsCalculate:a(e,"supportsCalculate",!1),supportsTruncate:a(e,"supportsTruncate",!1),supportsValidateSql:a(e,"supportsValidateSql",!1),supportsAdd:c,supportsDelete:l,supportsEditing:d,supportsChangeTracking:m,supportsQuery:n,supportsQueryAnalytics:a(C,"supportsQueryAnalytic",!1),supportsQueryAttachments:a(C,"supportsQueryAttachments",!1),supportsQueryBins:a(C,"supportsQueryBins",!1)||!!e.queryBinsCapabilities,supportsQueryPivot:a(C,"supportsQueryPivot",!1),supportsQueryTopFeatures:a(C,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:a(e,"supportsAttachmentsResizing",!1),supportsSync:u.includes("sync"),supportsUpdate:y,supportsExceedsLimitStatistics:v,supportsAsyncConvert3D:a(e,"supportsAsyncConvert3D",!1)}}function F(t,e){const r=t.advancedQueryCapabilities,o=t.ownershipBasedAccessControlForFeatures,n=t.archivingInfo,d=t.currentVersion,y=u(e,t.cacheMaxAge),m=e?.includes("MapServer"),v=!m||d>=has("mapserver-pbf-version-support"),g=s(e),f=new Set((t.supportedQueryFormats??"").split(",").map(t=>t.toLowerCase().trim())),h=v&&C(t);return{maxRecordCount:i(t,"maxRecordCount",void 0),maxRecordCountFactor:i(t,"maxRecordCountFactor",void 0),maxUniqueIDCount:i(t,"maxUniqueIDCount",void 0),relativeTimeBinWindow:y,standardMaxRecordCount:i(t,"standardMaxRecordCount",void 0),standardMaxRecordCountNoGeometry:i(t,"standardMaxRecordCountNoGeometry",void 0),supportedSpatialAggregationStatistics:c(r),supportsCacheHint:a(r,"supportsQueryWithCacheHint",!1)||l(r,"query"),supportsCentroid:a(r,"supportsReturningGeometryCentroid",!1),supportsCentroidOnDegeneratedQuantizedGeometry:g||null==e,supportsCompactGeometry:g,supportsCurrentUser:a(r,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:a(r,"supportsDefaultSR",!1),supportsDegeneratedQuantizedGeometry:a(r,"supportsDegeneratedQuantizedGeometry",!1),supportsDisjointSpatialRelationship:a(r,"supportsDisjointSpatialRel",!1),supportsDistance:a(r,"supportsQueryWithDistance",!1),supportsDistinct:a(r,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:a(r,"supportsReturningQueryExtent",!1),supportsFormatPBF:v&&f.has("pbf"),supportsFormatPBFWithCurves:h,supportsFullTextSearch:a(r,"supportsFullTextSearch",!1),supportsGeometryProperties:a(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:a(r,"supportsHavingClause",!1),supportsHistoricMoment:a(n,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:a(r,"supportsMaxRecordCountFactor",!1),supportsOrderBy:a(r,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:a(r,"supportsPagination",!1),supportsPaginationOnAggregatedQueries:a(r,"supportsPaginationOnAggregatedQueries",!1),supportsPercentileStatistics:a(r,"supportsPercentileStatistics",!1),supportsQuantization:a(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:a(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:a(o,"allowAnonymousToQuery",!0),supportsQueryByOthers:a(o,"allowOthersToQuery",!0),supportsQueryGeometry:a(t,"supportsReturningQueryGeometry",!1),supportsResultType:a(r,"supportsQueryWithResultType",!1),supportsReturnMesh:!!p(t.infoFor3D),supportsSpatialAggregationStatistics:a(r,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:a(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:a(t,"useStandardizedQueries",!1),supportsStatistics:a(r,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:a(r,"supportsTopFeaturesQuery",!1),supportsTrueCurve:a(r,"supportsTrueCurve",!1),tileMaxRecordCount:i(t,"tileMaxRecordCount",void 0)}}function S(t){const e=t.advancedQueryCapabilities,s=a(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:a(e,"supportsQueryRelatedPagination",!1),supportsCount:s,supportsOrderBy:s,supportsCacheHint:l(e,"queryRelated")}}function T(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryTopFilter")}}function x(t){const e=t?t.queryBinsCapabilities:void 0;return{supportsDate:a(e,"supportsDateBin",!1),supportsFixedInterval:a(e,"supportsFixedIntervalBin",!1),supportsAutoInterval:a(e,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:a(e,"supportsFixedBoundariesBin",!1),supportsStackBy:a(e,"supportsStackBy",!1),supportsSplitBy:a(e,"supportsSplitBy",!1),supportsSnapToData:a(e,"supportsSnapToData",!1),supportsReturnFullIntervalBin:a(e,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:a(e,"supportsFirstDayOfWeek",!1),supportsNormalization:a(e,"supportsNormalization",!1),supportedStatistics:y(e),supportedNormalizationTypes:m(e)}}function R(t){const e=t.ownershipBasedAccessControlForFeatures,s=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:a(t,"allowGeometryUpdates",!0),supportsGlobalId:a(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:a(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:a(t,"supportsRollbackOnFailureParameter",!1),supportsTrueCurveUpdate:a(t,"allowTrueCurvesUpdates",!0),supportsTrueCurveUpdateByTrueCurveClientsOnly:a(t,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0),supportsUpdateWithoutM:a(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:a(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:a(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:a(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:a(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:a(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:a(s,"supportsAsyncApplyEdits",!1),zDefault:i(t,"zDefault",void 0)}}function B(s,r){const p=s.supportedCurveTypes??s.advancedQueryCapabilities?.supportedCurveTypes;return Array.isArray(p)?p.map(t=>e.fromJSON(t)).filter(t):r?d:[]}function D(t){return{operations:{supportsAppend:a(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:a(t,"supportsExportClip",!1),supportsExportFrameset:a(t,"supportsExportFrameset",!1),supportsMensuration:a(t,"supportsMensuration",!1),supportsPreviews:a(t,"supportsPreviews",!1),supportsUpdate:a(t,"supportsUpdate",!1)}}}export{d as allCurveTypes,v as getFeatureLayerCapabilities,D as getVideoLayerCapabilities};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.80",
3
+ "version": "5.1.0-next.81",
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": [
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const a="20260423",b="5ae6a3dcbbb089fcea30f0c65e683f3ad9b07798";export{a as buildDate,b as commitHash};
2
+ const c="20260424",e="e3cb535920f716fc8251593e2e717c0804b80d5b";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{destroyMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as e}from"../../../../core/memoryEstimations.js";import"../../tiling/TileInfoView.js";import s from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{deserializeSymbols as r}from"./decluttering/util.js";import{Mesh as i}from"../webgl/meshing/Mesh.js";import{PrimitiveType as n}from"../../../webgl/enums.js";class a{constructor(t,e){this.layerUIDs=[],this.isDestroyed=!1,this._mesh=null,this._data=t;let s=1;const r=new Uint32Array(t);this.layerUIDs=[];const i=r[s++];for(let n=0;n<i;n++)this.layerUIDs[n]=r[s++];this.bufferDataOffset=s,e&&(this.layer=e.getStyleLayerByUID(this.layerUIDs[0]))}get isPreparedForRendering(){return null==this._data}get offset(){return this.bufferDataOffset}get data(){return this._data}nullifyData(){this._data=null}destroy(){this.isDestroyed||(this.doDestroy(),this._data=null,t(this._mesh),this.isDestroyed=!0)}}class o extends a{constructor(t,e){super(t,e),this.type=2,this.lineIndexStart=0,this.lineIndexCount=0;const s=new Uint32Array(t);let r=this.bufferDataOffset;this.lineIndexStart=s[r++],this.lineIndexCount=s[r++];const i=s[r++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=s[r++],e=s[r++],i=s[r++];this.patternMap.set(t,[e,i])}}this.bufferDataOffset=r}get usedMemory(){return this.data?.byteLength??0}hasData(){return this.lineIndexCount>0}triangleCount(){return this.lineIndexCount/3}doDestroy(){}getMesh(t){if(this._mesh)return this._mesh;const e=this.data;if(!e)return;const s=this.layer,r=s.getPaintProperty("line-pattern"),a=void 0!==r,o=a&&r.isDataDriven;let h=!1;if(!a){const t=s.getPaintProperty("line-dasharray");h=void 0!==t&&t.isDataDriven}const u=this.patternMap,l=[];if(u&&(o||h))for(const[i,n]of u)l.push({group:0,start:n[0],count:n[1]});else l.push({group:0,start:this.lineIndexStart,count:this.lineIndexCount});const f=new Uint32Array(e),y=new Int32Array(f.buffer);let c=this.bufferDataOffset;const d=f[c++],p=new Int32Array(y.buffer,4*c,d);c+=d;const g=f[c++],m=new Uint32Array(f.buffer,4*c,g),I=this.layer.lineMaterial.geometryLayout;if(!I)return;const x={vertex:{geometryVB:{data:p,layout:I}},index:{geometryIB:{data:m}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:l};return this._mesh=new i(t,x),this.nullifyData(),this._mesh}}class h extends a{constructor(t,e){super(t,e),this.type=1,this._outlineMesh=null,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(t);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const i=s[r++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=s[r++],e=s[r++],i=s[r++];this.patternMap.set(t,[e,i])}}this.bufferDataOffset=r}get usedMemory(){return this.data?.byteLength??0}hasData(){return this.fillIndexCount>0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){t(this._outlineMesh)}getMesh(t,e){if(0===e.value&&this._mesh)return this._mesh;if(1===e.value&&this._outlineMesh)return this._outlineMesh;if(!this.data)return null;const s=new Uint32Array(this.data),r=new Int32Array(s.buffer);let a=0,o=0,h=0,u=0,l=this.bufferDataOffset;const f=s[l++];a=l,l+=f;const y=s[l++];o=l,l+=y;const c=s[l++];h=l,l+=c;const d=s[l++];u=l;const p=this.layer;if(y>0){const e=p.fillMaterial,h=new Int32Array(r.buffer,4*a,f),u=new Uint32Array(s.buffer,4*o,y),l={vertex:{geometryVB:{data:h,layout:e.geometryLayout}},index:{geometryIB:{data:u}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:[{group:0,start:this.fillIndexStart,count:this.fillIndexCount}]};this._mesh=new i(t,l)}if(d>0){const e=p.outlineMaterial,a=new Int32Array(r.buffer,4*h,c),o=new Uint32Array(s.buffer,4*u,d),l={vertex:{geometryVB:{data:a,layout:e.geometryLayout}},index:{geometryIB:{data:o}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:[{group:0,start:this.outlineIndexStart,count:this.outlineIndexCount}]};this._outlineMesh=new i(t,l)}return this.nullifyData(),0===e.value?this._mesh:this._outlineMesh}}class u extends a{constructor(t,e,i){super(t,e),this.type=3,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[],this._textMesh=null;const n=new Uint32Array(t),a=new Int32Array(t),o=new Float32Array(t);let h=this.bufferDataOffset;this.isIconSDF=!!n[h++];const u=n[h++],l=n[h++],f=n[h++],y=new s(u,l,f,0),c=n[h++];for(let s=0;s<c;s++){const t=n[h++],e=n[h++],s=n[h++];this.iconPerPageElementsMap.set(t,[e,s])}const d=n[h++];for(let s=0;s<d;s++){const t=n[h++],e=n[h++],s=n[h++];this.glyphPerPageElementsMap.set(t,[e,s])}const p=n[h++],g=n[h++];this.iconOpacity=new Int32Array(p),this.textOpacity=new Int32Array(g),h=r(n,a,o,h,this.symbols,i,y),this.bufferDataOffset=h}get usedMemory(){return(this.data?.byteLength??0)+e(this.iconOpacity)+e(this.textOpacity)}hasData(){return this.iconPerPageElementsMap.size>0||this.glyphPerPageElementsMap.size>0}triangleCount(){let t=0;for(const e of this.iconPerPageElementsMap.values())t+=e[1];for(const e of this.glyphPerPageElementsMap.values())t+=e[1];return t/3}doDestroy(){this._textMesh=t(this._textMesh)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const t=this.iconOpacity,e=this._mesh?.vertexBuffers.get("opacity");e&&t.length>0&&t.byteLength===e.usedMemory&&e.setSubData(t,0,0,t.length);const s=this.textOpacity,r=this._textMesh?.vertexBuffers.get("opacity");r&&s.length>0&&s.byteLength===r.usedMemory&&r.setSubData(s,0,0,s.length)}getMesh(t,e){if(0===e.value&&this._mesh)return this._mesh;if(1===e.value&&this._textMesh)return this._textMesh;let s=this.bufferDataOffset;if(!this.data)return null;const r=new Uint32Array(this.data),a=new Int32Array(r.buffer),o=r[s++],h=s;s+=o;const u=r[s++],l=s;s+=u;const f=r[s++],y=s;s+=f;const c=r[s++],d=s;s+=c;const p=this.layer;if(this.iconPerPageElementsMap.size>0){const e=p.iconMaterial,s=[];for(const[t,r]of this.iconPerPageElementsMap)s.push({group:0,start:r[0],count:r[1]});const f=new Int32Array(a.buffer,4*h,o),y=new Uint32Array(r.buffer,4*l,u),c=this.iconOpacity,d=e.opacityLayout,g={vertex:{geometry:{data:f,layout:e.geometryLayout},opacity:{data:c,layout:d}},index:{geometryIB:{data:y}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:s};this._mesh=new i(t,g)}if(this.glyphPerPageElementsMap.size>0){const e=p.textMaterial,s=[];for(const[t,r]of this.glyphPerPageElementsMap)s.push({group:0,start:r[0],count:r[1]});const o=new Int32Array(a.buffer,4*y,f),h=new Uint32Array(r.buffer,4*d,c),u=this.textOpacity,l=e.opacityLayout,g={vertex:{geometry:{data:o,layout:e.geometryLayout},opacity:{data:u,layout:l}},index:{geometryIB:{data:h}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:s};this._textMesh=new i(t,g)}return this.nullifyData(),0===e.value?this._mesh:this._textMesh}}class l extends a{constructor(t,e){super(t,e),this.type=4,this.circleIndexStart=0,this.circleIndexCount=0;const s=new Uint32Array(t);let r=this.bufferDataOffset;this.circleIndexStart=s[r++],this.circleIndexCount=s[r++],this.bufferDataOffset=r}get usedMemory(){return this.data?.byteLength??0}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){}getMesh(t){if(this._mesh)return this._mesh;if(!this.data)return;const e=new Uint32Array(this.data),s=new Int32Array(e.buffer);let r=this.bufferDataOffset;const a=e[r++],o=new Int32Array(s.buffer,4*r,a);r+=a;const h=e[r++],u=new Uint32Array(e.buffer,4*r,h),l=this.layer.circleMaterial.geometryLayout;if(!l)return;const f={vertex:{geometryVB:{data:o,layout:l}},index:{geometryIB:{data:u}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:[{group:0,start:this.circleIndexStart,count:this.circleIndexCount}]};return this._mesh=new i(t,f),this._mesh}}export{l as CircleRenderBucket,h as FillRenderBucket,o as LineRenderBucket,a as RenderBucketBase,u as SymbolRenderBucket};
2
+ import{destroyMaybe as t}from"../../../../core/maybe.js";import{estimateNumberArrayMemory as e}from"../../../../core/memoryEstimations.js";import"../../tiling/TileInfoView.js";import s from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{deserializeSymbols as r}from"./decluttering/util.js";import{Mesh as i}from"../webgl/meshing/Mesh.js";import{PrimitiveType as n}from"../../../webgl/enums.js";class a{constructor(t,e){this.layerUIDs=[],this.isDestroyed=!1,this._mesh=null,this._data=t;let s=1;const r=new Uint32Array(t);this.layerUIDs=[];const i=r[s++];for(let n=0;n<i;n++)this.layerUIDs[n]=r[s++];this.bufferDataOffset=s,e&&(this.layer=e.getStyleLayerByUID(this.layerUIDs[0]))}get isPreparedForRendering(){return null==this._data}get offset(){return this.bufferDataOffset}get data(){return this._data}nullifyData(){this._data=null}destroy(){this.isDestroyed||(this.doDestroy(),this._data=null,t(this._mesh),this.isDestroyed=!0)}}class o extends a{constructor(t,e){super(t,e),this.type=2,this.lineIndexStart=0,this.lineIndexCount=0;const s=new Uint32Array(t);let r=this.bufferDataOffset;this.lineIndexStart=s[r++],this.lineIndexCount=s[r++];const i=s[r++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=s[r++],e=s[r++],i=s[r++];this.patternMap.set(t,[e,i])}}this.bufferDataOffset=r}get usedMemory(){return this.data?.byteLength??0}hasData(){return this.lineIndexCount>0}triangleCount(){return this.lineIndexCount/3}doDestroy(){}getMesh(t){if(this.isDestroyed)return null;if(this._mesh)return this._mesh;const e=this.data;if(!e)return null;const s=this.layer,r=s.getPaintProperty("line-pattern"),a=void 0!==r,o=a&&r.isDataDriven;let h=!1;if(!a){const t=s.getPaintProperty("line-dasharray");h=void 0!==t&&t.isDataDriven}const u=this.patternMap,l=[];if(u&&(o||h))for(const[i,n]of u)l.push({group:0,start:n[0],count:n[1]});else l.push({group:0,start:this.lineIndexStart,count:this.lineIndexCount});const f=new Uint32Array(e),y=new Int32Array(f.buffer);let c=this.bufferDataOffset;const d=f[c++],p=new Int32Array(y.buffer,4*c,d);c+=d;const g=f[c++],m=new Uint32Array(f.buffer,4*c,g),I=this.layer.lineMaterial.geometryLayout;if(!I)return;const x={vertex:{geometryVB:{data:p,layout:I}},index:{geometryIB:{data:m}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:l};return this._mesh=new i(t,x),this.nullifyData(),this._mesh}}class h extends a{constructor(t,e){super(t,e),this.type=1,this._outlineMesh=null,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(t);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const i=s[r++];if(i>0){this.patternMap=new Map;for(let t=0;t<i;t++){const t=s[r++],e=s[r++],i=s[r++];this.patternMap.set(t,[e,i])}}this.bufferDataOffset=r}get usedMemory(){return this.data?.byteLength??0}hasData(){return this.fillIndexCount>0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){t(this._outlineMesh)}getMesh(t,e){if(this.isDestroyed)return null;if(0===e.value&&this._mesh)return this._mesh;if(1===e.value&&this._outlineMesh)return this._outlineMesh;if(!this.data)return null;const s=new Uint32Array(this.data),r=new Int32Array(s.buffer);let a=0,o=0,h=0,u=0,l=this.bufferDataOffset;const f=s[l++];a=l,l+=f;const y=s[l++];o=l,l+=y;const c=s[l++];h=l,l+=c;const d=s[l++];u=l;const p=this.layer;if(y>0){const e=p.fillMaterial,h=new Int32Array(r.buffer,4*a,f),u=new Uint32Array(s.buffer,4*o,y),l={vertex:{geometryVB:{data:h,layout:e.geometryLayout}},index:{geometryIB:{data:u}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:[{group:0,start:this.fillIndexStart,count:this.fillIndexCount}]};this._mesh=new i(t,l)}if(d>0){const e=p.outlineMaterial,a=new Int32Array(r.buffer,4*h,c),o=new Uint32Array(s.buffer,4*u,d),l={vertex:{geometryVB:{data:a,layout:e.geometryLayout}},index:{geometryIB:{data:o}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:[{group:0,start:this.outlineIndexStart,count:this.outlineIndexCount}]};this._outlineMesh=new i(t,l)}return this.nullifyData(),0===e.value?this._mesh:this._outlineMesh}}class u extends a{constructor(t,e,i){super(t,e),this.type=3,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[],this._textMesh=null;const n=new Uint32Array(t),a=new Int32Array(t),o=new Float32Array(t);let h=this.bufferDataOffset;this.isIconSDF=!!n[h++];const u=n[h++],l=n[h++],f=n[h++],y=new s(u,l,f,0),c=n[h++];for(let s=0;s<c;s++){const t=n[h++],e=n[h++],s=n[h++];this.iconPerPageElementsMap.set(t,[e,s])}const d=n[h++];for(let s=0;s<d;s++){const t=n[h++],e=n[h++],s=n[h++];this.glyphPerPageElementsMap.set(t,[e,s])}const p=n[h++],g=n[h++];this.iconOpacity=new Int32Array(p),this.textOpacity=new Int32Array(g),h=r(n,a,o,h,this.symbols,i,y),this.bufferDataOffset=h}get usedMemory(){return(this.data?.byteLength??0)+e(this.iconOpacity)+e(this.textOpacity)}hasData(){return this.iconPerPageElementsMap.size>0||this.glyphPerPageElementsMap.size>0}triangleCount(){let t=0;for(const e of this.iconPerPageElementsMap.values())t+=e[1];for(const e of this.glyphPerPageElementsMap.values())t+=e[1];return t/3}doDestroy(){this._textMesh=t(this._textMesh)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const t=this.iconOpacity,e=this._mesh?.vertexBuffers.get("opacity");e&&t.length>0&&t.byteLength===e.usedMemory&&e.setSubData(t,0,0,t.length);const s=this.textOpacity,r=this._textMesh?.vertexBuffers.get("opacity");r&&s.length>0&&s.byteLength===r.usedMemory&&r.setSubData(s,0,0,s.length)}getMesh(t,e){if(this.isDestroyed)return null;if(0===e.value&&this._mesh)return this._mesh;if(1===e.value&&this._textMesh)return this._textMesh;let s=this.bufferDataOffset;if(!this.data)return null;const r=new Uint32Array(this.data),a=new Int32Array(r.buffer),o=r[s++],h=s;s+=o;const u=r[s++],l=s;s+=u;const f=r[s++],y=s;s+=f;const c=r[s++],d=s;s+=c;const p=this.layer;if(this.iconPerPageElementsMap.size>0){const e=p.iconMaterial,s=[];for(const[t,r]of this.iconPerPageElementsMap)s.push({group:0,start:r[0],count:r[1]});const f=new Int32Array(a.buffer,4*h,o),y=new Uint32Array(r.buffer,4*l,u),c=this.iconOpacity,d=e.opacityLayout,g={vertex:{geometry:{data:f,layout:e.geometryLayout},opacity:{data:c,layout:d}},index:{geometryIB:{data:y}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:s};this._mesh=new i(t,g)}if(this.glyphPerPageElementsMap.size>0){const e=p.textMaterial,s=[];for(const[t,r]of this.glyphPerPageElementsMap)s.push({group:0,start:r[0],count:r[1]});const o=new Int32Array(a.buffer,4*y,f),h=new Uint32Array(r.buffer,4*d,c),u=this.textOpacity,l=e.opacityLayout,g={vertex:{geometry:{data:o,layout:e.geometryLayout},opacity:{data:u,layout:l}},index:{geometryIB:{data:h}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:s};this._textMesh=new i(t,g)}return this.nullifyData(),0===e.value?this._mesh:this._textMesh}}class l extends a{constructor(t,e){super(t,e),this.type=4,this.circleIndexStart=0,this.circleIndexCount=0;const s=new Uint32Array(t);let r=this.bufferDataOffset;this.circleIndexStart=s[r++],this.circleIndexCount=s[r++],this.bufferDataOffset=r}get usedMemory(){return this.data?.byteLength??0}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){}getMesh(t){if(this.isDestroyed)return null;if(this._mesh)return this._mesh;if(!this.data)return null;const e=new Uint32Array(this.data),s=new Int32Array(e.buffer);let r=this.bufferDataOffset;const a=e[r++],o=new Int32Array(s.buffer,4*r,a);r+=a;const h=e[r++],u=new Uint32Array(e.buffer,4*r,h),l=this.layer.circleMaterial.geometryLayout;if(!l)return;const f={vertex:{geometryVB:{data:o,layout:l}},index:{geometryIB:{data:u}},groups:[{index:"geometryIB",primitive:n.TRIANGLES}],parts:[{group:0,start:this.circleIndexStart,count:this.circleIndexCount}]};return this._mesh=new i(t,f),this._mesh}}export{l as CircleRenderBucket,h as FillRenderBucket,o as LineRenderBucket,a as RenderBucketBase,u as SymbolRenderBucket};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{RenderingDevice as e}from"../webgl/RenderingDevice.js";import{simplePipelineState as t}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as i}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";const r=1e-6;class n{constructor(t,r){this.spriteMosaic=t,this.glyphMosaic=r,this._vtlTechniques=new i,this._context=null,this._vtlTechniques.startup(),this._renderingDevice=new e}dispose(){this._vtlTechniques&&this._vtlTechniques.shutdown(this._context),this.spriteMosaic.dispose(),this.glyphMosaic.dispose(),this._renderingDevice.dispose(),this._context=null}drawSymbols(e,t,i){const n=i.layers;e.renderPass="translucent";const l=this._vtlTechniques.getTechnique(3);s[0]=t;for(let o=0;o<n.length;o++){const t=n[o];if(3!==t.type)continue;const i=t.getLayoutProperty("visibility");if(i&&1===i.getValue())continue;const a=e.displayLevel;void 0!==t.minzoom&&t.minzoom>a+r||void 0!==t.maxzoom&&t.maxzoom<=a-r||(e.styleLayerUID=t.uid,e.styleLayer=t,l.render(e,{tiles:s}))}s[0]=null}drawBackground(e,t,i){if(0===i.backgroundBucketIds.length)return;const{displayLevel:n,requiredLevel:l}=e;t.key.level=l,this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:{write:!1,test:519}}),e.renderPass="background";const o=this._vtlTechniques.getTechnique(0);s[0]=t,i.backgroundBucketIds.forEach(t=>{const l=i.getLayerById(t);if(0!==l.type)return;const a=l.getLayoutProperty("visibility");a&&1===a.getValue()||void 0!==l.minzoom&&l.minzoom>n+r||void 0!==l.maxzoom&&l.maxzoom<=n-r||(e.styleLayerUID=l.uid,e.styleLayer=l,o.render(e,{tiles:s}))}),s[0]=null}drawTile(e,i,r,n){const s=r.layers.filter(e=>{if(null!=n&&n!==e.type||!i.layerData.has(e.uid))return!1;const t=e.getLayoutProperty("visibility");return 1!==t?.getValue()}),{context:l}=e,o=l.getPipelineState(),{depthWrite:a}=o;let c=0,h=1;void 0!==a?.zNear&&void 0!==a.zFar&&(c=a.zNear,h=a.zFar),this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"none"},stencil:!1,depth:{write:{zNear:c,zFar:h},test:515}}),e.renderPass="opaque";for(let t=s.length-1;t>=0;--t)this._renderStyleLayer(s[t],e,i);this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:{write:!1,test:515}}),e.renderPass="translucent",s.forEach(t=>this._renderStyleLayer(t,e,i)),this._renderingDevice.setPipelineState(t),l.setPipelineState(o),this._context||(this._context=e.context)}setShader(e){return this._renderingDevice.setShader(e)}setPipelineState(e){return this._renderingDevice.setPipelineState(e)}getPipelineState(){return this._renderingDevice.getPipelineState()}submitDraw(e,t,i){return this._renderingDevice.submitDraw(e,t,i)}submitDrawMesh(e,t,i,r){this._renderingDevice.submitDrawMesh(e,t,i,r)}submitDrawMeshUntyped(e,t,i,r){this._renderingDevice.submitDrawMeshUntyped(e,t,i,r)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}_renderStyleLayer(e,t,i){const{renderPass:n}=t;let l;switch(e.type){case 0:if("background"!==n)return;l=this._vtlTechniques.getTechnique(0);break;case 1:if("opaque"!==n&&"translucent"!==n)return;l=this._vtlTechniques.getTechnique(1);break;case 2:if("translucent"!==n)return;l=this._vtlTechniques.getTechnique(2);break;case 4:if("translucent"!==n)return;l=this._vtlTechniques.getTechnique(4);break;case 3:if("translucent"!==n)return;l=this._vtlTechniques.getTechnique(3)}const{displayLevel:o}=t,{minzoom:a,maxzoom:c}=e;if(void 0!==a&&a>o+r||void 0!==c&&c<=o-r||!l)return;const h=this._renderingDevice.getPipelineState();3===e.type&&this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:!1}),t.styleLayerUID=e.uid,t.styleLayer=e,s[0]=i,l.render(t,{tiles:s}),s[0]=null,3===e.type&&this._renderingDevice.setPipelineState(h)}}const s=[null];export{n as default};
2
+ import{RenderingDevice as e}from"../webgl/RenderingDevice.js";import{simplePipelineState as t}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as i}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";const r=1e-6;class n{constructor(t,r){this.spriteMosaic=t,this.glyphMosaic=r,this._vtlTechniques=new i,this._context=null,this._vtlTechniques.startup(),this._renderingDevice=new e}dispose(){this._vtlTechniques&&this._vtlTechniques.shutdown(this._context),this.spriteMosaic.dispose(),this.glyphMosaic.dispose(),this._renderingDevice.dispose(),this._context=null}drawSymbols(e,t,i){const n=i.layers;e.renderPass="translucent";const o=this._vtlTechniques.getTechnique(3);s[0]=t;for(let l=0;l<n.length;l++){const t=n[l];if(3!==t.type)continue;const i=t.getLayoutProperty("visibility");if(i&&1===i.getValue())continue;const a=e.displayLevel;void 0!==t.minzoom&&t.minzoom>a+r||void 0!==t.maxzoom&&t.maxzoom<=a-r||(e.styleLayerUID=t.uid,e.styleLayer=t,o.render(e,{tiles:s}))}s[0]=null}drawBackground(e,t,i){if(0===i.backgroundBucketIds.length)return;const{displayLevel:n,requiredLevel:o}=e;t.key.level=o,this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:{write:!1,test:519}}),e.renderPass="background";const l=this._vtlTechniques.getTechnique(0);s[0]=t,i.backgroundBucketIds.forEach(t=>{const o=i.getLayerById(t);if(0!==o.type)return;const a=o.getLayoutProperty("visibility");a&&1===a.getValue()||void 0!==o.minzoom&&o.minzoom>n+r||void 0!==o.maxzoom&&o.maxzoom<=n-r||(e.styleLayerUID=o.uid,e.styleLayer=o,l.render(e,{tiles:s}))}),s[0]=null}drawTile(e,i,r,n){const s=r.layers.filter(e=>{if(null!=n&&n!==e.type||!i.layerData.has(e.uid))return!1;const t=e.getLayoutProperty("visibility");return 1!==t?.getValue()}),{context:o}=e,l=o.getPipelineState(),{depthWrite:a}=l;i.disposeLayerData();let c=0,d=1;void 0!==a?.zNear&&void 0!==a.zFar&&(c=a.zNear,d=a.zFar),this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"none"},stencil:!1,depth:{write:{zNear:c,zFar:d},test:515}}),e.renderPass="opaque";for(let t=s.length-1;t>=0;--t)this._renderStyleLayer(s[t],e,i);this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:{write:!1,test:515}}),e.renderPass="translucent",s.forEach(t=>this._renderStyleLayer(t,e,i)),this._renderingDevice.setPipelineState(t),o.setPipelineState(l),this._context||(this._context=e.context)}setShader(e){return this._renderingDevice.setShader(e)}setPipelineState(e){return this._renderingDevice.setPipelineState(e)}getPipelineState(){return this._renderingDevice.getPipelineState()}submitDraw(e,t,i){return this._renderingDevice.submitDraw(e,t,i)}submitDrawMesh(e,t,i,r){this._renderingDevice.submitDrawMesh(e,t,i,r)}submitDrawMeshUntyped(e,t,i,r){this._renderingDevice.submitDrawMeshUntyped(e,t,i,r)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}_renderStyleLayer(e,t,i){const{renderPass:n}=t;let o;switch(e.type){case 0:if("background"!==n)return;o=this._vtlTechniques.getTechnique(0);break;case 1:if("opaque"!==n&&"translucent"!==n)return;o=this._vtlTechniques.getTechnique(1);break;case 2:if("translucent"!==n)return;o=this._vtlTechniques.getTechnique(2);break;case 4:if("translucent"!==n)return;o=this._vtlTechniques.getTechnique(4);break;case 3:if("translucent"!==n)return;o=this._vtlTechniques.getTechnique(3)}const{displayLevel:l}=t,{minzoom:a,maxzoom:c}=e;if(void 0!==a&&a>l+r||void 0!==c&&c<=l-r||!o)return;const d=this._renderingDevice.getPipelineState();3===e.type&&this._renderingDevice.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:!1}),t.styleLayerUID=e.uid,t.styleLayer=e,s[0]=i,o.render(t,{tiles:s}),s[0]=null,3===e.type&&this._renderingDevice.setPipelineState(d)}}const s=[null];export{n as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{prefersReducedMotion as e}from"../../../../core/a11yUtils.js";import has from"../../../../core/has.js";import{identity as t,translate as s,rotate as r,scale as a}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileSizeInTileUnits as o}from"./constants.js";import{CircleRenderBucket as n,SymbolRenderBucket as h,LineRenderBucket as l,FillRenderBucket as c}from"./RenderBucket.js";import{fadeDuration as d}from"./decluttering/config.js";import{TiledDisplayObject as u}from"../webgl/TiledDisplayObject.js";import y from"../webgl/util/Fader.js";const m=null;class p extends u{constructor(t,s,r,a,i,n,h,l=null){super(t,s,r,a,i,n,o,o),this.styleRepository=h,this._owner=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=t.id;const c="TileHandler3D"===this._owner?.type?1:0,d=e()?0:has("mapview-transitions-duration")??300;this.fader=y.create(c,d)}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<d}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<d)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(this._usedMemory-=e.usedMemory,3===e.type&&this.symbols.delete(s)&&(t=!0),e.destroy(),this.layerData.delete(s))}this._owner?.updateTileSize(this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){"unloaded"!==this.status&&(p._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0===--this._referenced&&(this._owner?.onDisposeTile(this),this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),3===i.type&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._owner?.updateTileSize(this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())3===s.type&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const i=this.resolution/(e.resolution*e.pixelRatio),o=this.width/this.rangeX*i,n=this.height/this.rangeY*i,h=[0,0];e.toScreen(h,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;t(l),s(l,l,h),r(l,l,Math.PI*e.rotation/180),a(l,l,[o,n,1])}_createTransforms(){return{displayViewScreenMat3:i(),tileMat3:i(),tileUnitsToPixels:i()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case 1:s=new c(e,this.styleRepository);break;case 2:s=new l(e,this.styleRepository);break;case 3:s=new h(e,this.styleRepository,this);break;case 4:s=new n(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}}export{p as VectorTile,m as tracer};
2
+ import{prefersReducedMotion as e}from"../../../../core/a11yUtils.js";import has from"../../../../core/has.js";import{identity as t,translate as s,rotate as r,scale as a}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{tileSizeInTileUnits as o}from"./constants.js";import{CircleRenderBucket as h,SymbolRenderBucket as n,LineRenderBucket as l,FillRenderBucket as c}from"./RenderBucket.js";import{fadeDuration as d}from"./decluttering/config.js";import{TiledDisplayObject as y}from"../webgl/TiledDisplayObject.js";import u from"../webgl/util/Fader.js";const p=null;class m extends y{constructor(t,s,r,a,i,h,n,l=null){super(t,s,r,a,i,h,o,o),this.styleRepository=n,this._owner=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.layerDataToDispose=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=t.id;const c="TileHandler3D"===this._owner?.type?1:0,d=e()?0:has("mapview-transitions-duration")??300;this.fader=u.create(c,d)}get styleLayerUIDs(){return Array.from(this.layerData.keys())}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate<d}get isHoldingForFade(){return this._hasSymbolBuckets&&(!this.allSymbolsFadingOut||performance.now()-this.lastOpacityUpdate<d)}get wasRequested(){return"errored"===this.status||"loaded"===this.status||"reloading"===this.status}setData(e){this.changeDataImpl(e),this.requestRender(),this.ready(),this._processed=!0}deleteLayerData(e){let t=!1;for(const s of e){const e=this.layerData.get(s);e&&(3===e.type&&this.symbols.delete(s)&&(t=!0),this.layerDataToDispose.set(s,e),this.layerData.delete(s),this.requestRender())}this._owner?.updateTileSize(this),t&&(this.featureIndex?.clear(),this.emit("symbols-changed")),this.requestRender()}processed(){return this._processed}hasData(){return this.layerData.size>0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}disposeLayerData(){for(const[e,t]of this.layerDataToDispose)this._usedMemory-=t.usedMemory,t.destroy();this.layerDataToDispose.clear()}dispose(){"unloaded"!==this.status&&(m._destroyRenderBuckets(this.layerData),m._destroyRenderBuckets(this.layerDataToDispose),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){0===--this._referenced&&(this._owner?.onDisposeTile(this),this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,a=this._createRenderBuckets(s);if(r&&r.byteLength>0){const e=new Uint32Array(r);for(const t of e)this._deleteLayerData(t)}for(const[e,i]of a)this._deleteLayerData(e),3===i.type&&(this.symbols.set(e,i.symbols),t=!0),this._usedMemory+=i.usedMemory,this.layerData.set(e,i);this._owner?.updateTileSize(this)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())3===s.type&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(e){e.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const i=this.resolution/(e.resolution*e.pixelRatio),o=this.width/this.rangeX*i,h=this.height/this.rangeY*i,n=[0,0];e.toScreen(n,[this.x,this.y]);const l=this.transforms.tileUnitsToPixels;t(l),s(l,l,n),r(l,l,Math.PI*e.rotation/180),a(l,l,[o,h,1])}_createTransforms(){return{displayViewScreenMat3:i(),tileMat3:i(),tileUnitsToPixels:i()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const e=this._deserializeBucket(r,s);for(const s of e.layerUIDs)t.set(s,e)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case 1:s=new c(e,this.styleRepository);break;case 2:s=new l(e,this.styleRepository);break;case 3:s=new n(e,this.styleRepository,this);break;case 4:s=new h(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this.layerDataToDispose.set(e,t),this.layerData.delete(e),this.requestRender()}}export{m as VectorTile,p as tracer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as s,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as o}from"./decluttering/util.js";import{RenderableTile as l}from"../webgl/RenderableTile.js";import n from"../webgl/TileContainer.js";import{simplePipelineState as a}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as d}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import h from"../../tiling/TileCoverage.js";import c from"../../tiling/TileKey.js";const u=1e-6;function y(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||1!==s.getValue()&&(void 0===e.minzoom||e.minzoom<t+u)&&(void 0===e.maxzoom||e.maxzoom>=t-u))return!0}return!1}class m extends n{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new d,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null);const e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,l){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tilingScheme=l,this._computeDisplayInfoView(l),null==this._symbolFader){const e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,o(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i("vector-tile",this._styleRepository,e,this.children,s)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){null!=this._symbolFader&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic}}doRender(e){const{drawPhase:t}=e,s=1===t||64===t;this.visible&&s&&void 0!==this._spriteMosaic&&super.doRender(e)}addChild(e){return super.addChild(e),null!=this._symbolFader?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return null!=this._symbolFader&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;64!==t?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){const t=this.children[e];null!=this._symbolFader&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter(e=>e.neededForCoverage&&e.hasData())}restartDeclutter(){null!=this._symbolFader&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,painter:s,state:r}=e,i=this._styleRepository;if(!i)return;const o=i.layers,l=this._displayInfo.scaleToZoom(r.scale);super.renderChildren(e),i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds,l)),1===e.drawPhase&&this._fade(l,r);const n=this.children.filter(e=>e.visible&&e.hasData());if(n&&0!==n.length){for(const e of n)e.triangleCount=0;if(1===e.drawPhase)for(const e of n)e.fader.fade()<1&&this.requestRender();t.setClearDepth(1),t.clear(256),s.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}}),e.renderPass="translucent";for(let t=0;t<o.length;t++)this._renderStyleLayer(o[t],e,n);t.bindVAO(null),s.setPipelineState(a);for(const e of n)e.debugInfo.display.triangleCount=e.triangleCount}else t.bindVAO(null)}_fade(e,t){null!=this._symbolFader&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,s){const{displayLevel:r,renderPass:i}=t;if(void 0===e)return;const o=e.getLayoutProperty("visibility");if(o&&1===o.getValue())return;switch(e.type){case 0:return;case 1:case 2:case 4:case 3:if("translucent"!==i)return}if(s=3===e.type?s.filter(e=>e.decluttered):s.filter(e=>e.neededForCoverage),3!==e.type&&(0===s.length||void 0!==e.minzoom&&e.minzoom>=r+u||void 0!==e.maxzoom&&e.maxzoom<r-u))return;const l=e.uid;t.styleLayerUID=l,t.styleLayer=e;const n=this._techniques.getTechnique(e.type);null!=n&&n.render(t,{tiles:s})}_renderBackgroundLayers(t,i,o){const{state:n}=t,a=this._styleRepository;let d=!1;for(const e of i){const t=a.getLayerById(e);if(t&&0===t.type&&y(a.getLayerById(e),o)){d=!0;break}}if(!d)return;const u=this.tilingScheme,m=u.getTileCoverage(t.state,0,!0,"smallest"),{spans:p,lodInfo:f}=m,{level:g}=f,_=e(),b=[],F=this._backgroundTiles;let R,v=0;for(const{row:h,colFrom:y,colTo:C}of p)for(let t=y;t<=C;t++){if(v<F.length)R=F[v],R.key.set(g,h,f.normalizeCol(t),f.getWorldForColumn(t)),u.getTileBounds(_,R.key,!1),R.x=_[0],R.y=_[3],R.resolution=u.getTileResolution(g);else{const i=new c(g,h,f.normalizeCol(t),f.getWorldForColumn(t)),o=u.getTileBounds(e(),i),n=u.getTileResolution(g);R=new l(i,n,o[0],o[3],r,r,s,s),F.push(R)}R.setTransform(n),b.push(R),v++}const T=this._techniques.getTechnique(0);for(const e of i){const s=a.getLayerById(e);0===s.type&&y(s,o)&&(t.styleLayerUID=s.uid,t.styleLayer=s,T.render(t,{tiles:b}))}h.pool.release(m)}_computeDisplayInfoView(e){let s=e.tileInfo.lods[0].scale;const i=Math.max(25,e.tileInfo.lods.length),o=[];for(let t=0;t<=i;t++)o.push(s),s/=2;this._displayInfo=t.create({scales:o,size:r,spatialReference:e.spatialReference,numLODs:i})}}export{m as VectorTileContainer};
2
+ import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import t from"../../../../layers/support/TileInfo.js";import{tileSizeInTileUnits as s,tileSizeInPixels as r}from"./constants.js";import{SymbolFader as i}from"./decluttering/SymbolFader.js";import{writeOpacityToBuffers as o}from"./decluttering/util.js";import{RenderableTile as l}from"../webgl/RenderableTile.js";import n from"../webgl/TileContainer.js";import{simplePipelineState as a}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as d}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";import h from"../../tiling/TileCoverage.js";import c from"../../tiling/TileKey.js";const u=1e-6;function y(e,t){if(e){const s=e.getLayoutProperty("visibility");if(!s||1!==s.getValue()&&(void 0===e.minzoom||e.minzoom<t+u)&&(void 0===e.maxzoom||e.maxzoom>=t-u))return!0}return!1}class m extends n{constructor(e){super(e),this._backgroundTiles=[],this._techniques=new d,this._computeDisplayInfoView(e),this._techniques.startup()}destroy(){super.destroy(),this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,null!=this._symbolFader&&(this._symbolFader.clear(),this._symbolFader=null);const e=this.stage?.context;e&&this._techniques.shutdown(e),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(e,t,r,l){if(this._spriteMosaic=e,this._glyphMosaic=t,this._styleRepository=r,this.tilingScheme=l,this._computeDisplayInfoView(l),null==this._symbolFader){const e=(e,t)=>{e.allSymbolsFadingOut=!0,e.lastOpacityUpdate=t,o(e,t,!0),e.decluttered=!0,e.requestRender()};this._symbolFader=new i("vector-tile",this._styleRepository,e,this.children,s)}this._symbolFader.styleRepository=r}setSpriteMosaic(e){this._spriteMosaic?.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){null!=this._symbolFader&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic}}doRender(e){const{drawPhase:t}=e,s=1===t||64===t;this.visible&&s&&void 0!==this._spriteMosaic&&super.doRender(e)}addChild(e){return super.addChild(e),null!=this._symbolFader?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return null!=this._symbolFader&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:t}=e;64!==t?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;e<this.children.length;e++){const t=this.children[e];null!=this._symbolFader&&this._symbolFader.removeTile(t),t.dispose()}super.removeAllChildren()}getStencilTarget(){return this.children.filter(e=>e.neededForCoverage&&e.hasData())}restartDeclutter(){null!=this._symbolFader&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:t,painter:s,state:r}=e,i=this._styleRepository;if(!i)return;const o=i.layers,l=this._displayInfo.scaleToZoom(r.scale);this.children.forEach(e=>e.disposeLayerData()),super.renderChildren(e),i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds,l)),1===e.drawPhase&&this._fade(l,r);const n=this.children.filter(e=>e.visible&&e.hasData());if(n&&0!==n.length){for(const e of n)e.triangleCount=0;if(1===e.drawPhase)for(const e of n)e.fader.fade()<1&&this.requestRender();t.setClearDepth(1),t.clear(256),s.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}}),e.renderPass="translucent";for(let t=0;t<o.length;t++)this._renderStyleLayer(o[t],e,n);t.bindVAO(null),s.setPipelineState(a);for(const e of n)e.debugInfo.display.triangleCount=e.triangleCount}else t.bindVAO(null)}_fade(e,t){null!=this._symbolFader&&(this._symbolFader.update(e,t)||this.requestRender())}_renderStyleLayer(e,t,s){const{displayLevel:r,renderPass:i}=t;if(void 0===e)return;const o=e.getLayoutProperty("visibility");if(o&&1===o.getValue())return;switch(e.type){case 0:return;case 1:case 2:case 4:case 3:if("translucent"!==i)return}if(s=3===e.type?s.filter(e=>e.decluttered):s.filter(e=>e.neededForCoverage),3!==e.type&&(0===s.length||void 0!==e.minzoom&&e.minzoom>=r+u||void 0!==e.maxzoom&&e.maxzoom<r-u))return;const l=e.uid;t.styleLayerUID=l,t.styleLayer=e;const n=this._techniques.getTechnique(e.type);null!=n&&n.render(t,{tiles:s})}_renderBackgroundLayers(t,i,o){const{state:n}=t,a=this._styleRepository;let d=!1;for(const e of i){const t=a.getLayerById(e);if(t&&0===t.type&&y(a.getLayerById(e),o)){d=!0;break}}if(!d)return;const u=this.tilingScheme,m=u.getTileCoverage(t.state,0,!0,"smallest"),{spans:p,lodInfo:f}=m,{level:g}=f,_=e(),b=[],F=this._backgroundTiles;let R,v=0;for(const{row:h,colFrom:y,colTo:C}of p)for(let t=y;t<=C;t++){if(v<F.length)R=F[v],R.key.set(g,h,f.normalizeCol(t),f.getWorldForColumn(t)),u.getTileBounds(_,R.key,!1),R.x=_[0],R.y=_[3],R.resolution=u.getTileResolution(g);else{const i=new c(g,h,f.normalizeCol(t),f.getWorldForColumn(t)),o=u.getTileBounds(e(),i),n=u.getTileResolution(g);R=new l(i,n,o[0],o[3],r,r,s,s),F.push(R)}R.setTransform(n),b.push(R),v++}const T=this._techniques.getTechnique(0);for(const e of i){const s=a.getLayerById(e);0===s.type&&y(s,o)&&(t.styleLayerUID=s.uid,t.styleLayer=s,T.render(t,{tiles:b}))}h.pool.release(m)}_computeDisplayInfoView(e){let s=e.tileInfo.lods[0].scale;const i=Math.max(25,e.tileInfo.lods.length),o=[];for(let t=0;t<=i;t++)o.push(s),s/=2;this._displayInfo=t.create({scales:o,size:r,spatialReference:e.spatialReference,numLODs:i})}}export{m as VectorTileContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{simplePipelineState as e}from"../../utils.js";import{Technique as t}from"../Technique.js";import{VTLShaderCircle as s}from"../shaders/vector-tiles/VTLShaderCircle.js";class l extends t{constructor(){super(...arguments),this.type=39,this._mesh=null,this.shaders={circle:new s}}shutdown(){this._mesh&&(this._mesh.destroy(),this._mesh=null)}render(t,s){const{context:l,displayLevel:i,drawPhase:r,painter:n,requiredLevel:a,spriteMosaic:o,state:c,styleLayer:u,styleLayerUID:h}=t,{tiles:d}=s;if(!d.some(e=>e.layerData.get(h)?.circleIndexCount??!1))return;const p=u,{circleMaterial:f}=p,m=1.2,y=p.getPaintValue("circle-translate",i),M={transform:{dvsMat:null,displayMat:1===p.getPaintValue("circle-translate-anchor",i)?c.displayMat3:c.displayViewMat3},config:{circleTranslation:y,depth:p.z,antialiasingWidth:m,tileOpacity:1},radius:null,radiusMix:null,blur:null,blurMix:null,opacity:null,opacityMix:null,strokeOpacity:null,strokeOpacityMix:null,strokeWidth:null,strokeWidthMix:null,color:null,colorMix:null,strokeColor:null,strokeColorMix:null};let x=-1;for(const g of d){if(!g.layerData.has(h))continue;if(M.transform.dvsMat=g.transforms.displayViewScreenMat3,g.key.level!==x){x=g.key.level;const e=f.getUniforms();for(const t of e){const e=t.getValue(p,i,x,o);t.name in M&&(M[t.name]={value:e})}}const t=g.layerData.get(h);if(!t.circleIndexCount)continue;if(this._mesh=t.getMesh(l),!this._mesh)continue;const s=a!==g.key.level?514:516,c=a!==g.key.level?g.stencilRef:255;M.config.tileOpacity=1===r?g.fader.value():1,n.setPipelineState({...e,stencil:{write:!1,test:{compare:s,op:{fail:7680,zFail:7680,zPass:7681},mask:255}}});const u={shader:this.shaders.circle,uniforms:M,textures:null,defines:null,optionalAttributes:f.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:f.getPrecisionFactors()};n.submitDrawMeshUntyped(l,u,this._mesh,{stencilRef:c}),g.triangleCount+=t.circleIndexCount/3}}}export{l as VTLTechniqueCircle};
2
+ import{simplePipelineState as e}from"../../utils.js";import{Technique as t}from"../Technique.js";import{VTLShaderCircle as l}from"../shaders/vector-tiles/VTLShaderCircle.js";class s extends t{constructor(){super(...arguments),this.type=39,this._mesh=null,this.shaders={circle:new l}}shutdown(){this._mesh=null}render(t,l){const{context:s,displayLevel:i,drawPhase:r,painter:n,requiredLevel:a,spriteMosaic:o,state:c,styleLayer:u,styleLayerUID:d}=t,{tiles:h}=l;if(!h.some(e=>e.layerData.get(d)?.circleIndexCount??!1))return;const p=u,{circleMaterial:f}=p,y=1.2,m=p.getPaintValue("circle-translate",i),M={transform:{dvsMat:null,displayMat:1===p.getPaintValue("circle-translate-anchor",i)?c.displayMat3:c.displayViewMat3},config:{circleTranslation:m,depth:p.z,antialiasingWidth:y,tileOpacity:1},radius:null,radiusMix:null,blur:null,blurMix:null,opacity:null,opacityMix:null,strokeOpacity:null,strokeOpacityMix:null,strokeWidth:null,strokeWidthMix:null,color:null,colorMix:null,strokeColor:null,strokeColorMix:null};let x=-1;for(const g of h){if(!g.layerData.has(d))continue;if(M.transform.dvsMat=g.transforms.displayViewScreenMat3,g.key.level!==x){x=g.key.level;const e=f.getUniforms();for(const t of e){const e=t.getValue(p,i,x,o);t.name in M&&(M[t.name]={value:e})}}const t=g.layerData.get(d);if(!t.circleIndexCount||t.isDestroyed)continue;if(this._mesh=t.getMesh(s),!this._mesh)continue;const l=a!==g.key.level?514:516,c=a!==g.key.level?g.stencilRef:255;M.config.tileOpacity=1===r?g.fader.value():1,n.setPipelineState({...e,stencil:{write:!1,test:{compare:l,op:{fail:7680,zFail:7680,zPass:7681},mask:255}}});const u={shader:this.shaders.circle,uniforms:M,textures:null,defines:null,optionalAttributes:f.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:f.getPrecisionFactors()};n.submitDrawMeshUntyped(s,u,this._mesh,{stencilRef:c}),g.triangleCount+=t.circleIndexCount/3}}}export{s as VTLTechniqueCircle};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getDefinesKey as t}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as e,vtlHighResCutoff as i}from"../../../definitions.js";import{Technique as l}from"../Technique.js";import{VTLShaderFill as s}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as a}from"../shaders/vector-tiles/VTLShaderOutline.js";const n=1/65536;class o extends l{constructor(){super(...arguments),this.type=40,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new s,outline:new a}}shutdown(){this._fillMesh&&(this._fillMesh.destroy(),this._fillMesh=null),this._outlineMesh&&(this._outlineMesh.destroy(),this._outlineMesh=null)}render(t,e){const{displayLevel:i,is3D:l,renderPass:s,spriteMosaic:a,styleLayer:n,styleLayerUID:o}=t,{tiles:r}=e;let u=!1;for(const D of r)if(D.layerData.has(o)){const t=D.layerData.get(o);if(t.fillIndexCount>0||t.outlineIndexCount>0){u=!0;break}}if(!u)return;const c=n,f=c.getPaintProperty("fill-pattern"),p=void 0!==f,h=p&&f.isDataDriven;let d;if(p&&!h){const t=f.getValue(i);d=a.getMosaicItemPosition(t,!0)}const y=!p&&c.getPaintValue("fill-antialias",i);let M=!l||p,g=1;if(!p){const t=c.getPaintProperty("fill-color"),e=c.getPaintProperty("fill-opacity");if(!t?.isDataDriven&&!e?.isDataDriven){const t=c.getPaintValue("fill-color",i);g=c.getPaintValue("fill-opacity",i)*t[3],g<1&&(M=!0)}}if((c.hasDataDrivenColor||c.hasDataDrivenOpacity)&&(M=!0),M&&"opaque"===s)return;const m=c.getPaintValue("fill-translate",i),v=c.getPaintValue("fill-translate-anchor",i);("opaque"===s&&!M||"translucent"===s&&M)&&this._drawFill(t,o,c,r,m,v,p,d,h);const x=!c.hasDataDrivenOutlineColor&&c.outlineUsesFillColor&&g<1;y&&"translucent"===s&&!x&&this._drawOutline(t,o,c,r,m,v)}_drawFill(l,s,a,o,r,u,c,f,p){if(c&&!p&&null==f)return;const{context:h,displayLevel:d,drawPhase:y,state:M,painter:g,pixelRatio:m,spriteMosaic:v}=l,x=m>i?2:1,D=a.fillMaterial,P={transform:{dvsMat:null,displayMat:1===u?M.displayMat3:M.displayViewMat3},config:{depth:a.z+n,fillTranslation:r,tileOpacity:1},patternOptions:p||c&&null!=f?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0]}:null,color:null,opacity:null,colorMix:null,opacityMix:null},_={patternTexture:null},w=c?1:0,O=D.key+t({hasPattern:c});if(null!=f){const{page:t,tl:i,br:l}=f,s=i[0],a=l[1],n=l[0],o=i[1],r=v.getPageSize(t);null!=r&&(v.bind(h,9729,t,e),P.patternOptions={mosaicSize:[r[0],r[1]],patternFactor:1,tlbr:[s,a,n,o]},_.patternTexture={texture:v.getTexture(t),unit:e})}let V=-1;for(const t of o){if(!t.layerData.has(s))continue;if(t.key.level!==V){V=t.key.level;const e=D.getUniforms();for(const t of e){const e=t.getValue(a,d,V,v);P[t.name]={value:e}}if(c&&null!=P.patternOptions){const e=Math.max(2**(Math.round(d)-t.key.level),1),i=t.rangeX/(x*t.width*e);P.patternOptions.patternFactor=i}}const i=t.layerData.get(s);if(this._fillMesh=i.getMesh(h,{value:0}),!this._fillMesh)continue;const{transform:l,config:n}=P;l.dvsMat=t.transforms.displayViewScreenMat3,n.tileOpacity=1===y?t.fader.value():1;const o={shader:this.shaders.fill,uniforms:P,textures:_,defines:{fillType:w},optionalAttributes:D.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:D.getPrecisionFactors(),materialKey:O};if(p){const l=P.patternOptions,s=i.patternMap;if(!s||null==l)continue;let a=0;for(const[i,n]of s){const s=v.getPageSize(i);null!=s&&(v.bind(h,9729,i,e),l.mosaicSize=s,_.patternTexture={texture:v.getTexture(i),unit:e},g.submitDrawMeshUntyped(h,o,this._fillMesh,{stencilRef:t.stencilRef,parts:[a++]}))}}else g.submitDrawMeshUntyped(h,o,this._fillMesh,{stencilRef:t.stencilRef});t.triangleCount+=i.fillIndexCount/3}}_drawOutline(t,e,i,l,s,a){const{context:o,displayLevel:r,drawPhase:u,state:c,spriteMosaic:f,painter:p,pixelRatio:h}=t,d=i.outlineMaterial,y=d.key,M=.75/h,g={transform:{dvsMat3:null,displayMat3:1===a?c.displayMat3:c.displayViewMat3},config:{depth:i.z+n,fillTranslation:s,outlineWidth:M,tileOpacity:1},color:null,opacity:null,colorMix:null,opacityMix:null};let m=-1;for(const n of l){if(!n.layerData.has(e))continue;if(n.key.level!==m){m=n.key.level;const t=d.getUniforms();for(const e of t){const t=e.getValue(i,r,m,f);e.name in g&&(g[e.name]={value:t})}}const t=n.layerData.get(e);if(this._outlineMesh=t.getMesh(o,{value:1}),null==this._outlineMesh)continue;const{transform:l,config:s}=g;l.dvsMat3=n.transforms.displayViewScreenMat3,s.tileOpacity=1===u?n.fader.value():1;const a={shader:this.shaders.outline,uniforms:g,textures:{},defines:{},optionalAttributes:d.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:d.getPrecisionFactors(),materialKey:y};p.submitDrawMeshUntyped(o,a,this._outlineMesh,{stencilRef:n.stencilRef}),n.triangleCount+=t.outlineIndexCount/3}}}export{o as VTLTechniqueFill};
2
+ import{getDefinesKey as t}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as e,vtlHighResCutoff as i}from"../../../definitions.js";import{Technique as l}from"../Technique.js";import{VTLShaderFill as n}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as a}from"../shaders/vector-tiles/VTLShaderOutline.js";const s=1/65536;class o extends l{constructor(){super(...arguments),this.type=40,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new n,outline:new a}}shutdown(){this._fillMesh=null,this._outlineMesh=null}render(t,e){const{displayLevel:i,is3D:l,renderPass:n,spriteMosaic:a,styleLayer:s,styleLayerUID:o}=t,{tiles:r}=e;let u=!1;for(const D of r)if(D.layerData.has(o)){const t=D.layerData.get(o);if(t.fillIndexCount>0||t.outlineIndexCount>0){u=!0;break}}if(!u)return;const c=s,f=c.getPaintProperty("fill-pattern"),p=void 0!==f,d=p&&f.isDataDriven;let h;if(p&&!d){const t=f.getValue(i);h=a.getMosaicItemPosition(t,!0)}const y=!p&&c.getPaintValue("fill-antialias",i);let M=!l||p,g=1;if(!p){const t=c.getPaintProperty("fill-color"),e=c.getPaintProperty("fill-opacity");if(!t?.isDataDriven&&!e?.isDataDriven){const t=c.getPaintValue("fill-color",i);g=c.getPaintValue("fill-opacity",i)*t[3],g<1&&(M=!0)}}if((c.hasDataDrivenColor||c.hasDataDrivenOpacity)&&(M=!0),M&&"opaque"===n)return;const m=c.getPaintValue("fill-translate",i),v=c.getPaintValue("fill-translate-anchor",i);("opaque"===n&&!M||"translucent"===n&&M)&&this._drawFill(t,o,c,r,m,v,p,h,d);const x=!c.hasDataDrivenOutlineColor&&c.outlineUsesFillColor&&g<1;y&&"translucent"===n&&!x&&this._drawOutline(t,o,c,r,m,v)}_drawFill(l,n,a,o,r,u,c,f,p){if(c&&!p&&null==f)return;const{context:d,displayLevel:h,drawPhase:y,state:M,painter:g,pixelRatio:m,spriteMosaic:v}=l,x=m>i?2:1,D=a.fillMaterial,P={transform:{dvsMat:null,displayMat:1===u?M.displayMat3:M.displayViewMat3},config:{depth:a.z+s,fillTranslation:r,tileOpacity:1},patternOptions:p||c&&null!=f?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0]}:null,color:null,opacity:null,colorMix:null,opacityMix:null},w={patternTexture:null},_=c?1:0,O=D.key+t({hasPattern:c});if(null!=f){const{page:t,tl:i,br:l}=f,n=i[0],a=l[1],s=l[0],o=i[1],r=v.getPageSize(t);null!=r&&(v.bind(d,9729,t,e),P.patternOptions={mosaicSize:[r[0],r[1]],patternFactor:1,tlbr:[n,a,s,o]},w.patternTexture={texture:v.getTexture(t),unit:e})}let V=-1;for(const t of o){if(!t.layerData.has(n))continue;if(t.key.level!==V){V=t.key.level;const e=D.getUniforms();for(const t of e){const e=t.getValue(a,h,V,v);P[t.name]={value:e}}if(c&&null!=P.patternOptions){const e=Math.max(2**(Math.round(h)-t.key.level),1),i=t.rangeX/(x*t.width*e);P.patternOptions.patternFactor=i}}const i=t.layerData.get(n);if(i.isDestroyed||0===i.fillIndexCount)continue;if(this._fillMesh=i.getMesh(d,{value:0}),!this._fillMesh)continue;const{transform:l,config:s}=P;l.dvsMat=t.transforms.displayViewScreenMat3,s.tileOpacity=1===y?t.fader.value():1;const o={shader:this.shaders.fill,uniforms:P,textures:w,defines:{fillType:_},optionalAttributes:D.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:D.getPrecisionFactors(),materialKey:O};if(p){const l=P.patternOptions,n=i.patternMap;if(!n||null==l)continue;let a=0;for(const[i,s]of n){const n=v.getPageSize(i);null!=n&&(v.bind(d,9729,i,e),l.mosaicSize=n,w.patternTexture={texture:v.getTexture(i),unit:e},g.submitDrawMeshUntyped(d,o,this._fillMesh,{stencilRef:t.stencilRef,parts:[a++]}))}}else g.submitDrawMeshUntyped(d,o,this._fillMesh,{stencilRef:t.stencilRef});t.triangleCount+=i.fillIndexCount/3}}_drawOutline(t,e,i,l,n,a){const{context:o,displayLevel:r,drawPhase:u,state:c,spriteMosaic:f,painter:p,pixelRatio:d}=t,h=i.outlineMaterial,y=h.key,M=.75/d,g={transform:{dvsMat3:null,displayMat3:1===a?c.displayMat3:c.displayViewMat3},config:{depth:i.z+s,fillTranslation:n,outlineWidth:M,tileOpacity:1},color:null,opacity:null,colorMix:null,opacityMix:null};let m=-1;for(const s of l){if(!s.layerData.has(e))continue;if(s.key.level!==m){m=s.key.level;const t=h.getUniforms();for(const e of t){const t=e.getValue(i,r,m,f);e.name in g&&(g[e.name]={value:t})}}const t=s.layerData.get(e);if(t.isDestroyed||0===t.outlineIndexCount)continue;if(this._outlineMesh=t.getMesh(o,{value:1}),null==this._outlineMesh)continue;const{transform:l,config:n}=g;l.dvsMat3=s.transforms.displayViewScreenMat3,n.tileOpacity=1===u?s.fader.value():1;const a={shader:this.shaders.outline,uniforms:g,textures:{},defines:{},optionalAttributes:h.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:h.getPrecisionFactors(),materialKey:y};p.submitDrawMeshUntyped(o,a,this._outlineMesh,{stencilRef:s.stencilRef}),s.triangleCount+=t.outlineIndexCount/3}}}export{o as VTLTechniqueFill};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getDefinesKey as e}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as t}from"../../../definitions.js";import{Technique as i}from"../Technique.js";import{VTLShaderLine as s}from"../shaders/vector-tiles/VTLShaderLine.js";class n extends i{constructor(){super(...arguments),this.type=41,this._mesh=null,this.shaders={line:new s}}shutdown(){this._mesh&&(this._mesh.destroy(),this._mesh=null)}render(i,s){const{context:n,displayLevel:l,drawPhase:a,is3D:o,painter:r,pixelRatio:u,spriteMosaic:c,state:p,styleLayer:f,styleLayerUID:d}=i,{tiles:h}=s;if(!h.some(e=>e.layerData.get(d)?.lineIndexCount??!1))return;const m=f,y=m.lineMaterial,g=m.getPaintValue("line-translate",l),M=m.getPaintValue("line-translate-anchor",l),x=1/u,v={layerInfo:{displayViewMat3:p.displayViewMat3,displayMat3:1===M?p.displayMat3:p.displayViewMat3,lineTranslation:g,depth:m.z,antialiasing:x},tileInfo:{dvsMat3:null,zoomFactor:1,tileOpacity:1},page:null,color:null,width:null,opacity:null,blur:null,offset:null,colorMix:null,widthMix:null,opacityMix:null,blurMix:null,offsetMix:null,tlbr:null},w=m.getPaintProperty("line-pattern"),P=void 0!==w,D=P&&w.isDataDriven;let T,V;if(P&&!D){const e=w.getValue(l);T=c.getMosaicItemPosition(e)}let b=!1;if(!P){const e=m.getPaintProperty("line-dasharray");if(V=void 0!==e,b=V&&e.isDataDriven,V&&!b){const t=e.getValue(l),i=m.getDashKey(t,m.getLayoutValue("line-cap",l));if(T=c.getMosaicItemPosition(i),null==T)return}}const z=P?1:V?2:0,I=y.key+e({lineType:z}),_={pageTexture:null};if(null!=T){const{page:e}=T,i=c.getPageSize(e);if(null!=i){c.bind(n,9729,e,t);const s={mosaicSize:[i[0],i[1]]};_.pageTexture={texture:c.getTexture(e),unit:t},v.page=s}}o||r.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}});const{tileInfo:S}=v;let L=-1;for(const e of h){if(!e.layerData.has(d))continue;if(S.dvsMat3=e.transforms.displayViewScreenMat3,e.key.level!==L){L=e.key.level;const t=y.getUniforms();for(const e of t){const t=e.getValue(m,l,L,c);e.name in v&&(v[e.name]={value:t})}}const i=2**(l-L)/u;S.zoomFactor=i;const s=e.layerData.get(d);if(!s.lineIndexCount)continue;if(this._mesh=s.getMesh(n),!this._mesh)continue;S.tileOpacity=1===a?e.fader.value():1;const o={shader:this.shaders.line,uniforms:v,textures:_,defines:{lineType:z},optionalAttributes:y.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:y.getPrecisionFactors(),materialKey:I};if(D||b){const i=s.patternMap;if(!i)continue;let l=0;for(const s of i.keys()){const i=c.getPageSize(s);null!=i&&(c.bind(n,9729,s,t),v.page={mosaicSize:[i[0],i[1]]},_.pageTexture={texture:c.getTexture(s),unit:t},r.submitDrawMeshUntyped(n,o,this._mesh,{stencilRef:e.stencilRef,parts:[l++]}))}}else r.submitDrawMeshUntyped(n,o,this._mesh,{stencilRef:e.stencilRef});e.triangleCount+=s.lineIndexCount/3}}}export{n as VTLTechniqueLine};
2
+ import{getDefinesKey as e}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as t}from"../../../definitions.js";import{Technique as i}from"../Technique.js";import{VTLShaderLine as s}from"../shaders/vector-tiles/VTLShaderLine.js";class n extends i{constructor(){super(...arguments),this.type=41,this._mesh=null,this.shaders={line:new s}}shutdown(){this._mesh=null}render(i,s){const{context:n,displayLevel:l,drawPhase:a,is3D:o,painter:r,pixelRatio:u,spriteMosaic:c,state:p,styleLayer:f,styleLayerUID:d}=i,{tiles:h}=s;if(!h.some(e=>e.layerData.get(d)?.lineIndexCount??!1))return;const y=f,m=y.lineMaterial,g=y.getPaintValue("line-translate",l),M=y.getPaintValue("line-translate-anchor",l),x=1/u,v={layerInfo:{displayViewMat3:p.displayViewMat3,displayMat3:1===M?p.displayMat3:p.displayViewMat3,lineTranslation:g,depth:y.z,antialiasing:x},tileInfo:{dvsMat3:null,zoomFactor:1,tileOpacity:1},page:null,color:null,width:null,opacity:null,blur:null,offset:null,colorMix:null,widthMix:null,opacityMix:null,blurMix:null,offsetMix:null,tlbr:null},w=y.getPaintProperty("line-pattern"),P=void 0!==w,D=P&&w.isDataDriven;let T,V;if(P&&!D){const e=w.getValue(l);T=c.getMosaicItemPosition(e)}let b=!1;if(!P){const e=y.getPaintProperty("line-dasharray");if(V=void 0!==e,b=V&&e.isDataDriven,V&&!b){const t=e.getValue(l),i=y.getDashKey(t,y.getLayoutValue("line-cap",l));if(T=c.getMosaicItemPosition(i),null==T)return}}const z=P?1:V?2:0,I=m.key+e({lineType:z}),S={pageTexture:null};if(null!=T){const{page:e}=T,i=c.getPageSize(e);if(null!=i){c.bind(n,9729,e,t);const s={mosaicSize:[i[0],i[1]]};S.pageTexture={texture:c.getTexture(e),unit:t},v.page=s}}o||r.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:{write:!1,test:{compare:514,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}});const{tileInfo:L}=v;let U=-1;for(const e of h){if(!e.layerData.has(d))continue;if(L.dvsMat3=e.transforms.displayViewScreenMat3,e.key.level!==U){U=e.key.level;const t=m.getUniforms();for(const e of t){const t=e.getValue(y,l,U,c);e.name in v&&(v[e.name]={value:t})}}const i=2**(l-U)/u;L.zoomFactor=i;const s=e.layerData.get(d);if(!s.lineIndexCount||s.isDestroyed)continue;if(this._mesh=s.getMesh(n),!this._mesh)continue;L.tileOpacity=1===a?e.fader.value():1;const o={shader:this.shaders.line,uniforms:v,textures:S,defines:{lineType:z},optionalAttributes:m.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:m.getPrecisionFactors(),materialKey:I};if(D||b){const i=s.patternMap;if(!i)continue;let l=0;for(const s of i.keys()){const i=c.getPageSize(s);null!=i&&(c.bind(n,9729,s,t),v.page={mosaicSize:[i[0],i[1]]},S.pageTexture={texture:c.getTexture(s),unit:t},r.submitDrawMeshUntyped(n,o,this._mesh,{stencilRef:e.stencilRef,parts:[l++]}))}}else r.submitDrawMeshUntyped(n,o,this._mesh,{stencilRef:e.stencilRef});e.triangleCount+=s.lineIndexCount/3}}}export{n as VTLTechniqueLine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fadeDuration as e}from"../../../../vectorTiles/decluttering/config.js";import{getDefinesKey as t}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as i,vtlTextureBindingUnitGlyphs as a}from"../../../definitions.js";import{degToByte as l}from"../../../GeometryUtils.js";import{Technique as s}from"../Technique.js";import{VTLShaderIcon as n}from"../shaders/vector-tiles/VTLShaderIcon.js";import{VTLShaderText as o}from"../shaders/vector-tiles/VTLShaderText.js";const r=1/65536;class c extends s{constructor(){super(...arguments),this.type=42,this._iconMesh=null,this._textMesh=null,this.shaders={icon:new n,text:new o}}shutdown(){this._iconMesh&&(this._iconMesh.destroy(),this._iconMesh=null),this._textMesh&&(this._textMesh.destroy(),this._textMesh=null)}render(e,t){const{painter:i}=e,a=e.styleLayer,{tiles:l}=t,s=i.getPipelineState();this._setRenderState(e),this._drawIcons(e,a,l),this._drawText(e,a,l),i.setPipelineState(s)}_drawIcons(t,i,a){const{context:s,displayLevel:n,drawPhase:o,spriteMosaic:r,state:c,styleLayerUID:u}=t,h=i.iconMaterial;let p,g=!1;for(const e of a)if(e.layerData.has(u)&&(p=e.layerData.get(u),p.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const y=i.getPaintValue("icon-translate",n),d=i.getPaintValue("icon-translate-anchor",n);let f=i.getLayoutValue("icon-rotation-alignment",n);2===f&&(f=0===i.getLayoutValue("symbol-placement",n)?1:0);const m=0===f,M=i.getLayoutValue("icon-keep-upright",n)&&m,x=p.isIconSDF,P={transform:{dvsMat3:null,displayViewMat3:0===f?c.displayViewMat3:c.displayMat3,displayMat3:1===d?c.displayMat3:c.displayViewMat3,mapRotation:l(c.rotation)},config:{depth:i.z,iconTranslation:y,level:10*n,keepUpright:M?1:0,fadeDuration:e/1e3,isStencilPass:t.stencilSymbols?1:0,time:null,tileOpacity:1},page:{mosaicSize:null},color:null,opacity:null,haloBlur:null,haloColor:null,haloWidth:null,size:null,colorMix:null,opacityMix:null,haloBlurMix:null,haloColorMix:null,haloWidthMix:null,sizeMix:null};let v=-1;for(const e of a){if(!e.layerData.has(u))continue;if(e.key.level!==v){v=e.key.level;const t=h.getUniforms();for(const e of t){const t=e.getValue(i,n,v,r);P[e.name]={value:t}}}if(p=e.layerData.get(u),0===p.iconPerPageElementsMap.size)continue;if(this._iconMesh=p.getMesh(s,{value:0}),!this._iconMesh)continue;p.updateOpacityInfo(),P.transform.dvsMat3=e.transforms.displayViewScreenMat3,P.config.time=(performance.now()-p.lastOpacityUpdate)/1e3,P.config.tileOpacity=1===o?e.fader.value():1;let a=0;for(const[i,l]of p.iconPerPageElementsMap)this._renderIconRange(t,h,l,i,e,P,this._iconMesh,x,a++)}}_drawText(t,i,a){const{context:s,displayLevel:n,drawPhase:o,glyphMosaic:c,spriteMosaic:u,pixelRatio:h,state:p,styleLayerUID:g,requestRender:y,allowDelayedRender:d}=t,f=i.textMaterial;let m,M=!1;for(const e of a)if(e.layerData.has(g)&&(m=e.layerData.get(g),m.glyphPerPageElementsMap.size>0)){M=!0;break}if(!M)return;const x=i.getPaintProperty("text-opacity");if(x&&!x.isDataDriven&&0===x.getValue(n))return;const P=i.getPaintProperty("text-color"),v=P&&P.getValue(n),w=!P||P.isDataDriven||v&&4===v.length&&v[3]>0,D=i.getPaintProperty("text-halo-width"),_=i.getPaintProperty("text-halo-color"),V=_&&_.getValue(n),S=(!D||D.isDataDriven||D.getValue(n)>0)&&(!_||_.isDataDriven||V&&4===V.length&&V[3]>0);if(!w&&!S)return;const z=24/8;let T=i.getLayoutValue("text-rotation-alignment",n);2===T&&(T=0===i.getLayoutValue("symbol-placement",n)?1:0);const b=0===T,R=i.getLayoutValue("text-keep-upright",n)&&b,U=.8*z/h;this._glyphTextureSize||(this._glyphTextureSize=[c.width/4,c.height/4]);const k=i.getPaintValue("text-translate",n),L=i.getPaintValue("text-translate-anchor",n);if(d&&null!=y)return void y();const I={transform:{dvsMat3:null,displayViewMat3:0===T?p.displayViewMat3:p.displayMat3,displayMat3:1===L?p.displayMat3:p.displayViewMat3,mapRotation:l(p.rotation)},config:{depth:i.z+r,textTranslation:k,keepUpright:R?1:0,level:10*n,fadeDuration:e/1e3,antialiasingWidth:U,time:null,halo:null,isStencilPass:t.stencilSymbols?1:0,tileOpacity:1},page:{mosaicSize:null},size:null,color:null,haloColor:null,opacity:null,haloWidth:null,haloBlur:null,sizeMix:null,colorMix:null,haloColorMix:null,opacityMix:null,haloWidthMix:null,haloBlurMix:null};let C=-1;for(const e of a){if(!e.layerData.has(g))continue;if(e.key.level!==C){C=e.key.level;const t=f.getUniforms();for(const e of t){const t=e.getValue(i,n,C,u);e.name in I&&(I[e.name]={value:t})}}if(m=e.layerData.get(g),0===m.glyphPerPageElementsMap.size)continue;if(I.transform.dvsMat3=e.transforms.displayViewScreenMat3,I.config.time=(performance.now()-m.lastOpacityUpdate)/1e3,I.config.tileOpacity=1===o?e.fader.value():1,this._textMesh=m.getMesh(s,{value:1}),!this._textMesh)continue;m.updateOpacityInfo();let a=0;m.glyphPerPageElementsMap.forEach((i,l)=>{this._renderGlyphRange(t,i,l,S,w,e,I,f,this._textMesh,a++)})}}_renderIconRange(e,a,l,s,n,o,r,c,u){const{context:h,is3D:p,painter:g,spriteMosaic:y}=e,d={iconType:c?1:0},f=a.key+t(d);y.bind(h,9729,s,i),o.page={mosaicSize:[y.getWidth(s)/4,y.getHeight(s)/4]};const m={shader:this.shaders.icon,uniforms:o,textures:{pageTexture:{texture:y.getTexture(s),unit:i}},defines:d,optionalAttributes:a.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:a.getPrecisionFactors(),materialKey:f};g.submitDrawMeshUntyped(h,m,r,{stencilRef:p?n.stencilRef:255,parts:[u]}),n.triangleCount+=l[1]/3}_renderGlyphRange(e,t,i,l,s,n,o,r,c,u){const{context:h,is3D:p,painter:g,glyphMosaic:y}=e;y.bind(h,9729,i,a),o.page={mosaicSize:this._glyphTextureSize};const d={shader:this.shaders.text,uniforms:o,textures:{pageTexture:{texture:y.getTexture(h,i),unit:a}},defines:null,optionalAttributes:r.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:r.getPrecisionFactors(),materialKey:r.key};l&&(o.config.halo=1,g.submitDrawMeshUntyped(h,d,c,{stencilRef:p?n.stencilRef:255,parts:[u]}),n.triangleCount+=t[1]/3),s&&(o.config.halo=0,g.submitDrawMeshUntyped(h,d,c,{stencilRef:p?n.stencilRef:255,parts:[u]}),n.triangleCount+=t[1]/3)}_setRenderState(e){const{is3D:t,painter:i,stencilSymbols:a}=e;i.setPipelineState({color:{write:[!a,!a,!a,!a],blendMode:a?"none":"composite"},stencil:{write:!!a&&{mask:255},test:{compare:a?519:t?514:516,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}})}}export{c as VTLTechniqueSymbol};
2
+ import{fadeDuration as e}from"../../../../vectorTiles/decluttering/config.js";import{getDefinesKey as t}from"../../../../vectorTiles/shaders/vtlMaterialUtils.js";import{vtlTextureBindingUnitSprites as i,vtlTextureBindingUnitGlyphs as a}from"../../../definitions.js";import{degToByte as l}from"../../../GeometryUtils.js";import{Technique as n}from"../Technique.js";import{VTLShaderIcon as s}from"../shaders/vector-tiles/VTLShaderIcon.js";import{VTLShaderText as o}from"../shaders/vector-tiles/VTLShaderText.js";const r=1/65536;class c extends n{constructor(){super(...arguments),this.type=42,this._iconMesh=null,this._textMesh=null,this.shaders={icon:new s,text:new o}}shutdown(){this._iconMesh=null,this._textMesh=null}render(e,t){const{painter:i}=e,a=e.styleLayer,{tiles:l}=t,n=i.getPipelineState();this._setRenderState(e),this._drawIcons(e,a,l),this._drawText(e,a,l),i.setPipelineState(n)}_drawIcons(t,i,a){const{context:n,displayLevel:s,drawPhase:o,spriteMosaic:r,state:c,styleLayerUID:u}=t,p=i.iconMaterial;let h,g=!1;for(const e of a)if(e.layerData.has(u)&&(h=e.layerData.get(u),h.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const y=i.getPaintValue("icon-translate",s),d=i.getPaintValue("icon-translate-anchor",s);let f=i.getLayoutValue("icon-rotation-alignment",s);2===f&&(f=0===i.getLayoutValue("symbol-placement",s)?1:0);const m=0===f,M=i.getLayoutValue("icon-keep-upright",s)&&m,x=h.isIconSDF,P={transform:{dvsMat3:null,displayViewMat3:0===f?c.displayViewMat3:c.displayMat3,displayMat3:1===d?c.displayMat3:c.displayViewMat3,mapRotation:l(c.rotation)},config:{depth:i.z,iconTranslation:y,level:10*s,keepUpright:M?1:0,fadeDuration:e/1e3,isStencilPass:t.stencilSymbols?1:0,time:null,tileOpacity:1},page:{mosaicSize:null},color:null,opacity:null,haloBlur:null,haloColor:null,haloWidth:null,size:null,colorMix:null,opacityMix:null,haloBlurMix:null,haloColorMix:null,haloWidthMix:null,sizeMix:null};let D=-1;for(const e of a){if(!e.layerData.has(u))continue;if(e.key.level!==D){D=e.key.level;const t=p.getUniforms();for(const e of t){const t=e.getValue(i,s,D,r);P[e.name]={value:t}}}if(h=e.layerData.get(u),0===h.iconPerPageElementsMap.size||h.isDestroyed)continue;if(this._iconMesh=h.getMesh(n,{value:0}),!this._iconMesh)continue;h.updateOpacityInfo(),P.transform.dvsMat3=e.transforms.displayViewScreenMat3,P.config.time=(performance.now()-h.lastOpacityUpdate)/1e3,P.config.tileOpacity=1===o?e.fader.value():1;let a=0;for(const[i,l]of h.iconPerPageElementsMap)this._renderIconRange(t,p,l,i,e,P,this._iconMesh,x,a++)}}_drawText(t,i,a){const{context:n,displayLevel:s,drawPhase:o,glyphMosaic:c,spriteMosaic:u,pixelRatio:p,state:h,styleLayerUID:g,requestRender:y,allowDelayedRender:d}=t,f=i.textMaterial;let m,M=!1;for(const e of a)if(e.layerData.has(g)&&(m=e.layerData.get(g),m.glyphPerPageElementsMap.size>0)){M=!0;break}if(!M)return;const x=i.getPaintProperty("text-opacity");if(x&&!x.isDataDriven&&0===x.getValue(s))return;const P=i.getPaintProperty("text-color"),D=P&&P.getValue(s),v=!P||P.isDataDriven||D&&4===D.length&&D[3]>0,w=i.getPaintProperty("text-halo-width"),V=i.getPaintProperty("text-halo-color"),_=V&&V.getValue(s),S=(!w||w.isDataDriven||w.getValue(s)>0)&&(!V||V.isDataDriven||_&&4===_.length&&_[3]>0);if(!v&&!S)return;const z=24/8;let T=i.getLayoutValue("text-rotation-alignment",s);2===T&&(T=0===i.getLayoutValue("symbol-placement",s)?1:0);const b=0===T,R=i.getLayoutValue("text-keep-upright",s)&&b,U=.8*z/p;this._glyphTextureSize||(this._glyphTextureSize=[c.width/4,c.height/4]);const k=i.getPaintValue("text-translate",s),L=i.getPaintValue("text-translate-anchor",s);if(d&&null!=y)return void y();const I={transform:{dvsMat3:null,displayViewMat3:0===T?h.displayViewMat3:h.displayMat3,displayMat3:1===L?h.displayMat3:h.displayViewMat3,mapRotation:l(h.rotation)},config:{depth:i.z+r,textTranslation:k,keepUpright:R?1:0,level:10*s,fadeDuration:e/1e3,antialiasingWidth:U,time:null,halo:null,isStencilPass:t.stencilSymbols?1:0,tileOpacity:1},page:{mosaicSize:null},size:null,color:null,haloColor:null,opacity:null,haloWidth:null,haloBlur:null,sizeMix:null,colorMix:null,haloColorMix:null,opacityMix:null,haloWidthMix:null,haloBlurMix:null};let C=-1;for(const e of a){if(!e.layerData.has(g))continue;if(e.key.level!==C){C=e.key.level;const t=f.getUniforms();for(const e of t){const t=e.getValue(i,s,C,u);e.name in I&&(I[e.name]={value:t})}}if(m=e.layerData.get(g),0===m.glyphPerPageElementsMap.size||m.isDestroyed)continue;if(I.transform.dvsMat3=e.transforms.displayViewScreenMat3,I.config.time=(performance.now()-m.lastOpacityUpdate)/1e3,I.config.tileOpacity=1===o?e.fader.value():1,this._textMesh=m.getMesh(n,{value:1}),!this._textMesh)continue;m.updateOpacityInfo();let a=0;m.glyphPerPageElementsMap.forEach((i,l)=>{this._renderGlyphRange(t,i,l,S,v,e,I,f,this._textMesh,a++)})}}_renderIconRange(e,a,l,n,s,o,r,c,u){const{context:p,is3D:h,painter:g,spriteMosaic:y}=e,d={iconType:c?1:0},f=a.key+t(d);y.bind(p,9729,n,i),o.page={mosaicSize:[y.getWidth(n)/4,y.getHeight(n)/4]};const m={shader:this.shaders.icon,uniforms:o,textures:{pageTexture:{texture:y.getTexture(n),unit:i}},defines:d,optionalAttributes:a.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:a.getPrecisionFactors(),materialKey:f};g.submitDrawMeshUntyped(p,m,r,{stencilRef:h?s.stencilRef:255,parts:[u]}),s.triangleCount+=l[1]/3}_renderGlyphRange(e,t,i,l,n,s,o,r,c,u){const{context:p,is3D:h,painter:g,glyphMosaic:y}=e;y.bind(p,9729,i,a),o.page={mosaicSize:this._glyphTextureSize};const d={shader:this.shaders.text,uniforms:o,textures:{pageTexture:{texture:y.getTexture(p,i),unit:a}},defines:null,optionalAttributes:r.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:r.getPrecisionFactors(),materialKey:r.key};l&&(o.config.halo=1,g.submitDrawMeshUntyped(p,d,c,{stencilRef:h?s.stencilRef:255,parts:[u]}),s.triangleCount+=t[1]/3),n&&(o.config.halo=0,g.submitDrawMeshUntyped(p,d,c,{stencilRef:h?s.stencilRef:255,parts:[u]}),s.triangleCount+=t[1]/3)}_setRenderState(e){const{is3D:t,painter:i,stencilSymbols:a}=e;i.setPipelineState({color:{write:[!a,!a,!a,!a],blendMode:a?"none":"composite"},stencil:{write:!!a&&{mask:255},test:{compare:a?519:t?514:516,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}})}}export{c as VTLTechniqueSymbol};