/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import{RasterVFTile as t}from"./RasterVFTile.js";import i from"../webgl/TileContainer.js";import{VectorFieldTechnique as s}from"../webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js";class r extends i{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(i){const s=this.tilingScheme.getTileBounds(e(),i),[r,o]=this.tilingScheme.size,h=this.tilingScheme.getTileResolution(i.level);return new t(i,h,s[0],s[3],r,o)}onAttach(){super.onAttach(),this._vectorFieldTechnique=new s}onDetach(){super.onDetach(),this._vectorFieldTechnique?.shutdown(),this._vectorFieldTechnique=void 0}doRender(e){this.visible&&1===e.drawPhase&&this._vectorFieldTechnique&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e);const{state:i}=e,s=this.tilingScheme.scaleToZoom(i.scale),r=this.children.map(e=>e.tileData);this._vectorFieldTechnique.render(e,{tiles:r,displayLevel:s})})}}export{r as RasterVFTileContainer};
