@arcgis/core 5.1.0-next.47 → 5.1.0-next.49

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 (133) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{521a671182b0f79e3624.js → 193775b3b7de8f5dc578.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{c0ecb68387e342dddf58.js → 25509953f19fbc4949a1.js} +1 -1
  4. package/assets/esri/core/workers/chunks/2669a7195f1de21a9cf3.js +1 -0
  5. package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +1 -0
  6. package/assets/esri/core/workers/chunks/36425d29aaa5852cb41d.js +1 -0
  7. package/assets/esri/core/workers/chunks/440a650ed0867a16f559.js +1 -0
  8. package/assets/esri/core/workers/chunks/{aa367ca7f8326fd67881.js → 4afddb66242438b38df0.js} +1 -1
  9. package/assets/esri/core/workers/chunks/5344919fc6e8050450f1.js +1 -0
  10. package/assets/esri/core/workers/chunks/53c149bca42595b7dd1e.js +1 -0
  11. package/assets/esri/core/workers/chunks/{6afdaa6c4555c467dca7.js → 54420b66fd53d6e19ba5.js} +1 -1
  12. package/assets/esri/core/workers/chunks/74814678942a47fd48fb.js +1 -0
  13. package/assets/esri/core/workers/chunks/797bf402489b3677a5f7.js +1 -0
  14. package/assets/esri/core/workers/chunks/{5c830cce32710d70dfa6.js → 7dba4121cdd20dbc4b20.js} +1 -1
  15. package/assets/esri/core/workers/chunks/947a715b608c8affd812.js +1 -0
  16. package/assets/esri/core/workers/chunks/{867c0cd99a005a3d8e08.js → 9f7b5749f3ceca8d5978.js} +12 -9
  17. package/assets/esri/core/workers/chunks/aa69cbaa38b49677ddff.js +1 -0
  18. package/assets/esri/core/workers/chunks/{beb53b372d356800f333.js → ab414a60808ea05a63e6.js} +1 -1
  19. package/assets/esri/core/workers/chunks/b98dd9fc9a7e3ff6bd49.js +1 -0
  20. package/assets/esri/core/workers/chunks/cb8c17daec7055bf99cc.js +1 -0
  21. package/assets/esri/core/workers/chunks/{a9f35127c3f5bf42036b.js → de359f89e03da18999fc.js} +1 -1
  22. package/chunks/Fog.glsl.js +3 -3
  23. package/chunks/GlowComposition.glsl.js +5 -3
  24. package/config.js +1 -1
  25. package/core/has.js +1 -1
  26. package/core/workers/Connection.js +1 -1
  27. package/core/workers/WorkerHandle.js +1 -1
  28. package/core/workers/workers.js +1 -1
  29. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  30. package/kernel.js +1 -1
  31. package/layers/Lyr3DWorkerHandle.js +1 -1
  32. package/layers/OrientedImageryLayer.d.ts +152 -0
  33. package/layers/graphics/data/QueryEngineResult.js +1 -1
  34. package/layers/mixins/ArcGISCachedService.js +1 -1
  35. package/layers/mixins/ArcGISMapService.js +1 -1
  36. package/layers/support/RasterJobHandler.js +1 -1
  37. package/layers/support/layerUtils.js +1 -1
  38. package/package.json +1 -1
  39. package/smartMapping/statistics/support/statsWorker.js +1 -1
  40. package/support/revision.js +1 -1
  41. package/time/TimeExtent.d.ts +34 -0
  42. package/time/TimeInterval.d.ts +15 -0
  43. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  44. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  45. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  46. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  47. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  48. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  49. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +1 -1
  50. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
  51. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
  52. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
  53. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
  54. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
  55. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
  56. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
  57. package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
  58. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  59. package/views/2d/engine/webgl/util/Fader.js +2 -0
  60. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  61. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  62. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  63. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  64. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  65. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  66. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  67. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  68. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  69. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  70. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  71. package/views/3d/layers/FlowSubView3D.js +1 -1
  72. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  73. package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
  74. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  75. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  76. package/views/3d/layers/i3s/Intersector.js +1 -1
  77. package/views/3d/layers/support/patternUtils.js +1 -1
  78. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  79. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  80. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  81. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  82. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  83. package/views/3d/terrain/TerrainRenderer.js +1 -1
  84. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  85. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  86. package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
  87. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  88. package/views/3d/webgl-engine/effects/fog/FogTechniqueConfiguration.js +1 -1
  89. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  90. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  91. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  92. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  93. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  94. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  95. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  96. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  97. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  98. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  99. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  100. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  101. package/views/3d/webgl-engine/materials/PolygonOffset.js +2 -0
  102. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  103. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  104. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  105. package/views/3d/webgl-engine/materials/TriangleTechniqueConfiguration.js +1 -1
  106. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  107. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  108. package/views/3d/webgl-engine/shaders/Dithering.glsl.js +4 -0
  109. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  110. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +11 -10
  111. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  112. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  113. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  114. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  115. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
  116. package/views/SceneView.d.ts +2 -1
  117. package/views/SceneView.js +1 -1
  118. package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
  119. package/views/support/LayerViewManager.js +1 -1
  120. package/views/types.d.ts +33 -2
  121. package/widgets/Sketch/support/PluginManager.js +1 -1
  122. package/assets/esri/core/workers/chunks/0601c316da0256a60538.js +0 -1
  123. package/assets/esri/core/workers/chunks/13d55e3c9aea04116eaa.js +0 -1
  124. package/assets/esri/core/workers/chunks/1a6a77902dd8c84e059a.js +0 -1
  125. package/assets/esri/core/workers/chunks/54c1d31e1efab765ee7a.js +0 -1
  126. package/assets/esri/core/workers/chunks/5b515b5741733bcb4645.js +0 -1
  127. package/assets/esri/core/workers/chunks/7f07f490c6fcc794c8d9.js +0 -1
  128. package/assets/esri/core/workers/chunks/970d971551e42f7ae08d.js +0 -1
  129. package/assets/esri/core/workers/chunks/abcb39ad1e2d54710766.js +0 -1
  130. package/assets/esri/core/workers/chunks/c2aa3b1344b42a904234.js +0 -1
  131. package/assets/esri/core/workers/chunks/cf5e4cf9b1aa37eeb6b0.js +0 -1
  132. package/assets/esri/core/workers/chunks/e63046a9567d84228644.js +0 -1
  133. package/assets/esri/core/workers/chunks/f4ec2dcdc4bbf7dbcc94.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as r,uniform as p,option as l,define as s,input as n,VertexInput as a,UniformGroup as y,FragmentInput as c}from"../../../GraphShaderModule.js";import{Vec2 as d,Float as v,Mat3 as u,negate as x,Vec3 as h,Vec4 as w,fract as f,mix as m,texture2D as g,pow as T,ceil as M,log2 as b,abs as C,Sampler2D as O}from"../../../graph/glsl.js";class z extends a{}t([r(0,d)],z.prototype,"position",void 0),t([r(1,w)],z.prototype,"color",void 0),t([r(2,v)],z.prototype,"opacity",void 0),t([r(3,w)],z.prototype,"tlbr",void 0),t([r(4,w)],z.prototype,"colorTo",void 0),t([r(5,v)],z.prototype,"opacityTo",void 0);class S extends c{}class F extends y{}t([p(u)],F.prototype,"dvsMat",void 0),t([p(u)],F.prototype,"displayMat",void 0);class L extends y{}t([p(v)],L.prototype,"depth",void 0),t([p(d)],L.prototype,"fillTranslation",void 0);class j extends y{}t([p(d)],j.prototype,"mosaicSize",void 0),t([p(v)],j.prototype,"patternFactor",void 0),t([p(w)],j.prototype,"tlbr",void 0),t([p(O)],j.prototype,"texture",void 0);class B extends y{}t([p(v)],B.prototype,"value",void 0);class R extends y{}t([p(v)],R.prototype,"value",void 0);class G extends y{}t([p(w)],G.prototype,"value",void 0);class P extends y{}t([p(v)],P.prototype,"value",void 0);class V extends e{constructor(){super(...arguments),this.type="VTLShaderFill"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t));let e=new d(0),i=this.getTLBR(t);if(1===this.fillType){const{mosaicSize:o,patternFactor:r}=this.patternOptions,p=k(i.z.subtract(i.x)),l=k(i.w.subtract(i.y)),s=new v(1).divide(p.multiply(r)),n=new v(1).divide(l.multiply(r));e=new u(s,new v(0),new v(0),new v(0),x(n),new v(0),new v(0),new v(0),new v(1)).multiply(new h(t.position,new v(1))).xy,i=i.divide(o.xyxy)}const r=this.transform.dvsMat.multiply(new h(t.position,1)).add(this.transform.displayMat.multiply(new h(this.config.fillTranslation,0)));return{glPosition:new w(r.xy,this.config.depth,1),color:o,tlbr:i,tileTextureCoord:e}}fragment(t){const o=new i;if(1===this.fillType){const{tlbr:e,tileTextureCoord:i}=t,{texture:r}=this.patternOptions,p=f(i),l=m(e.xy,e.zw,p),s=g(r,l);o.fragColor=t.color.a.multiply(s)}else o.fragColor=t.color;return o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?m(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new w(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?m(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getTLBR(t){return t.tlbr?t.tlbr:this.patternOptions?.tlbr||new w(0)}}function k(t){return T(new v(2),M(b(C(t))))}t([p(F)],V.prototype,"transform",void 0),t([p(L)],V.prototype,"config",void 0),t([l(j)],V.prototype,"patternOptions",void 0),t([l(B)],V.prototype,"opacity",void 0),t([l(R)],V.prototype,"opacityMix",void 0),t([l(G)],V.prototype,"color",void 0),t([l(P)],V.prototype,"colorMix",void 0),t([s],V.prototype,"fillType",void 0),t([o(0,n(z))],V.prototype,"vertex",null),t([o(0,n(S))],V.prototype,"fragment",null);export{V as VTLShaderFill};
2
+ import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as r,uniform as p,option as l,define as s,input as a,VertexInput as n,UniformGroup as y,FragmentInput as c}from"../../../GraphShaderModule.js";import{Vec2 as d,Float as v,Mat3 as u,negate as x,Vec3 as h,Vec4 as f,fract as w,mix as m,texture2D as g,pow as T,ceil as M,log2 as b,abs as C,Sampler2D as O}from"../../../graph/glsl.js";class z extends n{}t([r(0,d)],z.prototype,"position",void 0),t([r(1,f)],z.prototype,"color",void 0),t([r(2,v)],z.prototype,"opacity",void 0),t([r(3,f)],z.prototype,"tlbr",void 0),t([r(4,f)],z.prototype,"colorTo",void 0),t([r(5,v)],z.prototype,"opacityTo",void 0);class S extends c{}class F extends y{}t([p(u)],F.prototype,"dvsMat",void 0),t([p(u)],F.prototype,"displayMat",void 0);class L extends y{}t([p(v)],L.prototype,"depth",void 0),t([p(d)],L.prototype,"fillTranslation",void 0),t([p(v)],L.prototype,"tileOpacity",void 0);class j extends y{}t([p(d)],j.prototype,"mosaicSize",void 0),t([p(v)],j.prototype,"patternFactor",void 0),t([p(f)],j.prototype,"tlbr",void 0),t([p(O)],j.prototype,"texture",void 0);class B extends y{}t([p(v)],B.prototype,"value",void 0);class R extends y{}t([p(v)],R.prototype,"value",void 0);class G extends y{}t([p(f)],G.prototype,"value",void 0);class P extends y{}t([p(v)],P.prototype,"value",void 0);class V extends e{constructor(){super(...arguments),this.type="VTLShaderFill"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t));let e=new d(0),i=this.getTLBR(t);if(1===this.fillType){const{mosaicSize:o,patternFactor:r}=this.patternOptions,p=k(i.z.subtract(i.x)),l=k(i.w.subtract(i.y)),s=new v(1).divide(p.multiply(r)),a=new v(1).divide(l.multiply(r));e=new u(s,new v(0),new v(0),new v(0),x(a),new v(0),new v(0),new v(0),new v(1)).multiply(new h(t.position,new v(1))).xy,i=i.divide(o.xyxy)}const r=this.transform.dvsMat.multiply(new h(t.position,1)).add(this.transform.displayMat.multiply(new h(this.config.fillTranslation,0)));return{glPosition:new f(r.xy,this.config.depth,1),color:o,tlbr:i,tileTextureCoord:e}}fragment(t){const o=new i;if(1===this.fillType){const{tlbr:e,tileTextureCoord:i}=t,{texture:r}=this.patternOptions,p=w(i),l=m(e.xy,e.zw,p),s=g(r,l);o.fragColor=t.color.a.multiply(s)}else o.fragColor=t.color;return o.fragColor=this.config.tileOpacity.multiply(o.fragColor),o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?m(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new f(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?m(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getTLBR(t){return t.tlbr?t.tlbr:this.patternOptions?.tlbr||new f(0)}}function k(t){return T(new v(2),M(b(C(t))))}t([p(F)],V.prototype,"transform",void 0),t([p(L)],V.prototype,"config",void 0),t([l(j)],V.prototype,"patternOptions",void 0),t([l(B)],V.prototype,"opacity",void 0),t([l(R)],V.prototype,"opacityMix",void 0),t([l(G)],V.prototype,"color",void 0),t([l(P)],V.prototype,"colorMix",void 0),t([s],V.prototype,"fillType",void 0),t([o(0,a(z))],V.prototype,"vertex",null),t([o(0,a(S))],V.prototype,"fragment",null);export{V as VTLShaderFill};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o,__param as t}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,option as r,define as a,input as s,VertexInput as d,UniformGroup as n,FragmentInput as y}from"../../../GraphShaderModule.js";import{mod as c,Float as v,unpackVec4 as h,clamp as u,step as w,abs as x,Vec3 as m,Vec4 as g,texture2D as f,max as T,ifElse as C,greaterThan as M,and as z,lessThan as W,equal as b,min as S,mix as O,Mat3 as I,Vec2 as B,Sampler2D as H}from"../../../graph/glsl.js";import{oneMinus as j,rgba2float as P}from"../utils.js";const V=new v(1/8),k=new v(120/86),A=new v(1/255.5),D=new v(16/86),R=new v(.248062016);class U extends d{}o([l(0,g)],U.prototype,"positionAndOffset",void 0),o([l(1,g)],U.prototype,"iconInfo",void 0),o([l(2,g)],U.prototype,"color",void 0),o([l(3,v)],U.prototype,"opacity",void 0),o([l(4,g)],U.prototype,"haloColor",void 0),o([l(5,v)],U.prototype,"haloWidth",void 0),o([l(6,v)],U.prototype,"haloBlur",void 0),o([l(7,v)],U.prototype,"size",void 0),o([l(8,g)],U.prototype,"colorTo",void 0),o([l(9,v)],U.prototype,"opacityTo",void 0),o([l(10,g)],U.prototype,"haloColorTo",void 0),o([l(11,v)],U.prototype,"haloWidthTo",void 0),o([l(12,v)],U.prototype,"haloBlurTo",void 0),o([l(13,v)],U.prototype,"sizeTo",void 0),o([l(14,v)],U.prototype,"opacityInfo",void 0);class G extends y{}class L extends n{}o([p(I)],L.prototype,"dvsMat3",void 0),o([p(I)],L.prototype,"displayMat3",void 0),o([p(I)],L.prototype,"displayViewMat3",void 0),o([p(v)],L.prototype,"mapRotation",void 0);class q extends n{}o([p(B)],q.prototype,"mosaicSize",void 0),o([p(H)],q.prototype,"texture",void 0);class E extends n{}o([p(B)],E.prototype,"iconTranslation",void 0),o([p(v)],E.prototype,"depth",void 0),o([p(v)],E.prototype,"level",void 0),o([p(v)],E.prototype,"keepUpright",void 0),o([p(v)],E.prototype,"fadeDuration",void 0),o([p(v)],E.prototype,"time",void 0),o([p(v)],E.prototype,"isStencilPass",void 0);class F extends n{}o([p(v)],F.prototype,"value",void 0);class J extends n{}o([p(v)],J.prototype,"value",void 0);class K extends n{}o([p(v)],K.prototype,"value",void 0);class N extends n{}o([p(v)],N.prototype,"value",void 0);class Q extends n{}o([p(g)],Q.prototype,"value",void 0);class X extends n{}o([p(v)],X.prototype,"value",void 0);class Y extends n{}o([p(g)],Y.prototype,"value",void 0);class Z extends n{}o([p(v)],Z.prototype,"value",void 0);class $ extends n{}o([p(v)],$.prototype,"value",void 0);class _ extends n{}o([p(v)],_.prototype,"value",void 0);class oo extends e{constructor(){super(...arguments),this.type="VTLShaderIcon",this.iconType=0}vertex(o){const t=this.getSize(o),e=this.getColor(o),i=this.getHaloColor(o),l=this.getHaloWidth(o);let p=this.getOpacity(o);const{iconInfo:r,opacityInfo:a,positionAndOffset:s}=o,{mapRotation:d,displayMat3:n,displayViewMat3:y,dvsMat3:f}=this.transform,{depth:T,fadeDuration:C,iconTranslation:M,keepUpright:z,level:W,time:b}=this.config,{mosaicSize:S}=this.page,O=c(a,new v(128)),I=a.subtract(O).divide(new v(128)),B=O.divide(new v(127)),[H,P]=h(r,8),A=u(B.add(new v(2).multiply(I.subtract(new v(.5)).multiply(b.divide(C)))),new v(0),new v(1));p=p.multiply(A);const D=P[1],R=P[2],U=P[3],G=H.xy.divide(S);let L=new v(0);const q=c(D.add(d),new v(256));L=L.add(new v(1).subtract(w(z,new v(0))).multiply(w(new v(64),q).multiply(j(w(new v(192),q))))),L=L.add(j(w(R,W))),L=L.add(w(U,W)),L=L.add(w(p,new v(0)));let E=V.multiply(s.zw);const F=x(E);1===this.iconType&&(E=E.multiply(k));const J=f.multiply(new m(s.xy,new v(1))).add(y.multiply(new m(t.multiply(E),0))).add(n.multiply(new m(M,0)));return{glPosition:new g(J.xy,T.add(L),new v(1)),color:e,opacity:p,haloWidth:l,haloColor:i,size:F,tex:G}}fragment(o){const t=new i,{color:e,tex:l,opacity:p,size:r,haloWidth:a,haloColor:s}=o,{texture:d}=this.page,{isStencilPass:n}=this.config;if(1===this.iconType){let o=e;const i=P(f(d,l)).subtract(new v(.5)).multiply(R).multiply(T(r.x,r.y));o=o.multiply(u(new v(.5).subtract(i),new v(0),new v(1))),t.fragColor=C(M(a,new v(.25)),this.getColorWithOutline(i,r,a,o,s,p),o.multiply(p))}else{const o=f(d,l);z(b(n,new v(1)),W(o.a,A)),t.discard=z(b(n,new v(1)),W(o.a,A)),t.fragColor=o.multiply(p)}return t}getColorWithOutline(o,t,e,i,l,p){const r=R.multiply(S(e,D.multiply(T(t.x,t.y))));let a=l;return a=a.multiply(u(new v(.5).subtract(x(o).subtract(r)),new v(0),new v(1))),p.multiply(to(i,a))}getSize(o){return this.sizeMix?.value&&o.size&&o.sizeTo?O(o.size,o.sizeTo,this.sizeMix.value):o.size?o.size:this.size?.value||new v(0)}getColor(o){return this.colorMix?.value&&o.color&&o.colorTo?O(o.color,o.colorTo,this.colorMix.value):o.color?o.color:this.color?.value||new g(0)}getOpacity(o){return this.opacityMix?.value&&o.opacity&&o.opacityTo?O(o.opacity,o.opacityTo,this.opacityMix.value):o.opacity?o.opacity:this.opacity?.value||new v(1)}getHaloColor(o){return this.haloColorMix?.value&&o.haloColor&&o.haloColorTo?O(o.haloColor,o.haloColorTo,this.haloColorMix.value):o.haloColor?o.haloColor:this.haloColor?.value||new g(1)}getHaloWidth(o){if(1===this.iconType){if(this.opacityMix?.value&&o.haloWidth&&o.haloWidthTo)return O(o.haloWidth,o.haloWidthTo,this.opacityMix.value);if(o.haloWidth)return o.haloWidth}return new v(0)}}function to(o,t){const e=t.a.add(o.a.multiply(j(t.a))),i=t.rgb.add(o.rgb.multiply(j(t.a)));return new g(i,e)}o([p(L)],oo.prototype,"transform",void 0),o([p(q)],oo.prototype,"page",void 0),o([p(E)],oo.prototype,"config",void 0),o([r(F)],oo.prototype,"size",void 0),o([r(J)],oo.prototype,"sizeMix",void 0),o([r(K)],oo.prototype,"opacity",void 0),o([r(N)],oo.prototype,"opacityMix",void 0),o([r(Q)],oo.prototype,"color",void 0),o([r(X)],oo.prototype,"colorMix",void 0),o([r(Y)],oo.prototype,"haloColor",void 0),o([r(Z)],oo.prototype,"haloColorMix",void 0),o([r($)],oo.prototype,"haloBlur",void 0),o([r(_)],oo.prototype,"haloBlurMix",void 0),o([a],oo.prototype,"iconType",void 0),o([t(0,s(U))],oo.prototype,"vertex",null),o([t(0,s(G))],oo.prototype,"fragment",null);export{oo as VTLShaderIcon};
2
+ import{__decorate as o,__param as t}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,option as r,define as a,input as s,VertexInput as d,UniformGroup as n,FragmentInput as y}from"../../../GraphShaderModule.js";import{mod as c,Float as v,unpackVec4 as u,clamp as h,step as w,abs as x,Vec3 as m,Vec4 as g,texture2D as f,max as T,ifElse as C,greaterThan as M,and as z,lessThan as W,equal as b,min as O,mix as S,Mat3 as I,Vec2 as B,Sampler2D as H}from"../../../graph/glsl.js";import{oneMinus as j,rgba2float as P}from"../utils.js";const V=new v(1/8),k=new v(120/86),A=new v(1/255.5),D=new v(16/86),R=new v(.248062016);class U extends d{}o([l(0,g)],U.prototype,"positionAndOffset",void 0),o([l(1,g)],U.prototype,"iconInfo",void 0),o([l(2,g)],U.prototype,"color",void 0),o([l(3,v)],U.prototype,"opacity",void 0),o([l(4,g)],U.prototype,"haloColor",void 0),o([l(5,v)],U.prototype,"haloWidth",void 0),o([l(6,v)],U.prototype,"haloBlur",void 0),o([l(7,v)],U.prototype,"size",void 0),o([l(8,g)],U.prototype,"colorTo",void 0),o([l(9,v)],U.prototype,"opacityTo",void 0),o([l(10,g)],U.prototype,"haloColorTo",void 0),o([l(11,v)],U.prototype,"haloWidthTo",void 0),o([l(12,v)],U.prototype,"haloBlurTo",void 0),o([l(13,v)],U.prototype,"sizeTo",void 0),o([l(14,v)],U.prototype,"opacityInfo",void 0);class G extends y{}class L extends n{}o([p(I)],L.prototype,"dvsMat3",void 0),o([p(I)],L.prototype,"displayMat3",void 0),o([p(I)],L.prototype,"displayViewMat3",void 0),o([p(v)],L.prototype,"mapRotation",void 0);class q extends n{}o([p(B)],q.prototype,"mosaicSize",void 0),o([p(H)],q.prototype,"texture",void 0);class E extends n{}o([p(B)],E.prototype,"iconTranslation",void 0),o([p(v)],E.prototype,"depth",void 0),o([p(v)],E.prototype,"level",void 0),o([p(v)],E.prototype,"keepUpright",void 0),o([p(v)],E.prototype,"fadeDuration",void 0),o([p(v)],E.prototype,"time",void 0),o([p(v)],E.prototype,"isStencilPass",void 0),o([p(v)],E.prototype,"tileOpacity",void 0);class F extends n{}o([p(v)],F.prototype,"value",void 0);class J extends n{}o([p(v)],J.prototype,"value",void 0);class K extends n{}o([p(v)],K.prototype,"value",void 0);class N extends n{}o([p(v)],N.prototype,"value",void 0);class Q extends n{}o([p(g)],Q.prototype,"value",void 0);class X extends n{}o([p(v)],X.prototype,"value",void 0);class Y extends n{}o([p(g)],Y.prototype,"value",void 0);class Z extends n{}o([p(v)],Z.prototype,"value",void 0);class $ extends n{}o([p(v)],$.prototype,"value",void 0);class _ extends n{}o([p(v)],_.prototype,"value",void 0);class oo extends e{constructor(){super(...arguments),this.type="VTLShaderIcon",this.iconType=0}vertex(o){const t=this.getSize(o),e=this.getColor(o),i=this.getHaloColor(o),l=this.getHaloWidth(o);let p=this.getOpacity(o);const{iconInfo:r,opacityInfo:a,positionAndOffset:s}=o,{mapRotation:d,displayMat3:n,displayViewMat3:y,dvsMat3:f}=this.transform,{depth:T,fadeDuration:C,iconTranslation:M,keepUpright:z,level:W,time:b}=this.config,{mosaicSize:O}=this.page,S=c(a,new v(128)),I=a.subtract(S).divide(new v(128)),B=S.divide(new v(127)),[H,P]=u(r,8),A=h(B.add(new v(2).multiply(I.subtract(new v(.5)).multiply(b.divide(C)))),new v(0),new v(1));p=p.multiply(A);const D=P[1],R=P[2],U=P[3],G=H.xy.divide(O);let L=new v(0);const q=c(D.add(d),new v(256));L=L.add(new v(1).subtract(w(z,new v(0))).multiply(w(new v(64),q).multiply(j(w(new v(192),q))))),L=L.add(j(w(R,W))),L=L.add(w(U,W)),L=L.add(w(p,new v(0)));let E=V.multiply(s.zw);const F=x(E);1===this.iconType&&(E=E.multiply(k));const J=f.multiply(new m(s.xy,new v(1))).add(y.multiply(new m(t.multiply(E),0))).add(n.multiply(new m(M,0)));return{glPosition:new g(J.xy,T.add(L),new v(1)),color:e,opacity:p,haloWidth:l,haloColor:i,size:F,tex:G}}fragment(o){const t=new i,{color:e,tex:l,opacity:p,size:r,haloWidth:a,haloColor:s}=o,{texture:d}=this.page,{isStencilPass:n,tileOpacity:y}=this.config;if(1===this.iconType){let o=e;const i=P(f(d,l)).subtract(new v(.5)).multiply(R).multiply(T(r.x,r.y));o=o.multiply(h(new v(.5).subtract(i),new v(0),new v(1))),t.fragColor=C(M(a,new v(.25)),this.getColorWithOutline(i,r,a,o,s,p),o.multiply(p)).multiply(y)}else{const o=f(d,l);z(b(n,new v(1)),W(o.a,A)),t.discard=z(b(n,new v(1)),W(o.a,A)),t.fragColor=o.multiply(p).multiply(y)}return t}getColorWithOutline(o,t,e,i,l,p){const r=R.multiply(O(e,D.multiply(T(t.x,t.y))));let a=l;return a=a.multiply(h(new v(.5).subtract(x(o).subtract(r)),new v(0),new v(1))),p.multiply(to(i,a))}getSize(o){return this.sizeMix?.value&&o.size&&o.sizeTo?S(o.size,o.sizeTo,this.sizeMix.value):o.size?o.size:this.size?.value||new v(0)}getColor(o){return this.colorMix?.value&&o.color&&o.colorTo?S(o.color,o.colorTo,this.colorMix.value):o.color?o.color:this.color?.value||new g(0)}getOpacity(o){return this.opacityMix?.value&&o.opacity&&o.opacityTo?S(o.opacity,o.opacityTo,this.opacityMix.value):o.opacity?o.opacity:this.opacity?.value||new v(1)}getHaloColor(o){return this.haloColorMix?.value&&o.haloColor&&o.haloColorTo?S(o.haloColor,o.haloColorTo,this.haloColorMix.value):o.haloColor?o.haloColor:this.haloColor?.value||new g(1)}getHaloWidth(o){if(1===this.iconType){if(this.opacityMix?.value&&o.haloWidth&&o.haloWidthTo)return S(o.haloWidth,o.haloWidthTo,this.opacityMix.value);if(o.haloWidth)return o.haloWidth}return new v(0)}}function to(o,t){const e=t.a.add(o.a.multiply(j(t.a))),i=t.rgb.add(o.rgb.multiply(j(t.a)));return new g(i,e)}o([p(L)],oo.prototype,"transform",void 0),o([p(q)],oo.prototype,"page",void 0),o([p(E)],oo.prototype,"config",void 0),o([r(F)],oo.prototype,"size",void 0),o([r(J)],oo.prototype,"sizeMix",void 0),o([r(K)],oo.prototype,"opacity",void 0),o([r(N)],oo.prototype,"opacityMix",void 0),o([r(Q)],oo.prototype,"color",void 0),o([r(X)],oo.prototype,"colorMix",void 0),o([r(Y)],oo.prototype,"haloColor",void 0),o([r(Z)],oo.prototype,"haloColorMix",void 0),o([r($)],oo.prototype,"haloBlur",void 0),o([r(_)],oo.prototype,"haloBlurMix",void 0),o([a],oo.prototype,"iconType",void 0),o([t(0,s(U))],oo.prototype,"vertex",null),o([t(0,s(G))],oo.prototype,"fragment",null);export{oo as VTLShaderIcon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,define as r,option as a,input as s,FragmentInput as d,VertexInput as y,UniformGroup as n}from"../../../GraphShaderModule.js";import{Vec2 as u,Float as v,Vec3 as c,Vec4 as h,dot as f,length as m,clamp as w,fract as x,mix as b,texture2D as g,Mat3 as T,Sampler2D as M}from"../../../graph/glsl.js";import{rgba2float as z}from"../utils.js";const I=1/31,L=15.5,S=8;class O extends y{}t([l(0,u)],O.prototype,"position",void 0),t([l(1,h)],O.prototype,"extrudeOffset",void 0),t([l(2,h)],O.prototype,"directionNormal",void 0),t([l(3,u)],O.prototype,"accumulatedDistance",void 0),t([l(4,h)],O.prototype,"color",void 0),t([l(5,v)],O.prototype,"width",void 0),t([l(6,v)],O.prototype,"opacity",void 0),t([l(7,v)],O.prototype,"blur",void 0),t([l(8,v)],O.prototype,"offset",void 0),t([l(9,h)],O.prototype,"tlbr",void 0),t([l(10,h)],O.prototype,"colorTo",void 0),t([l(11,v)],O.prototype,"widthTo",void 0),t([l(12,v)],O.prototype,"opacityTo",void 0),t([l(13,v)],O.prototype,"blurTo",void 0),t([l(14,v)],O.prototype,"offsetTo",void 0);class W extends n{}t([p(T)],W.prototype,"displayMat3",void 0),t([p(T)],W.prototype,"displayViewMat3",void 0),t([p(u)],W.prototype,"lineTranslation",void 0),t([p(v)],W.prototype,"depth",void 0),t([p(v)],W.prototype,"antialiasing",void 0);class R extends n{}t([p(u)],R.prototype,"mosaicSize",void 0),t([p(M)],R.prototype,"texture",void 0);class C extends n{}t([p(v)],C.prototype,"zoomFactor",void 0),t([p(T)],C.prototype,"dvsMat3",void 0);class D extends n{}t([p(h)],D.prototype,"value",void 0);class B extends n{}t([p(v)],B.prototype,"value",void 0);class j extends n{}t([p(v)],j.prototype,"value",void 0);class F extends n{}t([p(v)],F.prototype,"value",void 0);class N extends n{}t([p(v)],N.prototype,"value",void 0);class V extends n{}t([p(v)],V.prototype,"value",void 0);class G extends n{}t([p(v)],G.prototype,"value",void 0);class P extends n{}t([p(v)],P.prototype,"value",void 0);class k extends n{}t([p(v)],k.prototype,"value",void 0);class q extends n{}t([p(v)],q.prototype,"value",void 0);class A extends n{}t([p(h)],A.prototype,"value",void 0);class E extends e{constructor(){super(...arguments),this.type="VTLShaderLine"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t)),e=this.getBlur(t).add(this.layerInfo.antialiasing),i=t.directionNormal.zw.multiply(I);let l=this.getTLBR(t);const p=this.getWidth(t);let r=new u(0),a=new v(1);1!==this.lineType&&2!==this.lineType||(r=new u(l.z.subtract(l.x),l.y.subtract(l.w)),l=l.divide(this.page.mosaicSize.xyxy),a=1===this.lineType?p.divide(r.y):p.divide(L).multiply(.5));const s=new v(p.add(this.layerInfo.antialiasing)).multiply(.5),d=t.directionNormal.xy.multiply(I),y=t.extrudeOffset.zw.multiply(I).multiply(this.getOffset(t)),n=s.multiply(I).multiply(t.extrudeOffset.xy),m=new v(S).divide(this.tileInfo.zoomFactor),w=this.tileInfo.dvsMat3.multiply(new c(t.position.add(y.multiply(m)),1)),x=new c(this.layerInfo.displayViewMat3.multiply(new c(n,0))).add(this.layerInfo.displayMat3.multiply(new c(this.layerInfo.lineTranslation,0))),b=w.add(x),g=new h(b.xy,this.layerInfo.depth,1);let T=new v(0);return 1!==this.lineType&&2!==this.lineType||(T=t.accumulatedDistance.x.multiply(this.tileInfo.zoomFactor.divide(new v(S))).add(f(d,n.add(y)))),{glPosition:g,color:o,tlbr:l,normal:i,patternSize:r,widthRatio:a,halfLineWidth:s,blur:e,accumulatedDistance:T}}fragment(t){const o=new i,e=m(t.normal).multiply(t.halfLineWidth),l=new v(t.halfLineWidth.subtract(e)).divide(t.blur),p=w(l,new v(0),new v(1));if(1===this.lineType){const e=x(t.accumulatedDistance.divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(t.normal.y.multiply(t.halfLineWidth.divide(t.patternSize.y.multiply(t.widthRatio)))),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=g(this.page.texture,l);o.fragColor=r.multiply(p).multiply(t.color.a)}else if(2===this.lineType){const e=x(t.accumulatedDistance.multiply(.5).divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(new v(.25).multiply(t.normal.y)),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=z(g(this.page.texture,l)).subtract(new v(.5)).multiply(t.halfLineWidth.add(this.layerInfo.antialiasing.multiply(.5)));o.fragColor=p.multiply(w(new v(.5).subtract(r),new v(0),new v(1))).multiply(t.color)}else o.fragColor=t.color.multiply(p);return o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?b(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new h(0)}getWidth(t){return this.widthMix?.value&&t.width&&t.widthTo?b(t.width,t.widthTo,this.widthMix.value):t.width?t.width:this.width?.value||new v(0)}getBlur(t){return this.blurMix?.value&&t.blur&&t.blurTo?b(t.blur,t.blurTo,this.blurMix.value):t.blur?t.blur:this.blur?.value||new v(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?b(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getOffset(t){return this.offsetMix?.value&&t.offset&&t.offsetTo?b(t.offset,t.offsetTo,this.offsetMix.value):t.offset?t.offset:this.offset?.value||new v(0)}getTLBR(t){return t.tlbr?t.tlbr:this.tlbr?.value||new h(0)}}t([r],E.prototype,"lineType",void 0),t([p(W)],E.prototype,"layerInfo",void 0),t([p(C)],E.prototype,"tileInfo",void 0),t([a(R)],E.prototype,"page",void 0),t([a(D)],E.prototype,"color",void 0),t([a(B)],E.prototype,"colorMix",void 0),t([a(j)],E.prototype,"width",void 0),t([a(F)],E.prototype,"widthMix",void 0),t([a(N)],E.prototype,"opacity",void 0),t([a(V)],E.prototype,"opacityMix",void 0),t([a(G)],E.prototype,"blur",void 0),t([a(P)],E.prototype,"blurMix",void 0),t([a(k)],E.prototype,"offset",void 0),t([a(q)],E.prototype,"offsetMix",void 0),t([a(A)],E.prototype,"tlbr",void 0),t([o(0,s(O))],E.prototype,"vertex",null),t([o(0,s(d))],E.prototype,"fragment",null);export{E as VTLShaderLine};
2
+ import{__decorate as t,__param as o}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,define as r,option as a,input as s,FragmentInput as d,VertexInput as y,UniformGroup as n}from"../../../GraphShaderModule.js";import{Vec2 as u,Float as v,Vec3 as c,Vec4 as h,dot as f,length as m,clamp as w,fract as x,mix as b,texture2D as g,Mat3 as T,Sampler2D as M}from"../../../graph/glsl.js";import{rgba2float as z}from"../utils.js";const I=1/31,L=15.5,O=8;class S extends y{}t([l(0,u)],S.prototype,"position",void 0),t([l(1,h)],S.prototype,"extrudeOffset",void 0),t([l(2,h)],S.prototype,"directionNormal",void 0),t([l(3,u)],S.prototype,"accumulatedDistance",void 0),t([l(4,h)],S.prototype,"color",void 0),t([l(5,v)],S.prototype,"width",void 0),t([l(6,v)],S.prototype,"opacity",void 0),t([l(7,v)],S.prototype,"blur",void 0),t([l(8,v)],S.prototype,"offset",void 0),t([l(9,h)],S.prototype,"tlbr",void 0),t([l(10,h)],S.prototype,"colorTo",void 0),t([l(11,v)],S.prototype,"widthTo",void 0),t([l(12,v)],S.prototype,"opacityTo",void 0),t([l(13,v)],S.prototype,"blurTo",void 0),t([l(14,v)],S.prototype,"offsetTo",void 0);class C extends n{}t([p(T)],C.prototype,"displayMat3",void 0),t([p(T)],C.prototype,"displayViewMat3",void 0),t([p(u)],C.prototype,"lineTranslation",void 0),t([p(v)],C.prototype,"depth",void 0),t([p(v)],C.prototype,"antialiasing",void 0);class W extends n{}t([p(u)],W.prototype,"mosaicSize",void 0),t([p(M)],W.prototype,"texture",void 0);class R extends n{}t([p(v)],R.prototype,"zoomFactor",void 0),t([p(T)],R.prototype,"dvsMat3",void 0),t([p(v)],R.prototype,"tileOpacity",void 0);class D extends n{}t([p(h)],D.prototype,"value",void 0);class B extends n{}t([p(v)],B.prototype,"value",void 0);class j extends n{}t([p(v)],j.prototype,"value",void 0);class F extends n{}t([p(v)],F.prototype,"value",void 0);class N extends n{}t([p(v)],N.prototype,"value",void 0);class V extends n{}t([p(v)],V.prototype,"value",void 0);class G extends n{}t([p(v)],G.prototype,"value",void 0);class P extends n{}t([p(v)],P.prototype,"value",void 0);class k extends n{}t([p(v)],k.prototype,"value",void 0);class q extends n{}t([p(v)],q.prototype,"value",void 0);class A extends n{}t([p(h)],A.prototype,"value",void 0);class E extends e{constructor(){super(...arguments),this.type="VTLShaderLine"}vertex(t){const o=this.getColor(t).multiply(this.getOpacity(t)),e=this.getBlur(t).add(this.layerInfo.antialiasing),i=t.directionNormal.zw.multiply(I);let l=this.getTLBR(t);const p=this.getWidth(t);let r=new u(0),a=new v(1);1!==this.lineType&&2!==this.lineType||(r=new u(l.z.subtract(l.x),l.y.subtract(l.w)),l=l.divide(this.page.mosaicSize.xyxy),a=1===this.lineType?p.divide(r.y):p.divide(L).multiply(.5));const s=new v(p.add(this.layerInfo.antialiasing)).multiply(.5),d=t.directionNormal.xy.multiply(I),y=t.extrudeOffset.zw.multiply(I).multiply(this.getOffset(t)),n=s.multiply(I).multiply(t.extrudeOffset.xy),m=new v(O).divide(this.tileInfo.zoomFactor),w=this.tileInfo.dvsMat3.multiply(new c(t.position.add(y.multiply(m)),1)),x=new c(this.layerInfo.displayViewMat3.multiply(new c(n,0))).add(this.layerInfo.displayMat3.multiply(new c(this.layerInfo.lineTranslation,0))),b=w.add(x),g=new h(b.xy,this.layerInfo.depth,1);let T=new v(0);return 1!==this.lineType&&2!==this.lineType||(T=t.accumulatedDistance.x.multiply(this.tileInfo.zoomFactor.divide(new v(O))).add(f(d,n.add(y)))),{glPosition:g,color:o,tlbr:l,normal:i,patternSize:r,widthRatio:a,halfLineWidth:s,blur:e,accumulatedDistance:T}}fragment(t){const o=new i,e=m(t.normal).multiply(t.halfLineWidth),l=new v(t.halfLineWidth.subtract(e)).divide(t.blur),p=w(l,new v(0),new v(1));if(1===this.lineType){const e=x(t.accumulatedDistance.divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(t.normal.y.multiply(t.halfLineWidth.divide(t.patternSize.y.multiply(t.widthRatio)))),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=g(this.page.texture,l);o.fragColor=r.multiply(p).multiply(t.color.a)}else if(2===this.lineType){const e=x(t.accumulatedDistance.multiply(.5).divide(t.patternSize.x.multiply(t.widthRatio))),i=new v(.5).add(new v(.25).multiply(t.normal.y)),l=b(t.tlbr.xy,t.tlbr.zw,new u(e,i)),r=z(g(this.page.texture,l)).subtract(new v(.5)).multiply(t.halfLineWidth.add(this.layerInfo.antialiasing.multiply(.5)));o.fragColor=p.multiply(w(new v(.5).subtract(r),new v(0),new v(1))).multiply(t.color)}else o.fragColor=t.color.multiply(p);return o.fragColor=this.tileInfo.tileOpacity.multiply(o.fragColor),o}getColor(t){return this.colorMix?.value&&t.color&&t.colorTo?b(t.color,t.colorTo,this.colorMix.value):t.color?t.color:this.color?.value||new h(0)}getWidth(t){return this.widthMix?.value&&t.width&&t.widthTo?b(t.width,t.widthTo,this.widthMix.value):t.width?t.width:this.width?.value||new v(0)}getBlur(t){return this.blurMix?.value&&t.blur&&t.blurTo?b(t.blur,t.blurTo,this.blurMix.value):t.blur?t.blur:this.blur?.value||new v(0)}getOpacity(t){return this.opacityMix?.value&&t.opacity&&t.opacityTo?b(t.opacity,t.opacityTo,this.opacityMix.value):t.opacity?t.opacity:this.opacity?.value||new v(1)}getOffset(t){return this.offsetMix?.value&&t.offset&&t.offsetTo?b(t.offset,t.offsetTo,this.offsetMix.value):t.offset?t.offset:this.offset?.value||new v(0)}getTLBR(t){return t.tlbr?t.tlbr:this.tlbr?.value||new h(0)}}t([r],E.prototype,"lineType",void 0),t([p(C)],E.prototype,"layerInfo",void 0),t([p(R)],E.prototype,"tileInfo",void 0),t([a(W)],E.prototype,"page",void 0),t([a(D)],E.prototype,"color",void 0),t([a(B)],E.prototype,"colorMix",void 0),t([a(j)],E.prototype,"width",void 0),t([a(F)],E.prototype,"widthMix",void 0),t([a(N)],E.prototype,"opacity",void 0),t([a(V)],E.prototype,"opacityMix",void 0),t([a(G)],E.prototype,"blur",void 0),t([a(P)],E.prototype,"blurMix",void 0),t([a(k)],E.prototype,"offset",void 0),t([a(q)],E.prototype,"offsetMix",void 0),t([a(A)],E.prototype,"tlbr",void 0),t([o(0,s(S))],E.prototype,"vertex",null),t([o(0,s(d))],E.prototype,"fragment",null);export{E as VTLShaderLine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as o,__param as t}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,option as a,input as r,VertexInput as d,UniformGroup as s,FragmentInput as n}from"../../../GraphShaderModule.js";import{mod as y,Float as v,unpackVec4 as h,ifElse as u,greaterThan as c,clamp as x,step as w,lessThan as m,Vec3 as g,Vec4 as M,texture2D as T,smoothstep as f,mix as z,Mat3 as W,Vec2 as C,Sampler2D as B}from"../../../graph/glsl.js";import{oneMinus as S}from"../utils.js";class H extends d{}o([l(0,M)],H.prototype,"positionAndOffset",void 0),o([l(1,M)],H.prototype,"iconInfo",void 0),o([l(2,v)],H.prototype,"size",void 0),o([l(3,v)],H.prototype,"opacity",void 0),o([l(4,M)],H.prototype,"color",void 0),o([l(5,M)],H.prototype,"haloColor",void 0),o([l(6,v)],H.prototype,"haloWidth",void 0),o([l(7,v)],H.prototype,"haloBlur",void 0),o([l(8,v)],H.prototype,"sizeTo",void 0),o([l(9,v)],H.prototype,"opacityTo",void 0),o([l(10,M)],H.prototype,"colorTo",void 0),o([l(11,M)],H.prototype,"haloColorTo",void 0),o([l(12,v)],H.prototype,"haloWidthTo",void 0),o([l(13,v)],H.prototype,"haloBlurTo",void 0),o([l(14,v)],H.prototype,"opacityInfo",void 0);class b extends n{}class D extends s{}o([p(W)],D.prototype,"dvsMat3",void 0),o([p(W)],D.prototype,"displayMat3",void 0),o([p(W)],D.prototype,"displayViewMat3",void 0),o([p(v)],D.prototype,"mapRotation",void 0);class I extends s{}o([p(v)],I.prototype,"halo",void 0),o([p(v)],I.prototype,"depth",void 0),o([p(v)],I.prototype,"level",void 0),o([p(v)],I.prototype,"keepUpright",void 0),o([p(v)],I.prototype,"fadeDuration",void 0),o([p(v)],I.prototype,"time",void 0),o([p(v)],I.prototype,"isStencilPass",void 0),o([p(v)],I.prototype,"antialiasingWidth",void 0),o([p(C)],I.prototype,"textTranslation",void 0);class O extends s{}o([p(C)],O.prototype,"mosaicSize",void 0),o([p(B)],O.prototype,"texture",void 0);class j extends s{}o([p(v)],j.prototype,"value",void 0);class V extends s{}o([p(v)],V.prototype,"value",void 0);class k extends s{}o([p(M)],k.prototype,"value",void 0);class A extends s{}o([p(v)],A.prototype,"value",void 0);class P extends s{}o([p(M)],P.prototype,"value",void 0);class R extends s{}o([p(v)],R.prototype,"value",void 0);class U extends s{}o([p(v)],U.prototype,"value",void 0);class G extends s{}o([p(v)],G.prototype,"value",void 0);class L extends s{}o([p(v)],L.prototype,"value",void 0);class q extends s{}o([p(v)],q.prototype,"value",void 0);class E extends s{}o([p(v)],E.prototype,"value",void 0);class F extends s{}o([p(v)],F.prototype,"value",void 0);const J=new v(1/8),K=new v(1/24),N=new v(3),Q=new v(.75);class X extends e{constructor(){super(...arguments),this.type="VTLShaderText"}vertex(o){const t=this.getSize(o),e=this.getHaloColor(o),i=this.getColor(o);let l=this.getHaloWidth(o),p=this.getHaloBlur(o);const a=this.getOpacity(o),{iconInfo:r,opacityInfo:d,positionAndOffset:s}=o,{dvsMat3:n,displayViewMat3:T,displayMat3:f,mapRotation:z}=this.transform,{antialiasingWidth:W,depth:C,halo:B,level:H,keepUpright:b,fadeDuration:D,textTranslation:I,time:O}=this.config,{mosaicSize:j}=this.page,V=y(d,new v(128)),k=d.subtract(V).divide(new v(128)),A=V.divide(new v(127)),[P,R]=h(r,8);let U=u(c(B,new v(.5)),e.multiply(a),i.multiply(a));l=u(c(B,new v(.5)),l.multiply(N),new v(0)),p=u(c(B,new v(.5)),p.multiply(N),new v(0));const G=x(A.add(new v(2).multiply(k.subtract(new v(.5)).multiply(O.divide(D)))),new v(0),new v(1));U=U.multiply(G);const L=R[1],q=R[2],E=R[3],F=P.xy.divide(j),X=P.z,Y=P.w,Z=y(L.add(z),new v(256));let $=new v(0);$=u(m(X,Y),S(w(b,new v(0))).multiply(w(Y,Z).add(S(w(X,Z)))),S(w(b,new v(0))).multiply(w(Y,Z).multiply(S(w(X,Z))))),$=$.add(S(w(q,H))),$=$.add(w(E,H)),$=$.add(w(U[3],new v(0)));const _=Q.subtract(l.divide(t)),oo=W.add(p).divide(t),to=n.multiply(new g(s.xy,new v(1))).add(T.multiply(K).multiply(new g(J.multiply(t.multiply(s.zw)),new v(0)))).add(f.multiply(new g(I,0)));return{glPosition:new M(to.xy,C.add($),new v(1)),color:U,tex:F,edgeDistance:_,edgeWidth:oo}}fragment(o){const t=new i,{color:e,tex:l,edgeDistance:p,edgeWidth:a}=o,{texture:r}=this.page,d=T(r,l).a,s=f(p.subtract(a),p.add(a),d);return t.fragColor=e.multiply(s),t}getSize(o){return this.sizeMix?.value&&o.size&&o.sizeTo?z(o.size,o.sizeTo,this.sizeMix.value):o.size?o.size:this.size?.value||new v(0)}getHaloColor(o){return this.haloColorMix?.value&&o.haloColor&&o.haloColorTo?z(o.haloColor,o.haloColorTo,this.haloColorMix.value):o.haloColor?o.haloColor:this.haloColor?.value||new M(0)}getHaloBlur(o){return this.haloBlurMix?.value&&o.haloBlur&&o.haloBlurTo?z(o.haloBlur,o.haloBlurTo,this.haloBlurMix.value):o.haloBlur?o.haloBlur:this.haloBlur?.value||new v(0)}getHaloWidth(o){return this.haloWidthMix?.value&&o.haloWidth&&o.haloWidthTo?z(o.haloWidth,o.haloWidthTo,this.haloWidthMix.value):o.haloWidth?o.haloWidth:this.haloWidth?.value||new v(0)}getColor(o){return this.colorMix?.value&&o.color&&o.colorTo?z(o.color,o.colorTo,this.colorMix.value):o.color?o.color:this.color?.value||new M(0)}getOpacity(o){return this.opacityMix?.value&&o.opacity&&o.opacityTo?z(o.opacity,o.opacityTo,this.opacityMix.value):o.opacity?o.opacity:this.opacity?.value||new v(1)}}o([p(D)],X.prototype,"transform",void 0),o([p(I)],X.prototype,"config",void 0),o([p(O)],X.prototype,"page",void 0),o([a(E)],X.prototype,"size",void 0),o([a(k)],X.prototype,"color",void 0),o([a(P)],X.prototype,"haloColor",void 0),o([a(U)],X.prototype,"haloWidth",void 0),o([a(G)],X.prototype,"haloBlur",void 0),o([a(j)],X.prototype,"opacity",void 0),o([a(F)],X.prototype,"sizeMix",void 0),o([a(A)],X.prototype,"colorMix",void 0),o([a(R)],X.prototype,"haloColorMix",void 0),o([a(L)],X.prototype,"haloWidthMix",void 0),o([a(q)],X.prototype,"haloBlurMix",void 0),o([a(V)],X.prototype,"opacityMix",void 0),o([t(0,r(H))],X.prototype,"vertex",null),o([t(0,r(b))],X.prototype,"fragment",null);export{X as VTLShaderText};
2
+ import{__decorate as o,__param as t}from"tslib";import{GraphShaderModule as e,FragmentOutput as i,location as l,uniform as p,option as a,input as r,VertexInput as d,UniformGroup as s,FragmentInput as y}from"../../../GraphShaderModule.js";import{mod as n,Float as v,unpackVec4 as h,ifElse as u,greaterThan as c,clamp as x,step as w,lessThan as m,Vec3 as g,Vec4 as M,texture2D as f,smoothstep as T,mix as z,Mat3 as W,Vec2 as C,Sampler2D as B}from"../../../graph/glsl.js";import{oneMinus as S}from"../utils.js";class H extends d{}o([l(0,M)],H.prototype,"positionAndOffset",void 0),o([l(1,M)],H.prototype,"iconInfo",void 0),o([l(2,v)],H.prototype,"size",void 0),o([l(3,v)],H.prototype,"opacity",void 0),o([l(4,M)],H.prototype,"color",void 0),o([l(5,M)],H.prototype,"haloColor",void 0),o([l(6,v)],H.prototype,"haloWidth",void 0),o([l(7,v)],H.prototype,"haloBlur",void 0),o([l(8,v)],H.prototype,"sizeTo",void 0),o([l(9,v)],H.prototype,"opacityTo",void 0),o([l(10,M)],H.prototype,"colorTo",void 0),o([l(11,M)],H.prototype,"haloColorTo",void 0),o([l(12,v)],H.prototype,"haloWidthTo",void 0),o([l(13,v)],H.prototype,"haloBlurTo",void 0),o([l(14,v)],H.prototype,"opacityInfo",void 0);class O extends y{}class b extends s{}o([p(W)],b.prototype,"dvsMat3",void 0),o([p(W)],b.prototype,"displayMat3",void 0),o([p(W)],b.prototype,"displayViewMat3",void 0),o([p(v)],b.prototype,"mapRotation",void 0);class D extends s{}o([p(v)],D.prototype,"halo",void 0),o([p(v)],D.prototype,"depth",void 0),o([p(v)],D.prototype,"level",void 0),o([p(v)],D.prototype,"keepUpright",void 0),o([p(v)],D.prototype,"fadeDuration",void 0),o([p(v)],D.prototype,"time",void 0),o([p(v)],D.prototype,"isStencilPass",void 0),o([p(v)],D.prototype,"antialiasingWidth",void 0),o([p(C)],D.prototype,"textTranslation",void 0),o([p(v)],D.prototype,"tileOpacity",void 0);class I extends s{}o([p(C)],I.prototype,"mosaicSize",void 0),o([p(B)],I.prototype,"texture",void 0);class j extends s{}o([p(v)],j.prototype,"value",void 0);class V extends s{}o([p(v)],V.prototype,"value",void 0);class k extends s{}o([p(M)],k.prototype,"value",void 0);class A extends s{}o([p(v)],A.prototype,"value",void 0);class P extends s{}o([p(M)],P.prototype,"value",void 0);class R extends s{}o([p(v)],R.prototype,"value",void 0);class U extends s{}o([p(v)],U.prototype,"value",void 0);class G extends s{}o([p(v)],G.prototype,"value",void 0);class L extends s{}o([p(v)],L.prototype,"value",void 0);class q extends s{}o([p(v)],q.prototype,"value",void 0);class E extends s{}o([p(v)],E.prototype,"value",void 0);class F extends s{}o([p(v)],F.prototype,"value",void 0);const J=new v(1/8),K=new v(1/24),N=new v(3),Q=new v(.75);class X extends e{constructor(){super(...arguments),this.type="VTLShaderText"}vertex(o){const t=this.getSize(o),e=this.getHaloColor(o),i=this.getColor(o);let l=this.getHaloWidth(o),p=this.getHaloBlur(o);const a=this.getOpacity(o),{iconInfo:r,opacityInfo:d,positionAndOffset:s}=o,{dvsMat3:y,displayViewMat3:f,displayMat3:T,mapRotation:z}=this.transform,{antialiasingWidth:W,depth:C,halo:B,level:H,keepUpright:O,fadeDuration:b,textTranslation:D,time:I}=this.config,{mosaicSize:j}=this.page,V=n(d,new v(128)),k=d.subtract(V).divide(new v(128)),A=V.divide(new v(127)),[P,R]=h(r,8);let U=u(c(B,new v(.5)),e.multiply(a),i.multiply(a));l=u(c(B,new v(.5)),l.multiply(N),new v(0)),p=u(c(B,new v(.5)),p.multiply(N),new v(0));const G=x(A.add(new v(2).multiply(k.subtract(new v(.5)).multiply(I.divide(b)))),new v(0),new v(1));U=U.multiply(G);const L=R[1],q=R[2],E=R[3],F=P.xy.divide(j),X=P.z,Y=P.w,Z=n(L.add(z),new v(256));let $=new v(0);$=u(m(X,Y),S(w(O,new v(0))).multiply(w(Y,Z).add(S(w(X,Z)))),S(w(O,new v(0))).multiply(w(Y,Z).multiply(S(w(X,Z))))),$=$.add(S(w(q,H))),$=$.add(w(E,H)),$=$.add(w(U[3],new v(0)));const _=Q.subtract(l.divide(t)),oo=W.add(p).divide(t),to=y.multiply(new g(s.xy,new v(1))).add(f.multiply(K).multiply(new g(J.multiply(t.multiply(s.zw)),new v(0)))).add(T.multiply(new g(D,0)));return{glPosition:new M(to.xy,C.add($),new v(1)),color:U,tex:F,edgeDistance:_,edgeWidth:oo}}fragment(o){const t=new i,{color:e,tex:l,edgeDistance:p,edgeWidth:a}=o,{texture:r}=this.page,{tileOpacity:d}=this.config,s=f(r,l).a,y=T(p.subtract(a),p.add(a),s);return t.fragColor=e.multiply(y).multiply(d),t}getSize(o){return this.sizeMix?.value&&o.size&&o.sizeTo?z(o.size,o.sizeTo,this.sizeMix.value):o.size?o.size:this.size?.value||new v(0)}getHaloColor(o){return this.haloColorMix?.value&&o.haloColor&&o.haloColorTo?z(o.haloColor,o.haloColorTo,this.haloColorMix.value):o.haloColor?o.haloColor:this.haloColor?.value||new M(0)}getHaloBlur(o){return this.haloBlurMix?.value&&o.haloBlur&&o.haloBlurTo?z(o.haloBlur,o.haloBlurTo,this.haloBlurMix.value):o.haloBlur?o.haloBlur:this.haloBlur?.value||new v(0)}getHaloWidth(o){return this.haloWidthMix?.value&&o.haloWidth&&o.haloWidthTo?z(o.haloWidth,o.haloWidthTo,this.haloWidthMix.value):o.haloWidth?o.haloWidth:this.haloWidth?.value||new v(0)}getColor(o){return this.colorMix?.value&&o.color&&o.colorTo?z(o.color,o.colorTo,this.colorMix.value):o.color?o.color:this.color?.value||new M(0)}getOpacity(o){return this.opacityMix?.value&&o.opacity&&o.opacityTo?z(o.opacity,o.opacityTo,this.opacityMix.value):o.opacity?o.opacity:this.opacity?.value||new v(1)}}o([p(b)],X.prototype,"transform",void 0),o([p(D)],X.prototype,"config",void 0),o([p(I)],X.prototype,"page",void 0),o([a(E)],X.prototype,"size",void 0),o([a(k)],X.prototype,"color",void 0),o([a(P)],X.prototype,"haloColor",void 0),o([a(U)],X.prototype,"haloWidth",void 0),o([a(G)],X.prototype,"haloBlur",void 0),o([a(j)],X.prototype,"opacity",void 0),o([a(F)],X.prototype,"sizeMix",void 0),o([a(A)],X.prototype,"colorMix",void 0),o([a(R)],X.prototype,"haloColorMix",void 0),o([a(L)],X.prototype,"haloWidthMix",void 0),o([a(q)],X.prototype,"haloBlurMix",void 0),o([a(V)],X.prototype,"opacityMix",void 0),o([t(0,r(H))],X.prototype,"vertex",null),o([t(0,r(O))],X.prototype,"fragment",null);export{X as VTLShaderText};
@@ -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=36,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,painter:r,requiredLevel:n,spriteMosaic:a,state:o,styleLayer:c,styleLayerUID:u}=t,{tiles:h}=s;if(!h.some(e=>e.layerData.get(u)?.circleIndexCount??!1))return;const d=c,{circleMaterial:m}=d,p=1.2,y=d.getPaintValue("circle-translate",i),f={transform:{dvsMat:null,displayMat:1===d.getPaintValue("circle-translate-anchor",i)?o.displayMat3:o.displayViewMat3},styleLayerConfig:{circleTranslation:y,depth:d.z,antialiasingWidth:p},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 M=-1;for(const x of h){if(!x.layerData.has(u))continue;if(f.transform.dvsMat=x.transforms.displayViewScreenMat3,x.key.level!==M){M=x.key.level;const e=m.getUniforms();for(const t of e){const e=t.getValue(d,i,M,a);t.name in f&&(f[t.name]={value:e})}}const t=x.layerData.get(u);if(!t.circleIndexCount)continue;if(this._mesh=t.getMesh(l),!this._mesh)continue;const s=n!==x.key.level?514:516,o=n!==x.key.level?x.stencilRef:255;r.setPipelineState({...e,stencil:{write:!1,test:{compare:s,op:{fail:7680,zFail:7680,zPass:7681},mask:255}}});const c={shader:this.shaders.circle,uniforms:f,defines:null,optionalAttributes:m.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:m.getPrecisionFactors()};r.submitDrawMeshUntyped(l,c,this._mesh,{stencilRef:o}),x.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 s}from"../shaders/vector-tiles/VTLShaderCircle.js";class l extends t{constructor(){super(...arguments),this.type=36,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 g=-1;for(const x of d){if(!x.layerData.has(h))continue;if(M.transform.dvsMat=x.transforms.displayViewScreenMat3,x.key.level!==g){g=x.key.level;const e=f.getUniforms();for(const t of e){const e=t.getValue(p,i,g,o);t.name in M&&(M[t.name]={value:e})}}const t=x.layerData.get(h);if(!t.circleIndexCount)continue;if(this._mesh=t.getMesh(l),!this._mesh)continue;const s=a!==x.key.level?514:516,c=a!==x.key.level?x.stencilRef:255;M.config.tileOpacity=1===r?x.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,defines:null,optionalAttributes:f.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:f.getPrecisionFactors()};n.submitDrawMeshUntyped(l,u,this._mesh,{stencilRef:c}),x.triangleCount+=t.circleIndexCount/3}}}export{l 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 n}from"../shaders/vector-tiles/VTLShaderOutline.js";const a=1/65536;class o extends l{constructor(){super(...arguments),this.type=37,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new s,outline:new n}}shutdown(){this._fillMesh&&(this._fillMesh.destroy(),this._fillMesh=null),this._outlineMesh&&(this._outlineMesh.destroy(),this._outlineMesh=null)}render(t,e){const{displayLevel:i,renderPass:l,spriteMosaic:s,styleLayer:n,styleLayerUID:a}=t,{tiles:o}=e;let r=!1;for(const x of o)if(x.layerData.has(a)){const t=x.layerData.get(a);if(t.fillIndexCount>0||t.outlineIndexCount>0){r=!0;break}}if(!r)return;const u=n,c=u.getPaintProperty("fill-pattern"),f=void 0!==c,p=f&&c.isDataDriven;let h;if(f&&!p){const t=c.getValue(i);h=s.getMosaicItemPosition(t,!0)}const d=!f&&u.getPaintValue("fill-antialias",i);let M=!0,y=1;if(!f){const t=u.getPaintProperty("fill-color"),e=u.getPaintProperty("fill-opacity");if(!t?.isDataDriven&&!e?.isDataDriven){const t=u.getPaintValue("fill-color",i);y=u.getPaintValue("fill-opacity",i)*t[3],y>=1&&(M=!1)}}if(M&&"opaque"===l)return;const m=u.getPaintValue("fill-translate",i),g=u.getPaintValue("fill-translate-anchor",i);(M||"translucent"!==l)&&this._drawFill(t,a,u,o,m,g,f,h,p);const v=!u.hasDataDrivenOutlineColor&&u.outlineUsesFillColor&&y<1;d&&"opaque"!==l&&!v&&this._drawOutline(t,a,u,o,m,g)}_drawFill(l,s,n,o,r,u,c,f,p){if(c&&!p&&null==f)return;const{context:h,displayLevel:d,state:M,painter:y,pixelRatio:m,spriteMosaic:g}=l,v=m>i?2:1,x=n.fillMaterial,P={transform:{dvsMat:null,displayMat:1===u?M.displayMat3:M.displayViewMat3},config:{depth:n.z+a,fillTranslation:r},patternOptions:p||c&&null!=f?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0],texture:{texture:null,unit:0}}:null,color:null,opacity:null,colorMix:null,opacityMix:null},D=c?1:0,_=x.key+t({hasPattern:c});if(null!=f){const{page:t,tl:i,br:l}=f,s=i[0],n=l[1],a=l[0],o=i[1],r=g.getPageSize(t);null!=r&&(g.bind(h,9729,t,e),P.patternOptions={mosaicSize:[r[0],r[1]],patternFactor:1,tlbr:[s,n,a,o],texture:{texture:g.getTexture(t),unit:e}})}let w=-1;for(const t of o){if(!t.layerData.has(s))continue;if(t.key.level!==w){w=t.key.level;const e=x.getUniforms();for(const t of e){const e=t.getValue(n,d,w,g);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/(v*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}=P;l.dvsMat=t.transforms.displayViewScreenMat3;const a={shader:this.shaders.fill,uniforms:P,defines:{fillType:D},optionalAttributes:x.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:x.getPrecisionFactors(),materialKey:_};if(p){const l=P.patternOptions,s=i.patternMap;if(!s||null==l)continue;let n=0;for(const[i,o]of s){const s=g.getPageSize(i);null!=s&&(g.bind(h,9729,i,e),l.mosaicSize=s,l.texture={texture:g.getTexture(i),unit:e},y.submitDrawMeshUntyped(h,a,this._fillMesh,{stencilRef:t.stencilRef,parts:[n++]}))}}else y.submitDrawMeshUntyped(h,a,this._fillMesh,{stencilRef:t.stencilRef});t.triangleCount+=i.fillIndexCount/3}}_drawOutline(t,e,i,l,s,n){const{context:o,displayLevel:r,is3D:u,state:c,spriteMosaic:f,painter:p,pixelRatio:h}=t,d=i.outlineMaterial,M=d.key,y=.75/h,m={transform:{dvsMat3:null,displayMat3:1===n?c.displayMat3:c.displayViewMat3},config:{depth:i.z+a,fillTranslation:s,outlineWidth:y},color:null,opacity:null,colorMix:null,opacityMix:null};u||p.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}});let g=-1;for(const a of l){if(!a.layerData.has(e))continue;if(a.key.level!==g){g=a.key.level;const t=d.getUniforms();for(const e of t){const t=e.getValue(i,r,g,f);e.name in m&&(m[e.name]={value:t})}}const t=a.layerData.get(e);if(this._outlineMesh=t.getMesh(o,{value:1}),null==this._outlineMesh)continue;const{transform:l}=m;l.dvsMat3=a.transforms.displayViewScreenMat3;const s={shader:this.shaders.outline,uniforms:m,defines:{},optionalAttributes:d.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:d.getPrecisionFactors(),materialKey:M};p.submitDrawMeshUntyped(o,s,this._outlineMesh,{stencilRef:a.stencilRef}),a.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 s}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as n}from"../shaders/vector-tiles/VTLShaderOutline.js";const a=1/65536;class o extends l{constructor(){super(...arguments),this.type=37,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new s,outline:new n}}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:n,styleLayer:a,styleLayerUID:o}=t,{tiles:r}=e;let u=!1;for(const P of r)if(P.layerData.has(o)){const t=P.layerData.get(o);if(t.fillIndexCount>0||t.outlineIndexCount>0){u=!0;break}}if(!u)return;const c=a,f=c.getPaintProperty("fill-pattern"),p=void 0!==f,h=p&&f.isDataDriven;let d;if(p&&!h){const t=f.getValue(i);d=n.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(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,n,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,P=n.fillMaterial,D={transform:{dvsMat:null,displayMat:1===u?M.displayMat3:M.displayViewMat3},config:{depth:n.z+a,fillTranslation:r,tileOpacity:1},patternOptions:p||c&&null!=f?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0],texture:{texture:null,unit:0}}:null,color:null,opacity:null,colorMix:null,opacityMix:null},_=c?1:0,w=P.key+t({hasPattern:c});if(null!=f){const{page:t,tl:i,br:l}=f,s=i[0],n=l[1],a=l[0],o=i[1],r=v.getPageSize(t);null!=r&&(v.bind(h,9729,t,e),D.patternOptions={mosaicSize:[r[0],r[1]],patternFactor:1,tlbr:[s,n,a,o],texture:{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=P.getUniforms();for(const t of e){const e=t.getValue(n,d,V,v);D[t.name]={value:e}}if(c&&null!=D.patternOptions){const e=Math.max(2**(Math.round(d)-t.key.level),1),i=t.rangeX/(x*t.width*e);D.patternOptions.patternFactor=i}}const i=t.layerData.get(s);if(this._fillMesh=i.getMesh(h,{value:0}),!this._fillMesh)continue;const{transform:l,config:a}=D;l.dvsMat=t.transforms.displayViewScreenMat3,a.tileOpacity=1===y?t.fader.value():1;const o={shader:this.shaders.fill,uniforms:D,defines:{fillType:_},optionalAttributes:P.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:P.getPrecisionFactors(),materialKey:w};if(p){const l=D.patternOptions,s=i.patternMap;if(!s||null==l)continue;let n=0;for(const[i,a]of s){const s=v.getPageSize(i);null!=s&&(v.bind(h,9729,i,e),l.mosaicSize=s,l.texture={texture:v.getTexture(i),unit:e},g.submitDrawMeshUntyped(h,o,this._fillMesh,{stencilRef:t.stencilRef,parts:[n++]}))}}else g.submitDrawMeshUntyped(h,o,this._fillMesh,{stencilRef:t.stencilRef});t.triangleCount+=i.fillIndexCount/3}}_drawOutline(t,e,i,l,s,n){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===n?c.displayMat3:c.displayViewMat3},config:{depth:i.z+a,fillTranslation:s,outlineWidth:M,tileOpacity:1},color:null,opacity:null,colorMix:null,opacityMix:null};let m=-1;for(const a of l){if(!a.layerData.has(e))continue;if(a.key.level!==m){m=a.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=a.layerData.get(e);if(this._outlineMesh=t.getMesh(o,{value:1}),null==this._outlineMesh)continue;const{transform:l,config:s}=g;l.dvsMat3=a.transforms.displayViewScreenMat3,s.tileOpacity=1===u?a.fader.value():1;const n={shader:this.shaders.outline,uniforms:g,defines:{},optionalAttributes:d.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:d.getPrecisionFactors(),materialKey:y};p.submitDrawMeshUntyped(o,n,this._outlineMesh,{stencilRef:a.stencilRef}),a.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=38,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,is3D:a,painter:o,pixelRatio:r,spriteMosaic:u,state:c,styleLayer:p,styleLayerUID:f}=i,{tiles:d}=s;if(!d.some(e=>e.layerData.get(f)?.lineIndexCount??!1))return;const h=p,m=h.lineMaterial,y=h.getPaintValue("line-translate",l),g=h.getPaintValue("line-translate-anchor",l),M=1/r,x={layerInfo:{displayViewMat3:c.displayViewMat3,displayMat3:1===g?c.displayMat3:c.displayViewMat3,lineTranslation:y,depth:h.z,antialiasing:M},tileInfo:{dvsMat3:null,zoomFactor: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},v=h.getPaintProperty("line-pattern"),w=void 0!==v,P=w&&v.isDataDriven;let D,V;if(w&&!P){const e=v.getValue(l);D=u.getMosaicItemPosition(e)}let b=!1;if(!w){const e=h.getPaintProperty("line-dasharray");if(V=void 0!==e,b=V&&e.isDataDriven,V&&!b){const t=e.getValue(l),i=h.getDashKey(t,h.getLayoutValue("line-cap",l));if(D=u.getMosaicItemPosition(i),null==D)return}}const z=w?1:V?2:0,I=m.key+e({lineType:z});if(null!=D){const{page:e}=D,i=u.getPageSize(e);if(null!=i){u.bind(n,9729,e,t);const s={texture:{texture:u.getTexture(e),unit:t},mosaicSize:[i[0],i[1]]};x.page=s}}a||o.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:T}=x;let _=-1;for(const e of d){if(!e.layerData.has(f))continue;if(T.dvsMat3=e.transforms.displayViewScreenMat3,e.key.level!==_){_=e.key.level;const t=m.getUniforms();for(const e of t){const t=e.getValue(h,l,_,u);e.name in x&&(x[e.name]={value:t})}}const i=2**(l-_)/r;T.zoomFactor=i;const s=e.layerData.get(f);if(!s.lineIndexCount)continue;if(this._mesh=s.getMesh(n),!this._mesh)continue;const a={shader:this.shaders.line,uniforms:x,defines:{lineType:z},optionalAttributes:m.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:m.getPrecisionFactors(),materialKey:I};if(P||b){const i=s.patternMap;if(!i)continue;let l=0;for(const s of i.keys()){const i=u.getPageSize(s);null!=i&&(u.bind(n,9729,s,t),x.page={texture:{texture:u.getTexture(s),unit:t},mosaicSize:[i[0],i[1]]},o.submitDrawMeshUntyped(n,a,this._mesh,{stencilRef:e.stencilRef,parts:[l++]}))}}else o.submitDrawMeshUntyped(n,a,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=38,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 V,b;if(P&&!D){const e=w.getValue(l);V=c.getMosaicItemPosition(e)}let z=!1;if(!P){const e=m.getPaintProperty("line-dasharray");if(b=void 0!==e,z=b&&e.isDataDriven,b&&!z){const t=e.getValue(l),i=m.getDashKey(t,m.getLayoutValue("line-cap",l));if(V=c.getMosaicItemPosition(i),null==V)return}}const I=P?1:b?2:0,T=y.key+e({lineType:I});if(null!=V){const{page:e}=V,i=c.getPageSize(e);if(null!=i){c.bind(n,9729,e,t);const s={texture:{texture:c.getTexture(e),unit:t},mosaicSize:[i[0],i[1]]};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:_}=v;let S=-1;for(const e of h){if(!e.layerData.has(d))continue;if(_.dvsMat3=e.transforms.displayViewScreenMat3,e.key.level!==S){S=e.key.level;const t=y.getUniforms();for(const e of t){const t=e.getValue(m,l,S,c);e.name in v&&(v[e.name]={value:t})}}const i=2**(l-S)/u;_.zoomFactor=i;const s=e.layerData.get(d);if(!s.lineIndexCount)continue;if(this._mesh=s.getMesh(n),!this._mesh)continue;_.tileOpacity=1===a?e.fader.value():1;const o={shader:this.shaders.line,uniforms:v,defines:{lineType:I},optionalAttributes:y.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:y.getPrecisionFactors(),materialKey:T};if(D||z){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={texture:{texture:c.getTexture(s),unit:t},mosaicSize:[i[0],i[1]]},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 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=39,this._iconMesh=null,this._textMesh=null,this.shaders={icon:new s,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,n=i.getPipelineState();this._setRenderState(e),this._drawIcons(e,a,l),this._drawText(e,a,l),i.setPipelineState(n)}_drawIcons(t,a,n){const{context:s,displayLevel:o,spriteMosaic:r,state:c,styleLayerUID:u}=t,h=a.iconMaterial;let p,g=!1;for(const e of n)if(e.layerData.has(u)&&(p=e.layerData.get(u),p.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const y=a.getPaintValue("icon-translate",o),d=a.getPaintValue("icon-translate-anchor",o);let f=a.getLayoutValue("icon-rotation-alignment",o);2===f&&(f=0===a.getLayoutValue("symbol-placement",o)?1:0);const m=0===f,M=a.getLayoutValue("icon-keep-upright",o)&&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:a.z,iconTranslation:y,level:10*o,keepUpright:M?1:0,fadeDuration:e/1e3,isStencilPass:t.stencilSymbols?1:0,time:null},page:{mosaicSize:null,texture:{texture:null,unit:i}},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 n){if(!e.layerData.has(u))continue;if(e.key.level!==D){D=e.key.level;const t=h.getUniforms();for(const e of t){const t=e.getValue(a,o,D,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;let i=0;for(const[a,l]of p.iconPerPageElementsMap)this._renderIconRange(t,h,l,a,e,P,this._iconMesh,x,i++)}}_drawText(t,i,n){const{context:s,displayLevel: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 n)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(o))return;const P=i.getPaintProperty("text-color"),D=P&&P.getValue(o),_=!P||P.isDataDriven||D&&4===D.length&&D[3]>0,v=i.getPaintProperty("text-halo-width"),w=i.getPaintProperty("text-halo-color"),V=w&&w.getValue(o),S=(!v||v.isDataDriven||v.getValue(o)>0)&&(!w||w.isDataDriven||V&&4===V.length&&V[3]>0);if(!_&&!S)return;const z=24/8;let b=i.getLayoutValue("text-rotation-alignment",o);2===b&&(b=0===i.getLayoutValue("symbol-placement",o)?1:0);const R=0===b,T=i.getLayoutValue("text-keep-upright",o)&&R,U=.8*z/h;this._glyphTextureSize||(this._glyphTextureSize=[c.width/4,c.height/4]);const k=i.getPaintValue("text-translate",o),L=i.getPaintValue("text-translate-anchor",o);if(d&&null!=y)return void y();const I={transform:{dvsMat3:null,displayViewMat3:0===b?p.displayViewMat3:p.displayMat3,displayMat3:1===L?p.displayMat3:p.displayViewMat3,mapRotation:l(p.rotation)},config:{depth:i.z+r,textTranslation:k,keepUpright:T?1:0,level:10*o,fadeDuration:e/1e3,antialiasingWidth:U,time:null,halo:null,isStencilPass:t.stencilSymbols?1:0},page:{mosaicSize:null,texture:{texture:null,unit:a}},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 n){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,o,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,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,_,e,I,f,this._textMesh,a++)})}}_renderIconRange(e,a,l,n,s,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,n,i),o.page={mosaicSize:[y.getWidth(n)/4,y.getHeight(n)/4],texture:{texture:y.getTexture(n),unit:i}};const m={shader:this.shaders.icon,uniforms:o,defines:d,optionalAttributes:a.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:a.getPrecisionFactors(),materialKey:f};g.submitDrawMeshUntyped(h,m,r,{stencilRef:p?s.stencilRef:255,parts:[u]}),s.triangleCount+=l[1]/3}_renderGlyphRange(e,t,i,l,n,s,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,texture:{texture:y.getTexture(h,i),unit:a}};const d={shader:this.shaders.text,uniforms:o,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?s.stencilRef:255,parts:[u]}),s.triangleCount+=t[1]/3),n&&(o.config.halo=0,g.submitDrawMeshUntyped(h,d,c,{stencilRef:p?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};
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=39,this._iconMesh=null,this._textMesh=null,this.shaders={icon:new s,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,n=i.getPipelineState();this._setRenderState(e),this._drawIcons(e,a,l),this._drawText(e,a,l),i.setPipelineState(n)}_drawIcons(t,a,n){const{context:s,displayLevel:o,drawPhase:r,spriteMosaic:c,state:u,styleLayerUID:h}=t,p=a.iconMaterial;let y,d=!1;for(const e of n)if(e.layerData.has(h)&&(y=e.layerData.get(h),y.iconPerPageElementsMap.size>0)){d=!0;break}if(!d)return;const g=a.getPaintValue("icon-translate",o),f=a.getPaintValue("icon-translate-anchor",o);let m=a.getLayoutValue("icon-rotation-alignment",o);2===m&&(m=0===a.getLayoutValue("symbol-placement",o)?1:0);const M=0===m,x=a.getLayoutValue("icon-keep-upright",o)&&M,P=y.isIconSDF,v={transform:{dvsMat3:null,displayViewMat3:0===m?u.displayViewMat3:u.displayMat3,displayMat3:1===f?u.displayMat3:u.displayViewMat3,mapRotation:l(u.rotation)},config:{depth:a.z,iconTranslation:g,level:10*o,keepUpright:x?1:0,fadeDuration:e/1e3,isStencilPass:t.stencilSymbols?1:0,time:null,tileOpacity:1},page:{mosaicSize:null,texture:{texture:null,unit:i}},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 w=-1;for(const e of n){if(!e.layerData.has(h))continue;if(e.key.level!==w){w=e.key.level;const t=p.getUniforms();for(const e of t){const t=e.getValue(a,o,w,c);v[e.name]={value:t}}}if(y=e.layerData.get(h),0===y.iconPerPageElementsMap.size)continue;if(this._iconMesh=y.getMesh(s,{value:0}),!this._iconMesh)continue;y.updateOpacityInfo(),v.transform.dvsMat3=e.transforms.displayViewScreenMat3,v.config.time=(performance.now()-y.lastOpacityUpdate)/1e3,v.config.tileOpacity=1===r?e.fader.value():1;let i=0;for(const[a,l]of y.iconPerPageElementsMap)this._renderIconRange(t,p,l,a,e,v,this._iconMesh,P,i++)}}_drawText(t,i,n){const{context:s,displayLevel:o,drawPhase:c,glyphMosaic:u,spriteMosaic:h,pixelRatio:p,state:y,styleLayerUID:d,requestRender:g,allowDelayedRender:f}=t,m=i.textMaterial;let M,x=!1;for(const e of n)if(e.layerData.has(d)&&(M=e.layerData.get(d),M.glyphPerPageElementsMap.size>0)){x=!0;break}if(!x)return;const P=i.getPaintProperty("text-opacity");if(P&&!P.isDataDriven&&0===P.getValue(o))return;const v=i.getPaintProperty("text-color"),w=v&&v.getValue(o),D=!v||v.isDataDriven||w&&4===w.length&&w[3]>0,_=i.getPaintProperty("text-halo-width"),V=i.getPaintProperty("text-halo-color"),S=V&&V.getValue(o),z=(!_||_.isDataDriven||_.getValue(o)>0)&&(!V||V.isDataDriven||S&&4===S.length&&S[3]>0);if(!D&&!z)return;const b=24/8;let R=i.getLayoutValue("text-rotation-alignment",o);2===R&&(R=0===i.getLayoutValue("symbol-placement",o)?1:0);const T=0===R,U=i.getLayoutValue("text-keep-upright",o)&&T,k=.8*b/p;this._glyphTextureSize||(this._glyphTextureSize=[u.width/4,u.height/4]);const L=i.getPaintValue("text-translate",o),I=i.getPaintValue("text-translate-anchor",o);if(f&&null!=g)return void g();const C={transform:{dvsMat3:null,displayViewMat3:0===R?y.displayViewMat3:y.displayMat3,displayMat3:1===I?y.displayMat3:y.displayViewMat3,mapRotation:l(y.rotation)},config:{depth:i.z+r,textTranslation:L,keepUpright:U?1:0,level:10*o,fadeDuration:e/1e3,antialiasingWidth:k,time:null,halo:null,isStencilPass:t.stencilSymbols?1:0,tileOpacity:1},page:{mosaicSize:null,texture:{texture:null,unit:a}},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 O=-1;for(const e of n){if(!e.layerData.has(d))continue;if(e.key.level!==O){O=e.key.level;const t=m.getUniforms();for(const e of t){const t=e.getValue(i,o,O,h);e.name in C&&(C[e.name]={value:t})}}if(M=e.layerData.get(d),0===M.glyphPerPageElementsMap.size)continue;if(C.transform.dvsMat3=e.transforms.displayViewScreenMat3,C.config.time=(performance.now()-M.lastOpacityUpdate)/1e3,C.config.tileOpacity=1===c?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,z,D,e,C,m,this._textMesh,a++)})}}_renderIconRange(e,a,l,n,s,o,r,c,u){const{context:h,is3D:p,painter:y,spriteMosaic:d}=e,g={iconType:c?1:0},f=a.key+t(g);d.bind(h,9729,n,i),o.page={mosaicSize:[d.getWidth(n)/4,d.getHeight(n)/4],texture:{texture:d.getTexture(n),unit:i}};const m={shader:this.shaders.icon,uniforms:o,defines:g,optionalAttributes:a.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:a.getPrecisionFactors(),materialKey:f};y.submitDrawMeshUntyped(h,m,r,{stencilRef:p?s.stencilRef:255,parts:[u]}),s.triangleCount+=l[1]/3}_renderGlyphRange(e,t,i,l,n,s,o,r,c,u){const{context:h,is3D:p,painter:y,glyphMosaic:d}=e;d.bind(h,9729,i,a),o.page={mosaicSize:this._glyphTextureSize,texture:{texture:d.getTexture(h,i),unit:a}};const g={shader:this.shaders.text,uniforms:o,defines:null,optionalAttributes:r.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:r.getPrecisionFactors(),materialKey:r.key};l&&(o.config.halo=1,y.submitDrawMeshUntyped(h,g,c,{stencilRef:p?s.stencilRef:255,parts:[u]}),s.triangleCount+=t[1]/3),n&&(o.config.halo=0,y.submitDrawMeshUntyped(h,g,c,{stencilRef:p?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};