@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.62 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{WGLDrawPhase as e,FeatureSymbologyDrawOrder as s}from"../../../enums.js";import{FeatureTechnique as t}from"../FeatureTechnique.js";import{getSelectionDefines as r,getFeaturePipelineState as a,isHittest as i,getFeatureUniforms as o,resolveDynamicUniforms as n}from"../featureTechniqueUtils.js";import{TechniqueType as m}from"../TechniqueType.js";import{TextShader as u,TextRenderPassType as p}from"../text/TextShader.js";import{StencilOperation as d,CompareFunction as f}from"../../../../../../webgl/enums.js";class l extends t{constructor(){super(...arguments),this.type=m.Label,this.shaders={geometry:new u},this.drawPhase=e.LABEL|e.LABEL_ALPHA|e.HITTEST,this.symbologyPlane=s.TEXT}render(e,s){const{context:t,painter:m}=e,u=r(e),l={...a(e),stencil:{write:!1,test:{ref:()=>255,compare:f.GREATER,mask:255,op:{fail:d.KEEP,zFail:d.KEEP,zPass:d.KEEP}}}},c=s.instance.getInput(),h={shader:this.shaders.geometry,uniforms:{...n(e,s.target,c.uniforms),...o(e,s.target),mosaicInfo:m.textureManager.getMosaicInfo(t,s.textureKey)},defines:{...u,textRenderPassType:p.Color,isBackgroundPass:!0,isLabel:!0},optionalAttributes:c.optionalAttributes,useComputeBuffer:i(e)};m.setPipelineState(l),m.setShader(h),m.submitDraw(e,s),m.setShader({...h,defines:{...u,textRenderPassType:p.Halo,isBackgroundPass:!1,isLabel:!0}}),m.submitDraw(e,s),m.setShader({...h,defines:{...u,textRenderPassType:p.Color,isBackgroundPass:!1,isLabel:!0}}),m.submitDraw(e,s)}}export{l as LabelTechnique};