@arcgis/core 4.24.0-next.20220401 → 4.24.0-next.20220402
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/b1188ca77b975c6a7d92.js +1 -0
- package/core/accessorSupport/Property.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/flow/BrushFlow.js +1 -1
- package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/imagery/BrushVectorField.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushBitmap.js +1 -1
- package/views/2d/engine/webgl/brushes/BrushClip.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushInfo.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushStencil.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
- package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/assets/esri/core/workers/chunks/5682039666f874836451.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e,isNone as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{WGLGeometryType as n,WGLDrawPhase as o}from"./enums.js";import a from"./MaterialManager.js";import h from"./TextureManager.js";import{AnimationEffect as f}from"./effects/AnimationEffect.js";import{BlendEffect as l}from"./effects/BlendEffect.js";import{FeatureEffect as c}from"./effects/FeatureEffect.js";import _ from"./effects/HighlightEffect.js";import{HittestEffect as d}from"./effects/HittestEffect.js";import{HittestEffectVTL as b}from"./effects/HittestEffectVTL.js";import{EffectManager as g}from"./effects/post-processing/EffectManager.js";import u from"./painter/RenderPass.js";import{TextureType as E,PixelFormat as p,PixelType as m,TextureSamplingMode as T,TextureWrapMode as M,TargetType as F,DepthStencilTargetType as R,RenderbufferFormat as w,BlendFactor as C}from"../../../webgl/enums.js";import{FramebufferObject as B}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as O}from"../../../webgl/Renderbuffer.js";const S={[n.FILL]:s.fill,[n.LINE]:s.line,[n.MARKER]:s.marker,[n.TEXT]:s.text};class P{constructor(e,t,s){this.context=e,this._blitRenderer=new i,this._brushCache=new Map,this._vtlMaterialManager=new r,this._blendEffect=new l,this._fboPool=[],this.effects={highlight:new _,hittest:new d,hittestVTL:new b,integrate:new f,insideEffect:new c("inside"),outsideEffect:new c("outside")},this.materialManager=new a(e),this.textureManager=new h(t,s),this._effectsManager=new g
|
|
5
|
+
import{isSome as e,isNone as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{WGLGeometryType as n,WGLDrawPhase as o}from"./enums.js";import a from"./MaterialManager.js";import h from"./TextureManager.js";import{AnimationEffect as f}from"./effects/AnimationEffect.js";import{BlendEffect as l}from"./effects/BlendEffect.js";import{FeatureEffect as c}from"./effects/FeatureEffect.js";import _ from"./effects/HighlightEffect.js";import{HittestEffect as d}from"./effects/HittestEffect.js";import{HittestEffectVTL as b}from"./effects/HittestEffectVTL.js";import{EffectManager as g}from"./effects/post-processing/EffectManager.js";import u from"./painter/RenderPass.js";import{TextureType as E,PixelFormat as p,PixelType as m,TextureSamplingMode as T,TextureWrapMode as M,TargetType as F,DepthStencilTargetType as R,RenderbufferFormat as w,BlendFactor as C}from"../../../webgl/enums.js";import{FramebufferObject as B}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as O}from"../../../webgl/Renderbuffer.js";const S={[n.FILL]:s.fill,[n.LINE]:s.line,[n.MARKER]:s.marker,[n.TEXT]:s.text};class P{constructor(e,t,s){this.context=e,this._blitRenderer=new i,this._brushCache=new Map,this._vtlMaterialManager=new r,this._blendEffect=new l,this._fboPool=[],this.effects={highlight:new _,hittest:new d,hittestVTL:new b,integrate:new f,insideEffect:new c("inside"),outsideEffect:new c("outside")},this.materialManager=new a(e),this.textureManager=new h(t,s),this._effectsManager=new g}get vectorTilesMaterialManager(){return this._vtlMaterialManager}getRenderTarget(){return this._renderTarget}setRenderTarget(e){this._renderTarget=e}getFbos(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){for(const s in this._fbos)this._fbos[s].resize(e,t);return this._fbos}const s={target:E.TEXTURE_2D,pixelFormat:p.RGBA,dataType:m.UNSIGNED_BYTE,samplingMode:T.NEAREST,wrapMode:M.CLAMP_TO_EDGE,width:e,height:t},r={colorTarget:F.TEXTURE,depthStencilTarget:R.DEPTH_STENCIL_RENDER_BUFFER},i=new O(this.context,{width:e,height:t,internalFormat:w.DEPTH_STENCIL});this._stencilBuf=i,this._fbos={output:new B(this.context,r,s,i),blend:new B(this.context,r,s,i),effect0:new B(this.context,r,s,i)}}return this._fbos}acquireFbo(e,t){let s;s=this._fboPool.length>0?this._fboPool.pop():new B(this.context,{colorTarget:F.TEXTURE,depthStencilTarget:R.DEPTH_STENCIL_RENDER_BUFFER},{target:E.TEXTURE_2D,pixelFormat:p.RGBA,dataType:m.UNSIGNED_BYTE,samplingMode:T.NEAREST,wrapMode:M.CLAMP_TO_EDGE,width:e,height:t},this._stencilBuf);const r=s.descriptor;return r.width===e&&r.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderLayers(t,s=null){const{width:r,height:i}=t.getViewport();this._prevFBO=t.getBoundFramebufferObject();const n=this.getFbos(r,i);if(t.bindFramebuffer(n.output),t.setColorMask(!0,!0,!0,!0),t.setDepthWriteEnabled(!0),e(s)){const{r:e,g:r,b:i,a:n}=s.color;t.setClearColor(n*e/255,n*r/255,n*i/255,n)}else t.setClearColor(0,0,0,0);t.setClearDepth(1),t.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT),t.setDepthWriteEnabled(!1)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,requireFBO:o,drawPhase:a}=e;if(o||N(a,i,n,s))r.bindFramebuffer(this._fbos.blend),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1);else{const e=this._getOutputFBO();r.bindFramebuffer(e)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(r.gl.STENCIL_BUFFER_BIT)}compositeLayer(s,r){const{context:i,blendMode:n,effects:a,requireFBO:h,drawPhase:f}=s;if(h||N(f,n,a,r)){e(a)&&a.length>0&&f===o.MAP&&this._applyEffects(s,a);const h=this._getOutputFBO();i.bindFramebuffer(h),i.setStencilTestEnabled(!1),i.setStencilWriteMask(0),i.setBlendingEnabled(!0),i.setBlendFunctionSeparate(C.ONE,C.ONE_MINUS_SRC_ALPHA,C.ONE,C.ONE_MINUS_SRC_ALPHA),i.setColorMask(!0,!0,!0,!0);const l=t(n)||f===o.HIGHLIGHT?"normal":n;this._blendEffect.draw(s,this._fbos.blend.colorTexture,T.NEAREST,l,r)}}renderLayers(e){if(e.bindFramebuffer(this._prevFBO),!this._fbos)return;const t=this._getOutputFBO();e.setStencilTestEnabled(!1),e.setStencilWriteMask(0),this.blitTexture(e,t.colorTexture,T.NEAREST)}dispose(){if(this.materialManager.dispose(),this.textureManager.dispose(),this._blitRenderer&&(this._blitRenderer.dispose(),this._blitRenderer=null),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos)for(const e in this._fbos)this._fbos[e]&&this._fbos[e].dispose();for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects)for(const e in this.effects)this.effects[e]&&this.effects[e].dispose();this._effectsManager.dispose(),this._vtlMaterialManager&&(this._vtlMaterialManager.dispose(),this._vtlMaterialManager=null),this._prevFBO=null}getGeometryBrush(e){const t=S[e];let s=this._brushCache.get(t);return void 0===s&&(s=new t,this._brushCache.set(t,s)),this._brushCache.get(t)}renderObject(e,t,r,i){const n=s[r];if(!n)return null;let o=this._brushCache.get(n);void 0===o&&(o=new n,this._brushCache.set(n,o)),o.prepareState(e,t,i),o.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return null;let o=this._brushCache.get(n);void 0===o&&(o=new n,this._brushCache.set(n,o)),o.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new u(t,e)}setHighlightOptions(e){this.effects.highlight.setHighlightOptions(e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(C.ONE,C.ONE_MINUS_SRC_ALPHA,C.ONE,C.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r)}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}_getOutputFBO(){return null!=this._renderTarget?this._renderTarget:this._fbos.output}_applyEffects(e,t){const{context:s}=e,r=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:i,effect:n}of r)s.bindFramebuffer(this._fbos.blend),i.draw(e,this._fbos.blend,n)}}function N(t,s,r,i){return t!==o.HIGHLIGHT&&(1!==i||e(s)&&"normal"!==s||e(r)&&r.length>0)}export{P as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{isSome as e}from"../../../../../core/maybe.js";import{TEXTURE_BINDING_BITMAP as t}from"../definitions.js";import i from"../VertexStream.js";import s from"./WGLBrush.js";import{TextureSamplingMode as n,BlendFactor as r,CompareFunction as o}from"../../../../webgl/enums.js";const a={nearest:{defines:[],samplingMode:n.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:n.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:n.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:n.LINEAR_MIPMAP_LINEAR,mips:!0}},d=(e,t,i)=>{if("dynamic"===i.samplingMode){const{state:i}=e,s=t.resolution/t.pixelRatio/i.resolution,n=Math.round(e.pixelRatio)!==e.pixelRatio,r=s>1.05||s<.95;return i.rotation||r||n||t.isSourceScaled||t.rotation?a.bilinear:a.nearest}return a[i.samplingMode]};class m extends s{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_position",0],["a_texcoord",1]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e},t){e.setBlendingEnabled(!0),"additive"===t.blendFunction?e.setBlendFunctionSeparate(r.ONE,r.ONE,r.ONE,r.ONE):e.setBlendFunctionSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilFunction(o.EQUAL,t.stencilRef,255)}draw(s,n){const{context:r,renderingOptions:o,painter:a,requestRender:m}=s;if(!n.source)return;const c=d(s,n,o),l=a.materialManager.getProgram(this._desc,c.defines);if(e(m)&&!l.isCompiled)return void m();s.timeline.begin(this.name),this._quad||(this._quad=new i(r,[0,0,1,0,0,1,1,1]));const{coordScale:p,computedOpacity:u,transforms:f}=n;n.setSamplingProfile(c),n.bind(s.context,t),r.useProgram(l),l.setUniformMatrix3fv("u_dvsMat3",f.dvs),l.setUniform1i("u_texture",t),l.setUniform2fv("u_coordScale",p),l.setUniform1f("u_opacity",u),this._quad.draw(),s.timeline.end(this.name)}}export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as r}from"../../../../../core/maybe.js";import{f as
|
|
5
|
+
import{isNone as r,isSome as t}from"../../../../../core/maybe.js";import{f as e}from"../../../../../chunks/vec4f32.js";import{createProgramDescriptor as s}from"../Utils.js";import o from"./WGLBrush.js";import{background as i}from"../shaders/BackgroundPrograms.js";import{StencilOperation as a,CompareFunction as m,DataType as n,PrimitiveType as p}from"../../../../webgl/enums.js";import{createProgram as l}from"../../../../webgl/ProgramTemplate.js";const c=()=>s("clip",{geometry:[{location:0,name:"a_pos",count:2,type:n.SHORT}]});class f extends o{constructor(){super(...arguments),this._color=e(0,1,0,1)}dispose(){this._program&&this._program.dispose()}prepareState({context:r}){r.setStencilTestEnabled(!0),r.setBlendingEnabled(!1),r.setFaceCullingEnabled(!1),r.setColorMask(!1,!1,!1,!1),r.setStencilOp(a.KEEP,a.KEEP,a.REPLACE),r.setStencilWriteMask(255),r.setStencilFunction(m.ALWAYS,0,255)}draw(e,s){const{context:o,state:a,requestRender:m}=e,f=c(),d=s.getVAO(o,a,f.attributes,f.bufferLayouts);r(d.indexBuffer)||(this._program||(this._program=l(o,i)),!t(m)||this._program.isCompiled?(o.useProgram(this._program),this._program.setUniform2fv("u_coord_range",[1,1]),this._program.setUniform4fv("u_color",this._color),this._program.setUniformMatrix3fv("u_dvsMat3",a.displayMat3),o.bindVAO(d),o.drawElements(p.TRIANGLES,d.indexBuffer.size,n.UNSIGNED_INT,0),o.bindVAO()):m())}}export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{isSome as t}from"../../../../../core/maybe.js";import{f as e}from"../../../../../chunks/vec4f32.js";import{Pos2b as r}from"../DefaultVertexAttributeLayouts.js";import i from"./WGLBrush.js";import{background as o}from"../shaders/BackgroundPrograms.js";import{tileInfo as s}from"../shaders/TileInfoPrograms.js";import{BufferObject as n}from"../../../../webgl/BufferObject.js";import{BlendFactor as a,PrimitiveType as l,Usage as u,TextureType as m,PixelFormat as _,PixelType as f,TextureSamplingMode as h,TextureWrapMode as c}from"../../../../webgl/enums.js";import{createProgram as g}from"../../../../webgl/ProgramTemplate.js";import{Texture as d}from"../../../../webgl/Texture.js";import{VertexArrayObject as p}from"../../../../webgl/VertexArrayObject.js";const A=300,b=32;class x extends i{constructor(){super(...arguments),this._color=e(1,0,0,1)}dispose(){this._outlineProgram&&(this._outlineProgram.dispose(),this._outlineProgram=null),this._tileInfoProgram&&(this._tileInfoProgram.dispose(),this._tileInfoProgram=null),this._outlineVertexArrayObject&&(this._outlineVertexArrayObject.dispose(),this._outlineVertexArrayObject=null),this._tileInfoVertexArrayObject&&(this._tileInfoVertexArrayObject.dispose(),this._tileInfoVertexArrayObject=null),this._canvas=null}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(a.ONE,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1)}draw(e,r){const{context:i,requestRender:o}=e;if(!r.isReady)return;if(this._loadWGLResources(i),t(o)&&(!this._outlineProgram.isCompiled||!this._tileInfoProgram.isCompiled))return void o();i.bindVAO(this._outlineVertexArrayObject),i.useProgram(this._outlineProgram),this._outlineProgram.setUniformMatrix3fv("u_dvsMat3",r.transforms.dvs),this._outlineProgram.setUniform2f("u_coord_range",r.rangeX,r.rangeY),this._outlineProgram.setUniform1f("u_depth",0),this._outlineProgram.setUniform4fv("u_color",this._color),i.drawArrays(l.LINE_STRIP,0,4);const s=this._getTexture(i,r);s?(i.bindVAO(this._tileInfoVertexArrayObject),i.useProgram(this._tileInfoProgram),i.bindTexture(s,0),this._tileInfoProgram.setUniformMatrix3fv("u_dvsMat3",r.transforms.dvs),this._tileInfoProgram.setUniform1f("u_depth",0),this._tileInfoProgram.setUniform2f("u_coord_ratio",r.rangeX/r.width,r.rangeY/r.height),this._tileInfoProgram.setUniform2f("u_delta",8,8),this._tileInfoProgram.setUniform2f("u_dimensions",s.descriptor.width,s.descriptor.height),i.drawArrays(l.TRIANGLE_STRIP,0,4),i.bindVAO()):i.bindVAO()}_loadWGLResources(t){if(this._outlineProgram&&this._tileInfoProgram)return;const e=g(t,o),i=g(t,s),a=new Int8Array([0,0,1,0,1,1,0,1]),l=n.createVertex(t,u.STATIC_DRAW,a),m=new p(t,o.attributes,r,{geometry:l}),_=new Int8Array([0,0,1,0,0,1,1,1]),f=n.createVertex(t,u.STATIC_DRAW,_),h=new p(t,s.attributes,r,{geometry:f});this._outlineProgram=e,this._tileInfoProgram=i,this._outlineVertexArrayObject=m,this._tileInfoVertexArrayObject=h}_getTexture(t,e){if(e.texture&&e.triangleCountReportedInDebug===e.triangleCount)return e.texture;e.triangleCountReportedInDebug=e.triangleCount,this._canvas||(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","canvas2d"),this._canvas.setAttribute("width",`${A}`),this._canvas.setAttribute("height",`${b}`),this._canvas.setAttribute("style","display:none"));const r=e.triangleCount;let i=e.key.id;e.triangleCount>0&&(i+=`, ${r}`);const o=this._canvas,s=o.getContext("2d");return s.font="24px sans-serif",s.textAlign="left",s.textBaseline="top",s.clearRect(0,0,A,b),r>1e5?(s.fillStyle="red",s.fillRect(0,0,A,b),s.fillStyle="black"):(s.clearRect(0,0,A,b),s.fillStyle="blue"),s.fillText(i,0,0),e.texture=new d(t,{target:m.TEXTURE_2D,pixelFormat:_.RGBA,dataType:f.UNSIGNED_BYTE,samplingMode:h.NEAREST,wrapMode:c.CLAMP_TO_EDGE},o),e.texture}}export{x as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{f as t}from"../../../../../chunks/vec4f32.js";import{Pos2b as
|
|
5
|
+
import{isSome as r}from"../../../../../core/maybe.js";import{f as t}from"../../../../../chunks/vec4f32.js";import{Pos2b as e}from"../DefaultVertexAttributeLayouts.js";import i from"./WGLBrush.js";import{background as s}from"../shaders/BackgroundPrograms.js";import{BufferObject as o}from"../../../../webgl/BufferObject.js";import{StencilOperation as a,Face as l,CompareFunction as n,PrimitiveType as d,Usage as m}from"../../../../webgl/enums.js";import{createProgram as _}from"../../../../webgl/ProgramTemplate.js";import{VertexArrayObject as c}from"../../../../webgl/VertexArrayObject.js";class h extends i{constructor(){super(...arguments),this._color=t(1,0,0,1),this._initialized=!1}dispose(){this._solidProgram&&(this._solidProgram.dispose(),this._solidProgram=null),this._solidVertexArrayObject&&(this._solidVertexArrayObject.dispose(),this._solidVertexArrayObject=null)}prepareState({context:r},t){r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setBlendingEnabled(!1),r.setColorMask(!1,!1,!1,!1),r.setStencilOp(a.KEEP,a.KEEP,a.REPLACE),r.setStencilWriteMask(255),r.setStencilFunctionSeparate(l.FRONT_AND_BACK,n.GREATER,t.stencilRef,255)}draw(t,e){const{context:i,requestRender:s}=t;this._initialized||this._initialize(i),!r(s)||this._solidProgram.isCompiled?(i.bindVAO(this._solidVertexArrayObject),i.useProgram(this._solidProgram),this._solidProgram.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),this._solidProgram.setUniform2fv("u_coord_range",[e.rangeX,e.rangeY]),this._solidProgram.setUniform1f("u_depth",0),this._solidProgram.setUniform4fv("u_color",this._color),i.drawArrays(d.TRIANGLE_STRIP,0,4),i.bindVAO()):s()}_initialize(r){if(this._initialized)return!0;const t=_(r,s);if(!t)return!1;const i=new Int8Array([0,0,1,0,0,1,1,1]),a=o.createVertex(r,m.STATIC_DRAW,i),l=new c(r,s.attributes,e,{geometry:a});return this._solidProgram=t,this._solidVertexArrayObject=l,this._initialized=!0,!0}}export{h as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{nextPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{isSome as r}from"../../../../../core/maybe.js";import{c as
|
|
5
|
+
import{nextPowerOfTwo as t}from"../../../../../core/mathUtils.js";import{isSome as r}from"../../../../../core/maybe.js";import{c as e}from"../../../../../chunks/mat3f32.js";import{f as o}from"../../../../../chunks/vec4f32.js";import{VTL_TEXTURE_BINDING_UNIT_SPRITES as i,VTL_HIGH_RES_CUTOFF as s}from"../definitions.js";import{WGLDrawPhase as a}from"../enums.js";import{u32to4Xu8 as n}from"../number.js";import c from"./WGLBrush.js";import{BufferObject as m}from"../../../../webgl/BufferObject.js";import{TextureSamplingMode as f,CompareFunction as l,PrimitiveType as u,Usage as p}from"../../../../webgl/enums.js";import{VertexArrayObject as _}from"../../../../webgl/VertexArrayObject.js";class d extends c{constructor(){super(...arguments),this._color=o(1,0,0,1),this._patternMatrix=e(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,o){const{context:c,painter:m,styleLayerUID:p,requestRender:_}=e;this._loadWGLResources(e);const d=e.displayLevel,h=e.styleLayer,g=h.backgroundMaterial,v=m.vectorTilesMaterialManager,b=h.getPaintValue("background-color",d),y=h.getPaintValue("background-opacity",d),M=h.getPaintValue("background-pattern",d),x=void 0!==M,j=b[3]*y,U=1|window.devicePixelRatio,L=e.spriteMosaic;let w,A;const P=U>s?2:1,I=e.drawPhase===a.HITTEST,R=this._programOptions;R.id=I,R.pattern=x;const k=v.getMaterialProgram(c,g,R);if(!r(_)||I||k.isCompiled){if(c.bindVAO(this._vao),c.useProgram(k),x){const t=L.getMosaicItemPosition(M,!0);if(r(t)){const{tl:e,br:o,page:s}=t;w=o[0]-e[0],A=o[1]-e[1];const a=L.getPageSize(s);r(a)&&(L.bind(c,f.LINEAR,s,i),k.setUniform4f("u_tlbr",e[0],e[1],o[0],o[1]),k.setUniform2fv("u_mosaicSize",a),k.setUniform1i("u_texture",i))}k.setUniform1f("u_opacity",y)}else this._color[0]=j*b[0],this._color[1]=j*b[1],this._color[2]=j*b[2],this._color[3]=j,k.setUniform4fv("u_color",this._color);if(k.setUniform1f("u_depth",h.z||0),I){const t=n(p+1);k.setUniform4fv("u_id",t)}for(const r of o){if(k.setUniform1f("u_coord_range",r.rangeX),k.setUniformMatrix3fv("u_dvsMat3",r.transforms.dvs),x){const e=Math.max(2**(Math.round(d)-r.key.level),1),o=P*r.width*e,i=o/t(w),s=o/t(A);this._patternMatrix[0]=i,this._patternMatrix[4]=s,k.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}c.setStencilFunction(l.EQUAL,r.stencilRef,255),c.drawArrays(u.TRIANGLE_STRIP,0,4)}}else _()}_loadWGLResources(t){if(this._vao)return;const{context:r,styleLayer:e}=t,o=e.backgroundMaterial,i=new Int8Array([0,0,1,0,0,1,1,1]),s=m.createVertex(r,p.STATIC_DRAW,i),a=new _(r,o.getAttributeLocations(),o.getLayoutInfo(),{geometry:s});this._vao=a}}export{d as WGLBrushVTLBackground};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as
|
|
5
|
+
import{isSome as e,isNone as t}from"../../../../../core/maybe.js";import{TranslateAnchor as r}from"../../vectorTiles/style/StyleDefinition.js";import{WGLDrawPhase as i}from"../enums.js";import{u32to4Xu8 as n}from"../number.js";import a from"./WGLBrush.js";import{CompareFunction as s,PrimitiveType as o,DataType as l}from"../../../../webgl/enums.js";class c extends a{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(a,c){const{context:m,displayLevel:u,requiredLevel:f,state:d,drawPhase:p,painter:y,spriteMosaic:v,styleLayerUID:g,requestRender:E}=a;if(!c.some((e=>{var t,r;return null!=(t=null==(r=e.layerData.get(g))?void 0:r.circleIndexCount)&&t})))return;const M=a.styleLayer,T=M.circleMaterial,x=y.vectorTilesMaterialManager,I=1.2,U=M.getPaintValue("circle-translate",u),_=M.getPaintValue("circle-translate-anchor",u),h=p===i.HITTEST,L=this._programOptions;L.id=h;const R=x.getMaterialProgram(m,T,L);if(!h&&e(E)&&!R.isCompiled)return void E();m.useProgram(R),R.setUniformMatrix3fv("u_displayMat3",_===r.VIEWPORT?d.displayMat3:d.displayViewMat3),R.setUniform2fv("u_circleTranslation",U),R.setUniform1f("u_depth",M.z),R.setUniform1f("u_antialiasingWidth",I);let S=-1;if(h){const e=n(g+1);R.setUniform4fv("u_id",e)}for(const e of c){if(!e.layerData.has(g))continue;e.key.level!==S&&(S=e.key.level,T.setDataUniforms(R,u,M,S,v));const r=e.layerData.get(g);if(!r.circleIndexCount)continue;r.prepareForRendering(m);const i=r.circleVertexArrayObject;t(i)||(m.bindVAO(i),R.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),f!==e.key.level?m.setStencilFunction(s.EQUAL,e.stencilRef,255):m.setStencilFunction(s.GREATER,255,255),m.drawElements(o.TRIANGLES,r.circleIndexCount,l.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r.circleIndexStart),e.triangleCount+=r.circleIndexCount/3)}}}export{c as WGLBrushVTLCircle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t,isSome as e}from"../../../../../core/maybe.js";import{TranslateAnchor as i}from"../../vectorTiles/style/StyleDefinition.js";import{VTL_TEXTURE_BINDING_UNIT_SPRITES as
|
|
5
|
+
import{isNone as t,isSome as e}from"../../../../../core/maybe.js";import{TranslateAnchor as i}from"../../vectorTiles/style/StyleDefinition.js";import{VTL_TEXTURE_BINDING_UNIT_SPRITES as n,VTL_HIGH_RES_CUTOFF as r}from"../definitions.js";import{WGLDrawPhase as a}from"../enums.js";import{u32to4Xu8 as o}from"../number.js";import s from"./WGLBrush.js";import{TextureSamplingMode as l,CompareFunction as f,PrimitiveType as u,DataType as d}from"../../../../webgl/enums.js";const c=1/65536;class m extends s{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(t,e){const{displayLevel:i,drawPhase:n,renderPass:r,spriteMosaic:s,styleLayerUID:l}=t;let f=!1;for(const a of e)if(a.layerData.has(l)){const t=a.layerData.get(l);if(t.fillIndexCount>0||t.outlineIndexCount>0){f=!0;break}}if(!f)return;const u=t.styleLayer,d=u.getPaintProperty("fill-pattern"),c=void 0!==d,m=c&&d.isDataDriven;let p;if(c&&!m){const t=d.getValue(i);p=s.getMosaicItemPosition(t,!0)}const y=!c&&u.getPaintValue("fill-antialias",i);let g=!0,_=1;if(!c){const t=u.getPaintProperty("fill-color"),e=u.getPaintProperty("fill-opacity");if(!(null!=t&&t.isDataDriven||null!=e&&e.isDataDriven)){const t=u.getPaintValue("fill-color",i);_=u.getPaintValue("fill-opacity",i)*t[3],_>=1&&(g=!1)}}if(g&&"opaque"===r)return;let E;n===a.HITTEST&&(E=o(l+1));const v=u.getPaintValue("fill-translate",i),M=u.getPaintValue("fill-translate-anchor",i);(g||"translucent"!==r)&&this._drawFill(t,l,u,e,v,M,c,p,m,E);const P=!u.hasDataDrivenOutlineColor&&u.outlineUsesFillColor&&_<1;y&&"opaque"!==r&&!P&&this._drawOutline(t,l,u,e,v,M,E)}_drawFill(o,s,m,p,y,g,_,E,v,M){if(_&&!v&&t(E))return;const{context:P,displayLevel:I,state:T,drawPhase:U,painter:x,pixelRatio:h,spriteMosaic:D,requestRender:S}=o,R=m.fillMaterial,N=x.vectorTilesMaterialManager,w=h>r?2:1,L=U===a.HITTEST,A=this._fillProgramOptions;A.id=L,A.pattern=_;const C=N.getMaterialProgram(P,R,A);if(e(S)&&!L&&!C.isCompiled)return void S();if(P.useProgram(C),e(E)){const{page:t}=E,i=D.getPageSize(t);e(i)&&(D.bind(P,l.LINEAR,t,n),C.setUniform2fv("u_mosaicSize",i),C.setUniform1i("u_texture",n))}C.setUniformMatrix3fv("u_displayMat3",g===i.VIEWPORT?T.displayMat3:T.displayViewMat3),C.setUniform2fv("u_fillTranslation",y),C.setUniform1f("u_depth",m.z+c),L&&C.setUniform4fv("u_id",M);let V=-1;for(const i of p){if(!i.layerData.has(s))continue;i.key.level!==V&&(V=i.key.level,R.setDataUniforms(C,I,m,V,D));const r=i.layerData.get(s);if(!r.fillIndexCount)continue;r.prepareForRendering(P);const a=r.fillVertexArrayObject;if(!t(a)){if(P.bindVAO(a),C.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs),P.setStencilFunction(f.EQUAL,i.stencilRef,255),_){const t=Math.max(2**(Math.round(I)-i.key.level),1),e=i.rangeX/(w*i.width*t);C.setUniform1f("u_patternFactor",e)}if(v){const t=r.patternMap;if(!t)continue;for(const[i,r]of t){const t=D.getPageSize(i);e(t)&&(D.bind(P,l.LINEAR,i,n),C.setUniform2fv("u_mosaicSize",t),C.setUniform1i("u_texture",n),P.drawElements(u.TRIANGLES,r[1],d.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r[0]))}}else P.drawElements(u.TRIANGLES,r.fillIndexCount,d.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r.fillIndexStart);i.triangleCount+=r.fillIndexCount/3}}}_drawOutline(n,r,o,s,l,m,p){const{context:y,displayLevel:g,state:_,drawPhase:E,painter:v,pixelRatio:M,spriteMosaic:P,requestRender:I}=n,T=o.outlineMaterial,U=v.vectorTilesMaterialManager,x=.75/M,h=E===a.HITTEST,D=this._outlineProgramOptions;D.id=h;const S=U.getMaterialProgram(y,T,D);if(e(I)&&!h&&!S.isCompiled)return void I();y.useProgram(S),S.setUniformMatrix3fv("u_displayMat3",m===i.VIEWPORT?_.displayMat3:_.displayViewMat3),S.setUniform2fv("u_fillTranslation",l),S.setUniform1f("u_depth",o.z+c),S.setUniform1f("u_outline_width",x),h&&S.setUniform4fv("u_id",p);let R=-1;for(const e of s){if(!e.layerData.has(r))continue;e.key.level!==R&&(R=e.key.level,T.setDataUniforms(S,g,o,R,P));const i=e.layerData.get(r);if(i.prepareForRendering(y),!i.outlineIndexCount)continue;const n=i.outlineVertexArrayObject;t(n)||(y.bindVAO(n),S.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),y.setStencilFunction(f.EQUAL,e.stencilRef,255),y.drawElements(u.TRIANGLES,i.outlineIndexCount,d.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i.outlineIndexStart),e.triangleCount+=i.outlineIndexCount/3)}}}export{m as WGLBrushVTLFill};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e,isNone as t}from"../../../../../core/maybe.js";import{TranslateAnchor as i}from"../../vectorTiles/style/StyleDefinition.js";import{VTL_TEXTURE_BINDING_UNIT_SPRITES as n}from"../definitions.js";import{WGLDrawPhase as
|
|
5
|
+
import{isSome as e,isNone as t}from"../../../../../core/maybe.js";import{TranslateAnchor as i}from"../../vectorTiles/style/StyleDefinition.js";import{VTL_TEXTURE_BINDING_UNIT_SPRITES as n}from"../definitions.js";import{WGLDrawPhase as r}from"../enums.js";import{u32to4Xu8 as a}from"../number.js";import o from"./WGLBrush.js";import{TextureSamplingMode as s,CompareFunction as l,PrimitiveType as f,DataType as m}from"../../../../webgl/enums.js";class u extends o{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(o,u){const{context:c,displayLevel:d,state:p,drawPhase:g,painter:y,pixelRatio:v,spriteMosaic:E,styleLayerUID:M,requestRender:_}=o;if(!u.some((e=>{var t,i;return null!=(t=null==(i=e.layerData.get(M))?void 0:i.lineIndexCount)&&t})))return;const U=o.styleLayer,I=U.lineMaterial,P=y.vectorTilesMaterialManager,x=U.getPaintValue("line-translate",d),T=U.getPaintValue("line-translate-anchor",d),S=U.getPaintProperty("line-pattern"),D=void 0!==S,L=D&&S.isDataDriven;let N,R;if(D&&!L){const e=S.getValue(d);N=E.getMosaicItemPosition(e)}let V=!1;if(!D){const e=U.getPaintProperty("line-dasharray");if(R=void 0!==e,V=R&&e.isDataDriven,R&&!V){const t=e.getValue(d),i=U.getDashKey(t,U.getLayoutValue("line-cap",d));N=E.getMosaicItemPosition(i)}}const h=1/v,A=g===r.HITTEST,j=this._programOptions;j.id=A,j.pattern=D,j.sdf=R;const w=P.getMaterialProgram(c,I,j);if(e(_)&&!A&&!w.isCompiled)return void _();if(c.useProgram(w),w.setUniformMatrix3fv("u_displayViewMat3",p.displayViewMat3),w.setUniformMatrix3fv("u_displayMat3",T===i.VIEWPORT?p.displayMat3:p.displayViewMat3),w.setUniform2fv("u_lineTranslation",x),w.setUniform1f("u_depth",U.z),w.setUniform1f("u_antialiasing",h),A){const e=a(M+1);w.setUniform4fv("u_id",e)}if(N&&e(N)){const{page:t}=N,i=E.getPageSize(t);e(i)&&(E.bind(c,s.LINEAR,t,n),w.setUniform2fv("u_mosaicSize",i),w.setUniform1i("u_texture",n))}let b=-1;for(const i of u){if(!i.layerData.has(M))continue;i.key.level!==b&&(b=i.key.level,I.setDataUniforms(w,d,U,b,E));const r=2**(d-b)/v;w.setUniform1f("u_zoomFactor",r);const a=i.layerData.get(M);if(!a.lineIndexCount)continue;a.prepareForRendering(c);const o=a.lineVertexArrayObject;if(!t(o)){if(c.bindVAO(o),w.setUniformMatrix3fv("u_dvsMat3",i.transforms.dvs),c.setStencilFunction(l.EQUAL,i.stencilRef,255),L||V){const t=a.patternMap;if(!t)continue;for(const[i,r]of t){const t=E.getPageSize(i);e(t)&&(E.bind(c,s.LINEAR,i,n),w.setUniform2fv("u_mosaicSize",t),w.setUniform1i("u_texture",n),c.drawElements(f.TRIANGLES,r[1],m.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*r[0]))}}else c.drawElements(f.TRIANGLES,a.lineIndexCount,m.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*a.lineIndexStart);i.triangleCount+=a.lineIndexCount/3}}}}export{u as WGLBrushVTLLine};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as
|
|
5
|
+
import{isSome as e,isNone as t}from"../../../../../core/maybe.js";import{c as i,f as a}from"../../../../../chunks/vec2f32.js";import{FADE_DURATION as r}from"../../vectorTiles/decluttering/config.js";import{RotationAlignment as s,SymbolPlacement as n,TranslateAnchor as o}from"../../vectorTiles/style/StyleDefinition.js";import{VTL_TEXTURE_BINDING_UNIT_SPRITES as l,VTL_TEXTURE_BINDING_UNIT_GLYPHS as f}from"../definitions.js";import{WGLDrawPhase as u}from"../enums.js";import{degToByte as m}from"../GeometryUtils.js";import{u32to4Xu8 as p}from"../number.js";import c from"./WGLBrush.js";import{TextureSamplingMode as d,CompareFunction as g,PrimitiveType as y,DataType as _}from"../../../../webgl/enums.js";const h=1/65536;class M extends c{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=i()}dispose(){}drawMany(e,t){const{drawPhase:i,styleLayerUID:a}=e,r=e.styleLayer;let s;i===u.HITTEST&&(s=p(a+1)),this._drawIcons(e,r,t,s),this._drawText(e,r,t,s)}_drawIcons(i,a,f,p){const{context:c,displayLevel:d,drawPhase:g,painter:y,spriteMosaic:_,state:h,styleLayerUID:M,requestRender:P}=i,T=a.iconMaterial,U=y.vectorTilesMaterialManager;let E,x=!1;for(const e of f)if(e.layerData.has(M)&&(E=e.layerData.get(M),E.iconPerPageElementsMap.size>0)){x=!0;break}if(!x)return;const v=a.getPaintValue("icon-translate",d),I=a.getPaintValue("icon-translate-anchor",d);let S=a.getLayoutValue("icon-rotation-alignment",d);S===s.AUTO&&(S=a.getLayoutValue("symbol-placement",d)===n.POINT?s.VIEWPORT:s.MAP);const D=S===s.MAP,V=a.getLayoutValue("icon-keep-upright",d)&&D,R=E.isIconSDF,w=g===u.HITTEST,A=this._iconProgramOptions;A.id=w,A.sdf=R;const L=U.getMaterialProgram(c,T,A);if(e(P)&&!w&&!L.isCompiled)return void P();c.useProgram(L),L.setUniformMatrix3fv("u_displayViewMat3",S===s.MAP?h.displayViewMat3:h.displayMat3),L.setUniformMatrix3fv("u_displayMat3",I===o.VIEWPORT?h.displayMat3:h.displayViewMat3),L.setUniform2fv("u_iconTranslation",v),L.setUniform1f("u_depth",a.z),L.setUniform1f("u_mapRotation",m(h.rotation)),L.setUniform1f("u_keepUpright",V?1:0),L.setUniform1f("u_level",10*d),L.setUniform1i("u_texture",l),L.setUniform1f("u_fadeDuration",r/1e3),w&&L.setUniform4fv("u_id",p);let O=-1;for(const e of f){if(!e.layerData.has(M))continue;if(e.key.level!==O&&(O=e.key.level,T.setDataUniforms(L,d,a,O,_)),E=e.layerData.get(M),0===E.iconPerPageElementsMap.size)continue;E.prepareForRendering(c),E.updateOpacityInfo();const r=E.iconVertexArrayObject;if(!t(r)){c.bindVAO(r),L.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),L.setUniform1f("u_time",(performance.now()-E.lastOpacityUpdate)/1e3);for(const[t,a]of E.iconPerPageElementsMap)this._renderIconRange(i,L,a,t,e)}}}_renderIconRange(e,t,i,a,r){const{context:s,spriteMosaic:n}=e;this._spritesTextureSize[0]=n.getWidth(a)/4,this._spritesTextureSize[1]=n.getHeight(a)/4,t.setUniform2fv("u_mosaicSize",this._spritesTextureSize),n.bind(s,d.LINEAR,a,l),s.setStencilTestEnabled(!0),s.setStencilFunction(g.GREATER,255,255),s.setStencilWriteMask(0),s.drawElements(y.TRIANGLES,i[1],_.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),r.triangleCount+=i[1]/3}_drawText(i,l,p,c){const{context:d,displayLevel:y,drawPhase:_,glyphMosaic:M,painter:P,pixelRatio:T,spriteMosaic:U,state:E,styleLayerUID:x,requestRender:v}=i,I=l.textMaterial,S=P.vectorTilesMaterialManager;let D,V=!1;for(const e of p)if(e.layerData.has(x)&&(D=e.layerData.get(x),D.glyphPerPageElementsMap.size>0)){V=!0;break}if(!V)return;const R=l.getPaintProperty("text-opacity");if(R&&!R.isDataDriven&&0===R.getValue(y))return;const w=l.getPaintProperty("text-color"),A=!w||w.isDataDriven||w.getValue(y)[3]>0,L=l.getPaintProperty("text-halo-width"),O=l.getPaintProperty("text-halo-color"),N=(!L||L.isDataDriven||L.getValue(y)>0)&&(!O||O.isDataDriven||O.getValue(y)[3]>0);if(!A&&!N)return;const b=24/8;let z=l.getLayoutValue("text-rotation-alignment",y);z===s.AUTO&&(z=l.getLayoutValue("symbol-placement",y)===n.POINT?s.VIEWPORT:s.MAP);const k=z===s.MAP,j=l.getLayoutValue("text-keep-upright",y)&&k,G=_===u.HITTEST,W=.8*b/T;this._glyphTextureSize||(this._glyphTextureSize=a(M.width/4,M.height/4));const C=l.getPaintValue("text-translate",y),F=l.getPaintValue("text-translate-anchor",y),B=this._sdfProgramOptions;B.id=G;const H=S.getMaterialProgram(d,I,B);if(e(v)&&!G&&!H.isCompiled)return void v();d.useProgram(H),H.setUniformMatrix3fv("u_displayViewMat3",z===s.MAP?E.displayViewMat3:E.displayMat3),H.setUniformMatrix3fv("u_displayMat3",F===o.VIEWPORT?E.displayMat3:E.displayViewMat3),H.setUniform2fv("u_textTranslation",C),H.setUniform1f("u_depth",l.z+h),H.setUniform2fv("u_mosaicSize",this._glyphTextureSize),H.setUniform1f("u_mapRotation",m(E.rotation)),H.setUniform1f("u_keepUpright",j?1:0),H.setUniform1f("u_level",10*y),H.setUniform1i("u_texture",f),H.setUniform1f("u_antialiasingWidth",W),H.setUniform1f("u_fadeDuration",r/1e3),G&&H.setUniform4fv("u_id",c);let Y=-1;for(const e of p){if(!e.layerData.has(x))continue;if(e.key.level!==Y&&(Y=e.key.level,I.setDataUniforms(H,y,l,Y,U)),D=e.layerData.get(x),0===D.glyphPerPageElementsMap.size)continue;D.prepareForRendering(d),D.updateOpacityInfo();const i=D.textVertexArrayObject;if(t(i))continue;d.bindVAO(i),H.setUniformMatrix3fv("u_dvsMat3",e.transforms.dvs),d.setStencilTestEnabled(!0),d.setStencilFunction(g.GREATER,255,255),d.setStencilWriteMask(0);const a=(performance.now()-D.lastOpacityUpdate)/1e3;H.setUniform1f("u_time",a),D.glyphPerPageElementsMap.forEach(((t,i)=>{this._renderGlyphRange(d,t,i,M,H,N,A,e)}))}}_renderGlyphRange(e,t,i,a,r,s,n,o){a.bind(e,d.LINEAR,i,f),s&&(r.setUniform1f("u_halo",1),e.drawElements(y.TRIANGLES,t[1],_.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),o.triangleCount+=t[1]/3),n&&(r.setUniform1f("u_halo",0),e.drawElements(y.TRIANGLES,t[1],_.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),o.triangleCount+=t[1]/3)}}export{M as WGLBrushVTLSymbol};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{disposeMaybe as
|
|
5
|
+
import{disposeMaybe as e,isSome as t,isNone as o}from"../../../../../core/maybe.js";import r from"../../../../../core/RandomLCG.js";import{TEXTURE_BINDING_RENDERER_0 as i,TEXTURE_BINDING_RENDERER_1 as s,TILE_SIZE as n}from"../definitions.js";import{WGLGeometryType as a}from"../enums.js";import{createProgramDescriptor as d}from"../Utils.js";import l from"./WGLGeometryBrush.js";import{FillMaterialKey as m}from"../materialKey/MaterialKey.js";import{BufferObject as u}from"../../../../webgl/BufferObject.js";import{PrimitiveType as _,DataType as c,TextureType as f,PixelFormat as h,PixelType as T,TextureSamplingMode as p,TextureWrapMode as y,TargetType as x,DepthStencilTargetType as D,RenderbufferFormat as g,Usage as E}from"../../../../webgl/enums.js";import{FramebufferObject as S}from"../../../../webgl/FramebufferObject.js";import{Renderbuffer as w}from"../../../../webgl/Renderbuffer.js";import{Texture as U}from"../../../../webgl/Texture.js";import{VertexArrayObject as O}from"../../../../webgl/VertexArrayObject.js";const b=e=>{const t={geometry:[{location:0,name:"a_pos",count:2,type:c.SHORT},{location:1,name:"a_id",count:3,type:c.UNSIGNED_BYTE},{location:2,name:"a_bitset",count:1,type:c.UNSIGNED_BYTE}]};return e.dotDensity?(t.geometry.push({location:3,name:"a_inverseArea",count:1,type:c.FLOAT}),d(e.data,t)):(t.geometry.push({location:3,name:"a_color",count:4,type:c.UNSIGNED_BYTE,normalized:!0}),e.simple||t.geometry.push({location:4,name:"a_aux1",count:4,type:c.UNSIGNED_SHORT}),t.geometry.push({location:5,name:"a_aux2",count:4,type:c.UNSIGNED_BYTE},{location:6,name:"a_aux3",count:4,type:c.UNSIGNED_BYTE}),e.simple||t.geometry.push({location:7,name:"a_zoomRange",count:2,type:c.UNSIGNED_SHORT}),d(e.data,t))};class N extends l{constructor(){super(...arguments),this._dotTextureSize=0,this._dotTextures=null,this._dotSamplers=new Int32Array([i,s]),this._dotVAO=null,this._dotDesc={vsPath:"dot/dot",fsPath:"dot/dot",attributes:new Map([["a_pos",0]])}}dispose(){this._disposeTextures(),this._dotFBO=e(this._dotFBO),this._dotVAO=e(this._dotVAO)}getGeometryType(){return a.FILL}drawGeometry(e,o,r,i){const{context:s,painter:n,rendererInfo:a,requiredLevel:d,passOptions:l,requestRender:u}=e,f=m.load(r.materialKey),h=t(l)&&"hittest"===l.type,T=n.materialManager;let p=_.TRIANGLES,y=b(f);h&&(y=this._getTriangleDesc(r.materialKey,y),p=_.POINTS);const{attributes:x,bufferLayouts:D}=y,g=T.getMaterialProgram(e,f,"materials/fill",x,i);if(t(u)&&!h&&!g.isCompiled)return void u();if(s.useProgram(g),this._setSharedUniforms(g,e,o),g.setUniform2f("u_tileOffset",512*o.key.col,512*o.key.row),f.textureBinding){n.textureManager.bindTextures(s,g,f);const e=1/2**(d-o.key.level);g.setUniform1f("u_zoomFactor",e)}const E=1/e.pixelRatio;g.setUniform1f("u_blur",E),g.setUniform1f("u_antialiasing",E),this._setSizeVVUniforms(f,g,a,o),this._setColorAndOpacityVVUniforms(f,g,a);const S=r.target.getVAO(s,D,x,h);let w=r.indexCount,U=r.indexFrom*Uint32Array.BYTES_PER_ELEMENT;if(h&&(w/=3,U/=3),s.bindVAO(S),!f.dotDensity||h)s.drawElements(p,w,c.UNSIGNED_INT,U);else{const t=this._drawDotLocations(e,o,g,w,U);this._drawDotDensity(e,o,t)}}_drawDotDensity(e,o,r){const{context:i,painter:s,rendererInfo:n,requestRender:a}=e,d=s.materialManager.getProgram(this._dotDesc);if(t(a)&&!d.isCompiled)return void a();const l=this._createDotDensityMesh(i,this._dotDesc.attributes,{geometry:[{name:"a_pos",count:2,type:c.SHORT,divisor:0,normalized:!1,offset:0,stride:4}]});i.setStencilTestEnabled(!0),i.useProgram(d),d.setUniform1f("u_tileZoomFactor",1),d.setUniform1i("u_texture",this._dotSamplers[0]),d.setUniform1f("u_dotSize",Math.max(n.ddDotSize,1)),d.setUniform1f("u_pixelRatio",window.devicePixelRatio),this._setSharedUniforms(d,e,o),i.bindTexture(r,this._dotSamplers[0]),i.bindVAO(l),i.drawArrays(_.POINTS,0,262144)}_drawDotLocations(e,t,o,r,i){const{context:s,rendererInfo:a,requiredLevel:d}=e,l=s.getViewport();s.setViewport(0,0,512,512);const m=s.getBoundFramebufferObject(),u=this._createFBO(s);s.bindFramebuffer(u),s.setClearColor(0,0,0,0),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.STENCIL_BUFFER_BIT),s.setStencilTestEnabled(!1);const f=1/2**(d-t.key.level),h=n,T=h*window.devicePixelRatio*h*window.devicePixelRatio,p=1/f*(1/f),y=a.ddDotScale?e.state.scale/a.ddDotScale:1;return o.setUniform1f("u_tileZoomFactor",f),o.setUniform1f("u_tileDotsOverArea",T/(n*window.devicePixelRatio*n*window.devicePixelRatio)),o.setUniformMatrix4fv("u_dotColors",a.ddColors),o.setUniform4fv("u_isActive",a.ddActiveDots),o.setUniform4fv("u_dotBackgroundColor",a.ddBackgroundColor),o.setUniform1f("u_dotValue",Math.max(1,a.ddDotValue*y*p)),this._bindDotDensityTextures(s,o,a,h),s.drawElements(_.TRIANGLES,r,c.UNSIGNED_INT,i),s.setViewport(l.x,l.y,l.width,l.height),s.bindFramebuffer(m),u.colorTexture}_createFBO(e){if(o(this._dotFBO)){const t=512,o=512,r={target:f.TEXTURE_2D,pixelFormat:h.RGBA,dataType:T.UNSIGNED_BYTE,samplingMode:p.NEAREST,wrapMode:y.CLAMP_TO_EDGE,width:t,height:o},i={colorTarget:x.TEXTURE,depthStencilTarget:D.DEPTH_STENCIL_RENDER_BUFFER},s=new w(e,{width:t,height:o,internalFormat:g.DEPTH_STENCIL});this._dotFBO=new S(e,i,r,s)}return this._dotFBO}_disposeTextures(){if(this._dotTextures){for(let e=0;e<this._dotTextures.length;e++)this._dotTextures[e].dispose();this._dotTextures=null}}_bindDotDensityTextures(e,t,o,r){const i=this._createDotDensityTextures(e,r,o.ddSeed);t.setUniform1iv("u_dotTextures",this._dotSamplers);for(let s=0;s<i.length;s++)e.bindTexture(i[s],this._dotSamplers[s])}_createDotDensityMesh(e,t,r){if(o(this._dotVAO)){const o=2,i=new Int16Array(262144*o);for(let e=0;e<512;e++)for(let t=0;t<512;t++)i[o*(t+512*e)]=t,i[o*(t+512*e)+1]=e;const s=u.createVertex(e,E.STATIC_DRAW,i);this._dotVAO=new O(e,t,r,{geometry:s},null)}return this._dotVAO}_createDotDensityTextures(e,t,o){if(this._dotTextureSize===t&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=t,this._seed=o),null===this._dotTextures){const i=new r(o);this._dotTextures=[this._allocDotDensityTexture(e,t,i),this._allocDotDensityTexture(e,t,i)]}return this._dotTextures}_allocDotDensityTexture(e,t,o){const r=new Float32Array(t*t*4);for(let i=0;i<r.length;i++)r[i]=o.getFloat();return new U(e,{wrapMode:y.REPEAT,pixelFormat:h.RGBA,dataType:T.FLOAT,samplingMode:p.NEAREST,width:t,height:t},r)}}export{N as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{
|
|
5
|
+
import{isSome as e}from"../../../../../core/maybe.js";import{WGLGeometryType as t}from"../enums.js";import{createProgramDescriptor as o}from"../Utils.js";import a from"./WGLGeometryBrush.js";import{LabelMaterialKey as n}from"../materialKey/MaterialKey.js";import{DataType as r,CompareFunction as i,PrimitiveType as s}from"../../../../webgl/enums.js";const m=e=>o(e.data,{geometry:[{location:0,name:"a_pos",count:2,type:r.SHORT},{location:1,name:"a_id",count:4,type:r.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:r.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:r.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texAndSize",count:4,type:r.UNSIGNED_BYTE},{location:5,name:"a_refSymbolAndPlacementOffset",count:4,type:r.UNSIGNED_BYTE},{location:6,name:"a_glyphData",count:4,type:r.UNSIGNED_BYTE},{location:7,name:"a_vertexOffset",count:2,type:r.SHORT},{location:8,name:"a_texCoords",count:2,type:r.UNSIGNED_SHORT}]});class l extends a{dispose(){}getGeometryType(){return t.LABEL}drawGeometry(t,o,a,l){const{context:c,painter:d,state:f,rendererInfo:u,passOptions:p,requestRender:y}=t,_=n.load(a.materialKey),E=e(p)&&"hittest"===p.type,N=_.mapAligned?1:0;if(!N&&Math.abs(o.key.level-Math.round(100*t.displayLevel)/100)>=1)return;const{bufferLayouts:S,attributes:U}=m(_),T=d.materialManager.getMaterialProgram(t,_,"materials/label",U,l);if(e(y)&&!E&&!T.isCompiled)return void y();t.context.setStencilFunction(i.EQUAL,0,255),c.useProgram(T),this._setSharedUniforms(T,t,o),d.textureManager.bindTextures(c,T,_);const G=1===N?f.displayViewMat3:f.displayMat3;this._setSizeVVUniforms(_,T,u,o),T.setUniform1f("u_mapRotation",Math.floor(f.rotation/360*254)),T.setUniform1f("u_mapAligned",N),T.setUniformMatrix3fv("u_displayMat3",G),T.setUniform1f("u_opacity",1),T.setUniform2fv("u_screenSize",t.state.size),T.setUniform1f("u_isHalo",1);const g=a.target.getVAO(c,S,U),I=a.indexFrom*Uint32Array.BYTES_PER_ELEMENT;c.bindVAO(g),c.drawElements(s.TRIANGLES,a.indexCount,r.UNSIGNED_INT,I),T.setUniform1f("u_isHalo",0),c.drawElements(s.TRIANGLES,a.indexCount,r.UNSIGNED_INT,I),c.setStencilTestEnabled(!0),c.setBlendingEnabled(!0)}}export{l as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as
|
|
5
|
+
import{isSome as e}from"../../../../../core/maybe.js";import{WGLGeometryType as t}from"../enums.js";import{createProgramDescriptor as o}from"../Utils.js";import a from"./WGLGeometryBrush.js";import{LineMaterialKey as n}from"../materialKey/MaterialKey.js";import{DataType as r,PrimitiveType as i}from"../../../../webgl/enums.js";const s=e=>o(e.data,{geometry:[{location:0,name:"a_pos",count:2,type:r.SHORT},{location:1,name:"a_id",count:4,type:r.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:r.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_offsetAndNormal",count:4,type:r.BYTE},{location:4,name:"a_accumulatedDistanceAndHalfWidth",count:2,type:r.UNSIGNED_SHORT},{location:5,name:"a_tlbr",count:4,type:r.UNSIGNED_SHORT},{location:6,name:"a_segmentDirection",count:4,type:r.BYTE},{location:7,name:"a_aux",count:2,type:r.UNSIGNED_SHORT},{location:8,name:"a_zoomRange",count:2,type:r.UNSIGNED_SHORT}]});class m extends a{dispose(){}getGeometryType(){return t.LINE}drawGeometry(t,o,a,m){const{context:l,painter:c,rendererInfo:u,displayLevel:p,passOptions:d,requestRender:y}=t,_=n.load(a.materialKey),f=e(d)&&"hittest"===d.type;let E=s(_),N=i.TRIANGLES;f&&(E=this._getTriangleDesc(a.materialKey,E),N=i.POINTS);const{attributes:g,bufferLayouts:S}=E,T=c.materialManager.getMaterialProgram(t,_,"materials/line",g,m);if(e(y)&&!f&&!T.isCompiled)return void y();const U=1/t.pixelRatio,G=0;l.useProgram(T),this._setSharedUniforms(T,t,o),_.textureBinding&&c.textureManager.bindTextures(l,T,_);const I=2**(p-o.key.level);T.setUniform1f("u_zoomFactor",I),T.setUniform1f("u_blur",G+U),T.setUniform1f("u_antialiasing",U),this._setSizeVVUniforms(_,T,u,o),this._setColorAndOpacityVVUniforms(_,T,u),l.setFaceCullingEnabled(!1);const x=a.target.getVAO(l,S,g,f);let D=a.indexCount,O=a.indexFrom*Uint32Array.BYTES_PER_ELEMENT;f&&(D/=3,O/=3),l.bindVAO(x),l.drawElements(N,D,r.UNSIGNED_INT,O)}}export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../../../../core/maybe.js";import{WGLGeometryType as e}from"../enums.js";import{createProgramDescriptor as o}from"../Utils.js";import a from"./WGLGeometryBrush.js";import{MarkerMaterialKey as n}from"../materialKey/MaterialKey.js";import{DataType as i,PrimitiveType as r}from"../../../../webgl/enums.js";const s=t=>o(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:i.SHORT},{location:1,name:"a_vertexOffset",count:2,type:i.SHORT},{location:2,name:"a_texCoords",count:2,type:i.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:i.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:i.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:i.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:i.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:i.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:i.UNSIGNED_SHORT}]});class m extends a{dispose(){}getGeometryType(){return e.MARKER}drawGeometry(e,o,a,m){const{context:l,painter:
|
|
5
|
+
import{isSome as t}from"../../../../../core/maybe.js";import{WGLGeometryType as e}from"../enums.js";import{createProgramDescriptor as o}from"../Utils.js";import a from"./WGLGeometryBrush.js";import{MarkerMaterialKey as n}from"../materialKey/MaterialKey.js";import{DataType as i,PrimitiveType as r}from"../../../../webgl/enums.js";const s=t=>o(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:i.SHORT},{location:1,name:"a_vertexOffset",count:2,type:i.SHORT},{location:2,name:"a_texCoords",count:2,type:i.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:i.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:i.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:i.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:i.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:i.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:i.UNSIGNED_SHORT}]});class m extends a{dispose(){}getGeometryType(){return e.MARKER}drawGeometry(e,o,a,m){const{context:l,painter:p,rendererInfo:c,state:d,passOptions:u,requestRender:y}=e,_=n.load(a.materialKey),E=t(u)&&"hittest"===u.type,{bufferLayouts:N,attributes:f}=s(_),S=p.materialManager.getMaterialProgram(e,_,"materials/icon",f,m);if(t(y)&&!E&&!S.isCompiled)return void y();l.useProgram(S),_.textureBinding&&p.textureManager.bindTextures(l,S,_,!0);let T=r.TRIANGLES;t(u)&&"hittest"===u.type&&(T=r.POINTS),this._setSharedUniforms(S,e,o);const U=_.vvRotation?d.displayViewMat3:d.displayMat3;S.setUniformMatrix3fv("u_displayMat3",U),this._setSizeVVUniforms(_,S,c,o),this._setColorAndOpacityVVUniforms(_,S,c),this._setRotationVVUniforms(_,S,c);const R=a.target.getVAO(l,N,f),G=a.indexFrom*Uint32Array.BYTES_PER_ELEMENT;l.bindVAO(R),l.drawElements(T,a.indexCount,i.UNSIGNED_INT,G)}}export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t}from"../../../../../core/maybe.js";import{WGLGeometryType as e}from"../enums.js";import{createProgramDescriptor as o}from"../Utils.js";import a from"./WGLGeometryBrush.js";import{TextMaterialKey as r}from"../materialKey/MaterialKey.js";import{DataType as n,PrimitiveType as i}from"../../../../webgl/enums.js";const s=t=>o(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:n.SHORT},{location:1,name:"a_id",count:4,type:n.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:n.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:n.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texFontSize",count:4,type:n.UNSIGNED_BYTE},{location:5,name:"a_aux",count:4,type:n.BYTE},{location:6,name:"a_zoomRange",count:2,type:n.UNSIGNED_SHORT},{location:7,name:"a_vertexOffset",count:2,type:n.SHORT},{location:8,name:"a_texCoords",count:2,type:n.UNSIGNED_SHORT}]});class m extends a{dispose(){}getGeometryType(){return e.TEXT}drawGeometry(e,o,a,m){const{context:l,painter:p,rendererInfo:u,state:
|
|
5
|
+
import{isSome as t}from"../../../../../core/maybe.js";import{WGLGeometryType as e}from"../enums.js";import{createProgramDescriptor as o}from"../Utils.js";import a from"./WGLGeometryBrush.js";import{TextMaterialKey as r}from"../materialKey/MaterialKey.js";import{DataType as n,PrimitiveType as i}from"../../../../webgl/enums.js";const s=t=>o(t.data,{geometry:[{location:0,name:"a_pos",count:2,type:n.SHORT},{location:1,name:"a_id",count:4,type:n.UNSIGNED_BYTE},{location:2,name:"a_color",count:4,type:n.UNSIGNED_BYTE,normalized:!0},{location:3,name:"a_haloColor",count:4,type:n.UNSIGNED_BYTE,normalized:!0},{location:4,name:"a_texFontSize",count:4,type:n.UNSIGNED_BYTE},{location:5,name:"a_aux",count:4,type:n.BYTE},{location:6,name:"a_zoomRange",count:2,type:n.UNSIGNED_SHORT},{location:7,name:"a_vertexOffset",count:2,type:n.SHORT},{location:8,name:"a_texCoords",count:2,type:n.UNSIGNED_SHORT}]});class m extends a{dispose(){}getGeometryType(){return e.TEXT}drawGeometry(e,o,a,m){const{context:l,painter:p,rendererInfo:u,state:d,passOptions:_,requestRender:c}=e,y=r.load(a.materialKey),f=t(_)&&"hittest"===_.type,{bufferLayouts:E,attributes:N}=s(y),T=p.materialManager.getMaterialProgram(e,y,"materials/text",N,m);if(t(c)&&!f&&!T.isCompiled)return void c();l.useProgram(T);let S=i.TRIANGLES;f&&(S=i.POINTS),this._setSharedUniforms(T,e,o),p.textureManager.bindTextures(l,T,y),T.setUniformMatrix3fv("u_displayMat3",d.displayMat3),T.setUniformMatrix3fv("u_displayViewMat3",d.displayViewMat3),this._setSizeVVUniforms(y,T,u,o),this._setColorAndOpacityVVUniforms(y,T,u),this._setRotationVVUniforms(y,T,u),T.setUniform1f("u_isHalo",1);const U=a.target.getVAO(l,E,N),x=a.indexFrom*Uint32Array.BYTES_PER_ELEMENT;l.bindVAO(U),l.drawElements(i.TRIANGLES,a.indexCount,n.UNSIGNED_INT,x),T.setUniform1f("u_isHalo",0),l.drawElements(S,a.indexCount,n.UNSIGNED_INT,x)}}export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Bloom as
|
|
5
|
+
import{Bloom as o}from"./Bloom.js";import{Blur as e}from"./Blur.js";import{Colorize as t}from"./Colorize.js";import{DropShadow as s}from"./DropShadow.js";import{Opacity as r}from"./Opacity.js";function c(o){switch(o){case"bloom":case"blur":case"opacity":case"drop-shadow":return o;default:return"colorize"}}const f={colorize:()=>new t,blur:()=>new e,bloom:()=>new o,opacity:()=>new r,"drop-shadow":()=>new s};class i{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach((o=>o.dispose())),this._effectMap.clear()}getPostProcessingEffects(o){if(!o||0===o.length)return[];const e=[];for(const t of o){const o=c(t.type);let s=this._effectMap.get(o);s||(s=f[o](),this._effectMap.set(o,s)),e.push({postProcessingEffect:s,effect:t})}return e}}export{i as EffectManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{abortMaybe as a,isSome as n,unwrap as i,isNone as s}from"../../core/maybe.js";import{createTask as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{abortMaybe as a,isSome as n,unwrap as i,isNone as s}from"../../core/maybe.js";import{createTask as r,isAborted as l}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{supportsHeightModelInfo as u,deriveHeightModelInfoFromLayer as c}from"../../geometry/support/heightModelInfoUtils.js";import{ViewingMode as d}from"../ViewingMode.js";import{projectWithEngineOrService as f}from"./projectionUtils.js";let h=class extends t{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return n(this.userSpatialReference)?this.userSpatialReference:i(this._spatialReferenceTask.spatialReference)}get extent(){return i(this._extentTask.extent)}get heightModelInfo(){return i(this._heightModelInfoTask.heightModelInfo)}get vcsWkid(){return i(this._heightModelInfoTask.vcsWkid)}get latestVcsWkid(){return i(this._heightModelInfoTask.latestVcsWkid)}get viewingMode(){return s(this.userSpatialReference)||this.userSpatialReference.equals(i(this._spatialReferenceTask.spatialReference))?i(this._spatialReferenceTask.viewingMode):null}get tileInfo(){return i(this._tileInfoTask.tileInfo)}get mapCollections(){var e,t,a,i;const s=null==(e=this.map)?void 0:e.call(this),r=[];return n(this.priorityCollection)&&r.push(this.priorityCollection),r.push({parent:null==s?void 0:s.basemap,layers:null==s||null==(t=s.basemap)?void 0:t.baseLayers},{layers:null==s?void 0:s.layers},{parent:null==s?void 0:s.ground,layers:null==s||null==(a=s.ground)?void 0:a.layers},{parent:null==s?void 0:s.basemap,layers:null==s||null==(i=s.basemap)?void 0:i.referenceLayers}),r}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){var e;if(this.suspended)return null!=(e=this._get("_spatialReferenceTask"))?e:{updating:!1};const{layers:t,updating:a}=this._allLayers;let i=null;for(const s of t){const e=this._getSupportedSpatialReferences(s);if(e.length>0){const t=this._narrowDownSpatialReferenceCandidates(i,e);n(t)&&(i=t)}if(n(i)&&1===i.length)break}if(a&&(s(i)||1!==i.length))return{updating:!0};const r=this._pickSpatialReferenceCandidate(i);return{spatialReference:n(r)?r.spatialReference:null,viewingMode:n(r)?r.viewingMode:null,updating:!1}}get _tileInfoTask(){var e,t,a,n,i,s,r,l;if(!this.required.tileInfo)return null!=(l=this._get("_tileInfoTask"))?l:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:o,updating:p}=this._collectLayers([{parent:null==(e=this.map)||null==(t=e.call(this))?void 0:t.basemap,layers:null==(a=this.map)||null==(n=a.call(this))||null==(i=n.basemap)?void 0:i.baseLayers},{layers:null==(s=this.map)||null==(r=s.call(this))?void 0:r.layers}]);if(o&&o.length>0&&"tileInfo"in o[0]){const e=o[0].tileInfo;return{tileInfo:e&&e.spatialReference.equals(this.spatialReference)?e:null,updating:!1}}return{updating:p}}get _heightModelInfoTask(){var e,t;if(!this.required.heightModelInfo||this.suspended&&null!=(e=this._get("_heightModelInfoTask"))&&e.heightModelInfo)return null!=(t=this._get("_heightModelInfoTask"))?t:{updating:!1};const{layers:a,updating:n}=this._allLayers;for(const r of a)if(u(r)){const e=c(r);var i,s;if(e)return{heightModelInfo:e,vcsWkid:null==(i=r.spatialReference)?void 0:i.vcsWkid,latestVcsWkid:null==(s=r.spatialReference)?void 0:s.latestVcsWkid,updating:!1}}return{updating:n}}get _extentCandidatesTask(){var e;if(this.suspended||!this.required.extent)return null!=(e=this._get("_extentCandidatesTask"))?e:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=this._allLayers,a=t.updating,i=[];for(const r of t.layers){var s;const e="fullExtents"in r&&r.fullExtents||(n(r.fullExtent)?[r.fullExtent]:[]),t=this.requiresExtentInSpatialReference?null:e[0],a=null!=(s=e.find((e=>e.spatialReference.equals(this.spatialReference))))?s:t;if(a)return{candidates:[{extent:a,layer:r}],updating:!1};if(this._getSupportedSpatialReferences(r).length>0)for(const n of e)i.push({extent:n,layer:r})}return{candidates:i,updating:a}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(s(e)||0===e.length)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(e),o=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&o.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:n(this._projectExtentTask.task)&&!this._projectExtentTask.task.finished}:(n(this._projectExtentTask.task)&&(this._projectExtentTask.task=a(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:o.clone(),task:r((async e=>{try{const t=await f(i.extent,o,i.layer.portalItem,e);this._projectExtentTask={...this._projectExtentTask,task:null,output:t}}catch(t){if(l(e))return;this._projectExtentTask={...this._projectExtentTask,task:null}}}))},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(s(e))return t;const a=[],i=(e,t)=>n(e)?n(t)?e===t&&e:e:t;for(const n of e)for(const e of t){if(!n.spatialReference.equals(e.spatialReference))continue;const t=i(n.viewingMode,e.viewingMode);if(!1!==t){a.push({spatialReference:n.spatialReference,viewingMode:t});break}}return a.length>0?a:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return s(e)||e.length<1?n(t)?{spatialReference:t,viewingMode:null}:null:(n(t)&&e.length>1&&e.some((({spatialReference:e})=>e.equals(t)))&&(e=e.filter((({spatialReference:e})=>e.equals(t)))),e.length>1&&e.some((({viewingMode:e})=>e!==d.Local))&&(e=e.filter((({viewingMode:e})=>e!==d.Local))),e[0])}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(0===t.length)return[];const a=[];for(const i of t){const t=this.getSpatialReferenceSupport({spatialReference:i,layer:e});if(n(t)){const e=n(t.constraints)?t.constraints:[{spatialReference:i,viewingMode:null}];for(const{spatialReference:t,viewingMode:n}of e)(!this.requiresExtentInSpatialReference||s(this.userSpatialReference)||t.equals(this.userSpatialReference))&&a.push({spatialReference:t,viewingMode:n})}}return a}_pickExtentCandidate(e){const t=this.spatialReference;return e.find((({extent:e})=>t.equals(e.spatialReference)))||e[0]}_collectLayers(e){var t;if("loaded"!==this._loadMaybe(null==(t=this.map)?void 0:t.call(this)))return{layers:[],updating:!0};const a={layers:[],preloading:-1,updating:!1};for(const n of e)if(this._collectCollection(n,a),a.preloading===this.sourcePreloadCount)break;return{layers:a.layers,updating:a.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const a of e.layers){switch(this._loadMaybe(a)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":t.updating||t.layers.push(a),"layers"in a&&this._collectCollection({layers:a.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e?"not-loaded"===e.loadStatus?(e.load(),"loading"):e.loadStatus:"loaded"}};e([o()],h.prototype,"required",void 0),e([o({constructOnly:!0})],h.prototype,"map",void 0),e([o({constructOnly:!0})],h.prototype,"getSpatialReferenceSupport",void 0),e([o()],h.prototype,"defaultSpatialReference",void 0),e([o()],h.prototype,"userSpatialReference",void 0),e([o()],h.prototype,"sourcePreloadCount",void 0),e([o()],h.prototype,"priorityCollection",void 0),e([o()],h.prototype,"requiresExtentInSpatialReference",void 0),e([o()],h.prototype,"suspended",void 0),e([o({readOnly:!0})],h.prototype,"ready",null),e([o({readOnly:!0})],h.prototype,"heightModelInfoReady",null),e([o({readOnly:!0})],h.prototype,"spatialReference",null),e([o({readOnly:!0})],h.prototype,"extent",null),e([o({readOnly:!0})],h.prototype,"heightModelInfo",null),e([o({readOnly:!0})],h.prototype,"vcsWkid",null),e([o({readOnly:!0})],h.prototype,"latestVcsWkid",null),e([o({readOnly:!0})],h.prototype,"viewingMode",null),e([o({readOnly:!0})],h.prototype,"tileInfo",null),e([o({readOnly:!0})],h.prototype,"mapCollections",null),e([o({readOnly:!0})],h.prototype,"_allLayers",null),e([o({readOnly:!0})],h.prototype,"_spatialReferenceTask",null),e([o({readOnly:!0})],h.prototype,"_tileInfoTask",null),e([o({readOnly:!0})],h.prototype,"_heightModelInfoTask",null),e([o({readOnly:!0})],h.prototype,"_extentCandidatesTask",null),e([o()],h.prototype,"_extentTask",null),e([o()],h.prototype,"_projectExtentTask",void 0),h=e([p("esri.views.support.DefaultsFromMap")],h);export{h as DefaultsFromMap};
|