@arcgis/core 5.0.0-next.74 → 5.0.0-next.75
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/Color.d.ts +8 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{2a2f33df530b61e3a43f.js → 76b516b8c110ad983bf6.js} +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/config.js +1 -1
- package/core/urlUtils.d.ts +10 -0
- package/kernel.js +1 -1
- package/layers/mixins/PublishableLayer.d.ts +15 -0
- package/layers/support/PublishingInfo.d.ts +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
|
@@ -42,4 +42,19 @@ export abstract class PublishableLayer {
|
|
|
42
42
|
get publishingInfo(): PublishingInfo | null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Layer's publishing status while the layer is being published to the portal.
|
|
47
|
+
* The layer is automatically refreshed when the status goes from `publishing` to `unavailable` or `published`.
|
|
48
|
+
*
|
|
49
|
+
* **Possible Values**
|
|
50
|
+
* Value | Description |
|
|
51
|
+
* ----- | ----------- |
|
|
52
|
+
* unknown | The layer's publishing status is unknown at this point.
|
|
53
|
+
* unavailable | The layer doesn't provide publishing information.
|
|
54
|
+
* publishing | The publishing is in progress.
|
|
55
|
+
* published | The layer is published and ready for consumption.
|
|
56
|
+
*
|
|
57
|
+
*
|
|
58
|
+
* @see [PublishingInfo#status](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-PublishingInfo.html#status)
|
|
59
|
+
*/
|
|
45
60
|
export type PublishStatus = "unknown" | "unavailable" | "publishing" | "published";
|
|
@@ -19,13 +19,13 @@ export default class PublishingInfo extends Accessor {
|
|
|
19
19
|
* The layer is automatically refreshed when the status goes from `publishing` to `unavailable` or `published`.
|
|
20
20
|
*
|
|
21
21
|
* **Possible Values**
|
|
22
|
-
*
|
|
23
22
|
* Value | Description |
|
|
24
23
|
* ----- | ----------- |
|
|
25
24
|
* unknown | The layer's publishing status is unknown at this point.
|
|
26
25
|
* unavailable | The layer doesn't provide publishing information.
|
|
27
26
|
* publishing | The publishing is in progress.
|
|
28
27
|
* published | The layer is published and ready for consumption.
|
|
28
|
+
*
|
|
29
29
|
*
|
|
30
30
|
* @default "unknown"
|
|
31
31
|
*/
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const c="
|
|
5
|
+
const c="20251224",f="955d07c6f96d1c9a0f16ec5c07ac4c5c5ff8bae6";export{c as buildDate,f as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{RenderingDevice as e}from"../webgl/RenderingDevice.js";import{simplePipelineState as t}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as i}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";const s=1e-6;class n{constructor(s,n){this.spriteMosaic=s,this.glyphMosaic=n,this._vtlTechniques=new i,this._context=null,this._vtlTechniques.startup(),this._renderingDevice=new e,this._pipelineState=t}dispose(){this._vtlTechniques&&this._vtlTechniques.shutdown(this._context),this.spriteMosaic.dispose(),this.glyphMosaic.dispose(),this._context=null}drawSymbols(e,t,i){const n=i.layers;e.renderPass="translucent";const
|
|
5
|
+
import{RenderingDevice as e}from"../webgl/RenderingDevice.js";import{simplePipelineState as t}from"../webgl/shaderGraph/utils.js";import{VTLTechniquesRepo as i}from"../webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js";const s=1e-6;class n{constructor(s,n){this.spriteMosaic=s,this.glyphMosaic=n,this._vtlTechniques=new i,this._context=null,this._vtlTechniques.startup(),this._renderingDevice=new e,this._pipelineState=t}dispose(){this._vtlTechniques&&this._vtlTechniques.shutdown(this._context),this.spriteMosaic.dispose(),this.glyphMosaic.dispose(),this._renderingDevice.dispose(),this._context=null}drawSymbols(e,t,i){const n=i.layers;e.renderPass="translucent";const a=this._vtlTechniques.getTechnique(3);r[0]=t;for(let l=0;l<n.length;l++){const t=n[l];if(3!==t.type)continue;const i=t.getLayoutProperty("visibility");if(i&&1===i.getValue())continue;const o=e.displayLevel;void 0!==t.minzoom&&t.minzoom>o+s||void 0!==t.maxzoom&&t.maxzoom<=o-s||(e.styleLayerUID=t.uid,e.styleLayer=t,a.render(e,{tiles:r}))}r[0]=null}drawBackground(e,t,i){if(0===i.backgroundBucketIds.length)return;const{displayLevel:n,requiredLevel:a}=e;t.key.level=a,this._renderingDevice.setPipelineState({...this._pipelineState,color:{write:[!0,!0,!0,!0],blendMode:"composite"},stencil:!1,depth:!1}),e.renderPass="background";const l=this._vtlTechniques.getTechnique(0);r[0]=t,i.backgroundBucketIds.forEach(t=>{const a=i.getLayerById(t);if(0!==a.type)return;const o=a.getLayoutProperty("visibility");o&&1===o.getValue()||void 0!==a.minzoom&&a.minzoom>n+s||void 0!==a.maxzoom&&a.maxzoom<=n-s||(e.styleLayerUID=a.uid,e.styleLayer=a,l.render(e,{tiles:r}))}),r[0]=null}drawTile(e,i,s,n){const r=s.layers,{context:a}=e,l=a.getPipelineState(),{depthWrite:o}=l;let c=0,h=1;o&&void 0!==o.zNear&&void 0!==o.zFar&&(c=o.zNear,h=o.zFar),this._pipelineState={...t,color:{write:[!0,!0,!0,!0],blendMode:"none"},depth:{write:{zNear:c,zFar:h},test:515}},this._renderingDevice.setPipelineState(this._pipelineState);const u=r.filter(e=>{if(null!=n&&n!==e.type||!i.layerData.has(e.uid))return!1;const t=e.getLayoutProperty("visibility");return 1!==t?.getValue()});e.renderPass="opaque";for(let t=u.length-1;t>=0;--t)this._renderStyleLayer(u[t],e,i);this._pipelineState={...t,color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:{write:!1,test:515}},this._renderingDevice.setPipelineState(this._pipelineState),e.renderPass="translucent",u.forEach(t=>this._renderStyleLayer(t,e,i)),this._renderingDevice.setPipelineState({...this._pipelineState,depth:!1}),this._context||(this._context=e.context)}setShader(e){return this._renderingDevice.setShader(e)}setPipelineState(e){return this._renderingDevice.setPipelineState(e)}getPipelineState(){return this._renderingDevice.getPipelineState()}submitDraw(e,t,i){return this._renderingDevice.submitDraw(e,t,i)}submitDrawMesh(e,t,i,s){this._renderingDevice.submitDrawMesh(e,t,i,s)}submitDrawMeshUntyped(e,t,i,s){this._renderingDevice.submitDrawMeshUntyped(e,t,i,s)}updatePipelineState(e){return this._renderingDevice.updatePipelineState(e)}setStencilRef(e,t){return this._renderingDevice.setStencilRef(e,t)}_renderStyleLayer(e,t,i){const{renderPass:n}=t;let a;switch(e.type){case 0:if("background"!==n)return;a=this._vtlTechniques.getTechnique(0);break;case 1:if("opaque"!==n&&"translucent"!==t.renderPass)return;a=this._vtlTechniques.getTechnique(1);break;case 2:if("translucent"!==n)return;a=this._vtlTechniques.getTechnique(2);break;case 4:if("translucent"!==n)return;a=this._vtlTechniques.getTechnique(4);break;case 3:if("translucent"!==n)return;a=this._vtlTechniques.getTechnique(3)}const{displayLevel:l}=t,{minzoom:o,maxzoom:c}=e;void 0!==o&&o>l+s||void 0!==c&&c<=l-s||!a||(this._renderingDevice.setPipelineState({...this._pipelineState,stencil:{write:{mask:0},test:!1}}),t.styleLayerUID=e.uid,t.styleLayer=e,r[0]=i,a.render(t,{tiles:r}),r[0]=null)}}const r=[null];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/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{simplePipelineState as e}from"../../utils.js";import{Technique as t}from"../Technique.js";import{VTLShaderCircle as
|
|
5
|
+
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:f}=d,m=1.2,p=d.getPaintValue("circle-translate",i),y={transform:{dvsMat:null,displayMat:1===d.getPaintValue("circle-translate-anchor",i)?o.displayMat3:o.displayViewMat3},styleLayerConfig:{circleTranslation:p,depth:d.z,antialiasingWidth:m},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(y.transform.dvsMat=x.transforms.displayViewScreenMat3,x.key.level!==M){M=x.key.level;const e=f.getUniforms();for(const t of e){const e=t.getValue(d,i,M,a);t.name in y&&(y[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}}}),r.setStencilRef(l,o);const c={shader:this.shaders.circle,uniforms:y,defines:null,optionalAttributes:f.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:f.getPrecisionFactors()};r.submitDrawMeshUntyped(l,c,this._mesh,{stencilRef:x.stencilRef})}}}export{l as VTLTechniqueCircle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{vtlTextureBindingUnitSprites as t,vtlHighResCutoff as e}from"../../../definitions.js";import{Technique as i}from"../Technique.js";import{VTLShaderFill as
|
|
5
|
+
import{vtlTextureBindingUnitSprites as t,vtlHighResCutoff as e}from"../../../definitions.js";import{Technique as i}from"../Technique.js";import{VTLShaderFill as l}from"../shaders/vector-tiles/VTLShaderFill.js";import{VTLShaderOutline as s}from"../shaders/vector-tiles/VTLShaderOutline.js";const n=1/65536;class a extends i{constructor(){super(...arguments),this.type=37,this._fillMesh=null,this._outlineMesh=null,this.shaders={fill:new l,outline:new s}}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 g=u.getPaintValue("fill-translate",i),m=u.getPaintValue("fill-translate-anchor",i);(M||"translucent"!==l)&&this._drawFill(t,a,u,o,g,m,f,h,p);const v=!u.hasDataDrivenOutlineColor&&u.outlineUsesFillColor&&y<1;d&&"opaque"!==l&&!v&&this._drawOutline(t,a,u,o,g,m)}_drawFill(i,l,s,n,a,o,r,u,c){if(r&&!c&&null==u)return;const{context:f,displayLevel:p,state:h,painter:d,pixelRatio:M,spriteMosaic:y}=i,g=M>e?2:1,m=s.fillMaterial,v={transform:{dvsMat:null,displayMat:1===o?h.displayMat3:h.displayViewMat3},config:{depth:s.z,fillTranslation:a},patternOptions:c||r&&null!=u?{mosaicSize:[0,0],patternFactor:1,tlbr:[0,0,0,0],texture:{texture:null,unit:0}}:null,color:null,opacity:null,colorMix:null,opacityMix:null},x=r?1:0;if(null!=u){const{page:e,tl:i,br:l}=u,s=i[0],n=l[1],a=l[0],o=i[1],r=y.getPageSize(e);null!=r&&(y.bind(f,9729,e,t),v.patternOptions={mosaicSize:[r[0],r[1]],patternFactor:1,tlbr:[s,n,a,o],texture:{texture:y.getTexture(e),unit:t}})}let _=-1;for(const e of n){if(!e.layerData.has(l))continue;if(e.key.level!==_){_=e.key.level;const t=m.getUniforms();for(const e of t){const t=e.getValue(s,p,_,y);v[e.name]={value:t}}if(r&&null!=v.patternOptions){const t=Math.max(2**(Math.round(p)-e.key.level),1),i=e.rangeX/(g*e.width*t);v.patternOptions.patternFactor=i}}const i=e.layerData.get(l);if(this._fillMesh=i.getMesh(f,{value:0}),!this._fillMesh)continue;const{transform:n}=v;n.dvsMat=e.transforms.displayViewScreenMat3;const a={shader:this.shaders.fill,uniforms:v,defines:{fillType:x},optionalAttributes:m.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:m.getPrecisionFactors()};if(c){const l=v.patternOptions,s=i.patternMap;if(!s||null==l)continue;let n=0;for(const[i,o]of s){const s=y.getPageSize(i);null!=s&&(y.bind(f,9729,i,t),l.mosaicSize=s,l.texture={texture:y.getTexture(i),unit:t},d.submitDrawMeshUntyped(f,a,this._fillMesh,{stencilRef:e.stencilRef,parts:[n++]}))}}else d.submitDrawMeshUntyped(f,a,this._fillMesh,{stencilRef:e.stencilRef});e.triangleCount+=i.fillIndexCount/3}}_drawOutline(t,e,i,l,s,a){const{context:o,displayLevel:r,state:u,spriteMosaic:c,painter:f,pixelRatio:p}=t,h=i.outlineMaterial,d=.75/p,M={transform:{dvsMat3:null,displayMat3:1===a?u.displayMat3:u.displayViewMat3},config:{depth:i.z+n,fillTranslation:s,outlineWidth:d},color:null,opacity:null,colorMix:null,opacityMix:null};let y=-1;for(const n of l){if(!n.layerData.has(e))continue;if(n.key.level!==y){y=n.key.level;const t=h.getUniforms();for(const e of t){const t=e.getValue(i,r,y,c);e.name in M&&(M[e.name]={value:t})}}const t=n.layerData.get(e);if(this._outlineMesh=t.getMesh(o,{value:1}),null==this._outlineMesh)continue;const{transform:l}=M;l.dvsMat3=n.transforms.displayViewScreenMat3;const s={shader:this.shaders.outline,uniforms:M,defines:{},optionalAttributes:h.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:h.getPrecisionFactors()};f.submitDrawMeshUntyped(o,s,this._outlineMesh,{stencilRef:n.stencilRef}),n.triangleCount+=t.outlineIndexCount/3}}}export{a as VTLTechniqueFill};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{vtlTextureBindingUnitSprites as e}from"../../../definitions.js";import{Technique as t}from"../Technique.js";import{VTLShaderLine as i}from"../shaders/vector-tiles/VTLShaderLine.js";class
|
|
5
|
+
import{vtlTextureBindingUnitSprites as e}from"../../../definitions.js";import{Technique as t}from"../Technique.js";import{VTLShaderLine as i}from"../shaders/vector-tiles/VTLShaderLine.js";class s extends t{constructor(){super(...arguments),this.type=38,this._mesh=null,this.shaders={line:new i}}shutdown(){this._mesh&&(this._mesh.destroy(),this._mesh=null)}render(t,i){const{context:s,displayLevel:n,painter:l,pixelRatio:a,spriteMosaic:o,state:r,styleLayer:u,styleLayerUID:c}=t,{tiles:f}=i;if(!f.some(e=>e.layerData.get(c)?.lineIndexCount??!1))return;const h=u,p=h.lineMaterial,d=h.getPaintValue("line-translate",n),y=h.getPaintValue("line-translate-anchor",n),m=1/a,g={layerInfo:{displayViewMat3:r.displayViewMat3,displayMat3:1===y?r.displayMat3:r.displayViewMat3,lineTranslation:d,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},M=h.getPaintProperty("line-pattern"),x=void 0!==M,v=x&&M.isDataDriven;let D,P;if(x&&!v){const e=M.getValue(n);D=o.getMosaicItemPosition(e)}let V=!1;if(!x){const e=h.getPaintProperty("line-dasharray");if(P=void 0!==e,V=P&&e.isDataDriven,P&&!V){const t=e.getValue(n),i=h.getDashKey(t,h.getLayoutValue("line-cap",n));D=o.getMosaicItemPosition(i)}}const w=x?1:P?2:0;if(null!=D){const{page:t}=D,i=o.getPageSize(t);if(null!=i){o.bind(s,9729,t,e);const n={texture:{texture:o.getTexture(t),unit:e},mosaicSize:[i[0],i[1]]};g.page=n}}const{tileInfo:b}=g;let I=-1;for(const _ of f){if(!_.layerData.has(c))continue;if(b.dvsMat3=_.transforms.displayViewScreenMat3,_.key.level!==I){I=_.key.level;const e=p.getUniforms();for(const t of e){const e=t.getValue(h,n,I,o);t.name in g&&(g[t.name]={value:e})}}const t=2**(n-I)/a;b.zoomFactor=t;const i=_.layerData.get(c);if(!i.lineIndexCount)continue;if(this._mesh=i.getMesh(s),!this._mesh)continue;const r={shader:this.shaders.line,uniforms:g,defines:{lineType:w},optionalAttributes:p.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:p.getPrecisionFactors()};if(v||V){const t=i.patternMap;if(!t)continue;let n=0;for(const i of t.keys()){const t=o.getPageSize(i);null!=t&&(o.bind(s,9729,i,e),g.page={texture:{texture:o.getTexture(i),unit:e},mosaicSize:[t[0],t[1]]},l.submitDrawMeshUntyped(s,r,this._mesh,{stencilRef:_.stencilRef,parts:[n++]}))}}else l.submitDrawMeshUntyped(s,r,this._mesh,{stencilRef:_.stencilRef})}}}export{s as VTLTechniqueLine};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fadeDuration as e}from"../../../../vectorTiles/decluttering/config.js";import{vtlTextureBindingUnitSprites as t,vtlTextureBindingUnitGlyphs as
|
|
5
|
+
import{fadeDuration as e}from"../../../../vectorTiles/decluttering/config.js";import{vtlTextureBindingUnitSprites as t,vtlTextureBindingUnitGlyphs as i}from"../../../definitions.js";import{degToByte as a}from"../../../GeometryUtils.js";import{Technique as s}from"../Technique.js";import{VTLShaderIcon as l}from"../shaders/vector-tiles/VTLShaderIcon.js";import{VTLShaderText as n}from"../shaders/vector-tiles/VTLShaderText.js";const o=1/65536;class r extends s{constructor(){super(...arguments),this.type=39,this._iconMesh=null,this._textMesh=null,this.shaders={icon:new l,text:new n}}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:s}=t,l=i.getPipelineState();this._setRenderState(e),this._drawIcons(e,a,s),this._drawText(e,a,s),i.setPipelineState(l)}_drawIcons(i,s,l){const{context:n,displayLevel:o,spriteMosaic:r,state:c,styleLayerUID:u}=i,h=s.iconMaterial;let p,g=!1;for(const e of l)if(e.layerData.has(u)&&(p=e.layerData.get(u),p.iconPerPageElementsMap.size>0)){g=!0;break}if(!g)return;const d=s.getPaintValue("icon-translate",o),y=s.getPaintValue("icon-translate-anchor",o);let f=s.getLayoutValue("icon-rotation-alignment",o);2===f&&(f=0===s.getLayoutValue("symbol-placement",o)?1:0);const m=0===f,M=s.getLayoutValue("icon-keep-upright",o)&&m,x=p.isIconSDF,P={transform:{dvsMat3:null,displayViewMat3:0===f?c.displayViewMat3:c.displayMat3,displayMat3:1===y?c.displayMat3:c.displayViewMat3,mapRotation:a(c.rotation)},config:{depth:s.z,iconTranslation:d,level:10*o,keepUpright:M?1:0,fadeDuration:e/1e3,isStencilPass:i.stencilSymbols?1:0,time:null},page:{mosaicSize:null,texture:{texture:null,unit:t}},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 l)if(e.layerData.has(u)){if(e.key.level!==D){D=e.key.level;const t=h.getUniforms();for(const e of t){const t=e.getValue(s,o,D,r);P[e.name]={value:t}}}if(p=e.layerData.get(u),0!==p.iconPerPageElementsMap.size&&(this._iconMesh=p.getMesh(n,{value:0}),this._iconMesh)){p.updateOpacityInfo(),P.transform.dvsMat3=e.transforms.displayViewScreenMat3,P.config.time=(performance.now()-p.lastOpacityUpdate)/1e3;for(const[t,a]of p.iconPerPageElementsMap)this._renderIconRange(i,h,a,t,e,P,this._iconMesh,x)}}}_drawText(t,s,l){const{context:n,displayLevel:r,glyphMosaic:c,spriteMosaic:u,pixelRatio:h,state:p,styleLayerUID:g,requestRender:d,allowDelayedRender:y}=t,f=s.textMaterial;let m,M=!1;for(const e of l)if(e.layerData.has(g)&&(m=e.layerData.get(g),m.glyphPerPageElementsMap.size>0)){M=!0;break}if(!M)return;const x=s.getPaintProperty("text-opacity");if(x&&!x.isDataDriven&&0===x.getValue(r))return;const P=s.getPaintProperty("text-color"),D=P&&P.getValue(r),_=!P||P.isDataDriven||D&&4===D.length&&D[3]>0,w=s.getPaintProperty("text-halo-width"),V=s.getPaintProperty("text-halo-color"),v=V&&V.getValue(r),S=(!w||w.isDataDriven||w.getValue(r)>0)&&(!V||V.isDataDriven||v&&4===v.length&&v[3]>0);if(!_&&!S)return;const b=24/8;let z=s.getLayoutValue("text-rotation-alignment",r);2===z&&(z=0===s.getLayoutValue("symbol-placement",r)?1:0);const R=0===z,T=s.getLayoutValue("text-keep-upright",r)&&R,U=.8*b/h;this._glyphTextureSize||(this._glyphTextureSize=[c.width/4,c.height/4]);const L=s.getPaintValue("text-translate",r),k=s.getPaintValue("text-translate-anchor",r);if(y&&null!=d)return void d();const C={transform:{dvsMat3:null,displayViewMat3:0===z?p.displayViewMat3:p.displayMat3,displayMat3:1===k?p.displayMat3:p.displayViewMat3,mapRotation:a(p.rotation)},config:{depth:s.z+o,textTranslation:L,keepUpright:T?1:0,level:10*r,fadeDuration:e/1e3,antialiasingWidth:U,time:null,halo:null,isStencilPass:t.stencilSymbols?1:0},page:{mosaicSize:null,texture:{texture:null,unit:i}},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 I=-1;for(const e of l)if(e.layerData.has(g)){if(e.key.level!==I){I=e.key.level;const t=f.getUniforms();for(const e of t){const t=e.getValue(s,r,I,u);e.name in C&&(C[e.name]={value:t})}}m=e.layerData.get(g),0!==m.glyphPerPageElementsMap.size&&(C.transform.dvsMat3=e.transforms.displayViewScreenMat3,C.config.time=(performance.now()-m.lastOpacityUpdate)/1e3,this._textMesh=m.getMesh(n,{value:1}),this._textMesh&&(m.updateOpacityInfo(),m.glyphPerPageElementsMap.forEach((i,a)=>{this._renderGlyphRange(t,i,a,S,_,e,C,f,this._textMesh)})))}}_renderIconRange(e,i,a,s,l,n,o,r){const{context:c,is3D:u,painter:h,spriteMosaic:p}=e;p.bind(c,9729,s,t),n.page={mosaicSize:[p.getWidth(s)/4,p.getHeight(s)/4],texture:{texture:p.getTexture(s),unit:t}};const g={shader:this.shaders.icon,uniforms:n,defines:{iconType:r?1:0},optionalAttributes:i.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:i.getPrecisionFactors()};h.submitDrawMeshUntyped(c,g,o,{stencilRef:u?l.stencilRef:255}),l.triangleCount+=a[1]/3}_renderGlyphRange(e,t,a,s,l,n,o,r,c){const{context:u,is3D:h,painter:p,glyphMosaic:g}=e;g.bind(u,9729,a,i),o.page={mosaicSize:this._glyphTextureSize,texture:{texture:g.getTexture(a),unit:i}},s&&(o.config.halo=1,p.submitDrawMeshUntyped(u,{shader:this.shaders.text,uniforms:o,defines:null,optionalAttributes:r.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:r.getPrecisionFactors()},c,{stencilRef:h?n.stencilRef:255}),n.triangleCount+=t[1]/3),l&&(o.config.halo=0,p.submitDrawMeshUntyped(u,{shader:this.shaders.text,uniforms:o,defines:null,optionalAttributes:r.getUsedAttributes(),useComputeBuffer:!1,precisionFactors:r.getPrecisionFactors()},c,{stencilRef:h?n.stencilRef:255}),n.triangleCount+=t[1]/3)}_setRenderState(e){const{is3D:t,painter:i,stencilSymbols:a}=e;i.setPipelineState({color:{write:[!a,!a,!a,!a],blendMode:a?"none":"composite"},stencil:{write:!!a&&{mask:255},test:{compare:a?519:t?514:516,op:{fail:7680,zFail:7680,zPass:7681},mask:255}},depth:{write:!1,test:515}})}}export{r as VTLTechniqueSymbol};
|