@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.76 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeDehydratedPoint as t,setDehydratedPoint as e}from"../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as o,getConvertedElevationFromVector as r,absoluteHeightElevationInfo as u,getConvertedElevationFromXYZ as i}from"../../../support/elevationInfoUtils.js";function l(n,t,e){return f(n,t,e)}function f(t=0,e=0,o=0){return n(t,e,o)}function c(n){return n}function s(n){return n}function a(t,e,o){return c(n(t,e,o))}function d(n){const[t,e,o]=n;return n.length>3?[t,e,o,n[3]]:[t,e,o]}function p(n){return n[3]=1|((n.length>3?n[3]:void 0)??0),n}function v(n){return Boolean(1&((n.length>3?n[3]:void 0)??0))}function m(n,t,{coordinateHelper:e,elevationInfo:o},r){return n?h(e.vectorToDehydratedPoint(n,j),t,o,r):null}function h(n,t,e,r=f()){return r[0]=n.x,r[1]=n.y,r[2]=n.z??0,null==t||("2d"===t.type?r[2]=0:r[2]=o(t,n,e,u)??0),r}function y(n,o,r){return r?(e(r,n[0],n[1],n[2],o),r):t(n[0],n[1],n[2],o)}function g(n,o,{z:i,m:l},f,c){const{spatialReference:s,elevationInfo:a}=f;let d;if(null==i&&null==l)d=void 0;else if(null==o||"2d"===o.type)d=i??void 0;else{d=r(o,n,s,u,a)??0}const[p,v]=n;return c?e(c,p,v,d,s):c=t(p,v,d,s),null!=l&&(c.m=l,c.hasM=!0),c}function I(n,t,e,o,r=f()){const[l,c]=n;return r[0]=l,r[1]=c,n.length>3&&(r[3]=n[3]??0),"3d"!==e?.type?(r[2]=t.value,r):(r[2]=i(e,l,c,t.value,o,t.elevationInfo,u)??0,r)}const j=t(0,0,0,null);export{s as asVec2,d as clone,l as create,f as createWritable,m as fromAnyMapPoint,h as fromPoint,a as fromValues,c as fromVec3,v as isTarget,p as markAsTarget,y as toDehydratedPoint,g as toElevationAlignedDehydratedPoint,I as withSelfSnappingZ};