UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.14 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{getMetersPerUnitForSR as e,getMetersPerVerticalUnitForSR as t}from"../../../core/unitUtils.js";import{i as r}from"../../../chunks/vec32.js";import{create as o}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getGraphicEffectiveElevationInfo as n,zValueInAbsoluteHeightMode as s}from"../../../support/elevationInfoUtils.js";function i(o,i){const l=o?.geometry;if(!o||"mesh"!==l?.type||!i)return;const{renderCoordsHelper:p,elevationProvider:u}=i,{camera:h}=i.state,{extent:d}=l,{center:x,spatialReference:g}=d,v=e(g),j=t(g),z=e(p.spatialReference),y=d.width*v,C=d.height*j,R=(d.zmax??0)*j,U=R-(d.zmin??0)*j,b=Math.max(y,C,U)/z,{x:w,y:P}=x,S=x.z??0;r(f,w,P,S),p.toRenderCoords(f,g,f);const T=b/h.computeScreenPixelSizeAt(f);if(T>h.width*a)return"meshTooClose";if(T<m)return"meshTooFar";const k=n(o),{absoluteZ:A}=s(w,P,R,g,i,k);return A<(u.getElevation(w,P,S,g,"ground")??0)*j+U*c?"meshUnderground":"mesh"}const m=20,a=1,c=.1,f=o();export{i as getDrawMeshHelpMessage};